@@ -48,14 +48,14 @@ def __init__(self, client: ApiCaller):
4848 @validate_arguments
4949 def create (
5050 self , users : List [AtlanUser ], return_info : bool = False
51- ) -> Optional [List [ AtlanUser ] ]:
51+ ) -> Optional [UserResponse ]:
5252 """
5353 Create one or more new users.
5454
5555 :param users: the details of the new users
5656 :param return_info: whether to return the details of created users, defaults to `False`
5757 :raises AtlanError: on any API communication issue
58- :returns: the list of details of created users if `return_info` is `True`, otherwise `None`
58+ :returns: a UserResponse object which contains the list of details of created users if `return_info` is `True`, otherwise `None`
5959 """
6060 from pyatlan .client .atlan import AtlanClient
6161
@@ -201,27 +201,27 @@ def get_all(
201201 limit : int = 20 ,
202202 offset : int = 0 ,
203203 sort : Optional [str ] = "username" ,
204- ) -> List [ AtlanUser ] :
204+ ) -> UserResponse :
205205 """
206- Retrieve all users defined in Atlan.
206+ Retrieve a UserResponse object containing a list of all users defined in Atlan.
207207
208208 :param limit: maximum number of users to retrieve
209209 :param offset: starting point for the list of users when paging
210210 :param sort: property by which to sort the results, by default : `username`
211- :returns: a list of all the users in Atlan
211+ :returns: a UserResponse object with all users based on the parameters; results are iterable.
212212 """
213213 response : UserResponse = self .get (offset = offset , limit = limit , sort = sort )
214- return [ user for user in response ]
214+ return response
215215
216216 @validate_arguments
217217 def get_by_email (
218218 self ,
219219 email : str ,
220220 limit : int = 20 ,
221221 offset : int = 0 ,
222- ) -> Optional [List [ AtlanUser ] ]:
222+ ) -> Optional [UserResponse ]:
223223 """
224- Retrieves all users with email addresses that contain the provided email.
224+ Retrieves a UserResponse object containing a list of users with email addresses that contain the provided email.
225225 (This could include a complete email address, in which case there should be at
226226 most a single item in the returned list, or could be a partial email address
227227 such as "@example.com" to retrieve all users with that domain in their email
@@ -230,35 +230,35 @@ def get_by_email(
230230 :param email: on which to filter the users
231231 :param limit: maximum number of users to retrieve
232232 :param offset: starting point for the list of users when pagin
233- :returns: all users whose email addresses contain the provided string
233+ :returns: a UserResponse object containing a list of users whose email addresses contain the provided string
234234 """
235- if response : = self .get (
235+ response : UserResponse = self .get (
236236 offset = offset ,
237237 limit = limit ,
238238 post_filter = '{"email":{"$ilike":"%' + email + '%"}}' ,
239- ):
240- return response .records
241- return None
239+ )
240+ return response
242241
243242 @validate_arguments
244243 def get_by_emails (
245244 self ,
246245 emails : List [str ],
247246 limit : int = 20 ,
248247 offset : int = 0 ,
249- ) -> Optional [List [ AtlanUser ] ]:
248+ ) -> Optional [UserResponse ]:
250249 """
251- Retrieves all users with email addresses that match the provided list of emails.
250+ Retrieves a UserResponse object containing a list of users with email addresses that match the provided list of emails.
252251
253252 :param emails: list of email addresses to filter the users
254253 :param limit: maximum number of users to retrieve
255254 :param offset: starting point for the list of users when paginating
256- :returns: list of users whose email addresses match the provided list
255+ :returns: a UserResponse object containing a list of users whose email addresses match the provided list
257256 """
258257 email_filter = '{"email":{"$in":' + dumps (emails or ["" ]) + "}}"
259- if response := self .get (offset = offset , limit = limit , post_filter = email_filter ):
260- return response .records
261- return None
258+ response : UserResponse = self .get (
259+ offset = offset , limit = limit , post_filter = email_filter
260+ )
261+ return response
262262
263263 @validate_arguments
264264 def get_by_username (self , username : str ) -> Optional [AtlanUser ]:
@@ -281,21 +281,20 @@ def get_by_username(self, username: str) -> Optional[AtlanUser]:
281281 @validate_arguments
282282 def get_by_usernames (
283283 self , usernames : List [str ], limit : int = 5 , offset : int = 0
284- ) -> Optional [List [ AtlanUser ] ]:
284+ ) -> Optional [UserResponse ]:
285285 """
286- Retrieves users based on their usernames.
286+ Retrieves a UserResponse object containing a list of users based on their usernames.
287287
288288 :param usernames: the list of usernames by which to find the users
289289 :param limit: maximum number of users to retrieve
290290 :param offset: starting point for the list of users when paginating
291- :returns: the users with the specified usernames
291+ :returns: a UserResponse object containing list of users with the specified usernames
292292 """
293293 username_filter = '{"username":{"$in":' + dumps (usernames or ["" ]) + "}}"
294- if response : = self .get (
294+ response : UserResponse = self .get (
295295 offset = offset , limit = limit , post_filter = username_filter
296- ):
297- return response .records
298- return None
296+ )
297+ return response
299298
300299 @validate_arguments
301300 def add_to_groups (
0 commit comments