
    i                     V   S r SSKJrJr  SSKrSSKJrJrJr  SSK	J
r
  SSKJr  SSKJr  SS	KJr   " S
 S\5      r " S S5      r " S S5      r " S S5      r " S S5      r " S S5      r " S S5      r " S S5      r " S S5      r " S S5      r " S S5      r " S  S!5      rg)"zR
Manage the lifecycle of your users using User Management APIs.

API Version: 1.0
    )DictListN)BaseServiceDetailedResponseget_query_param)Authenticator)"get_authenticator_from_environment)convert_model   )get_sdk_headersc                      \ rS rSrSrSrSr\\4S\SS 4S jj5       r	 S3S	\
SS4S
 jjrSSSSSS.S\S\S\S\S\S\S\4S jjrSSSS.S\S\S   S\S   S\\   S\4
S jjrSS.S\S\S\S\4S jjrSSSSSSSSS.S\S\S\S \S!\S"\S#\S$\S%\S\S\4S& jjrSS.S\S\S\S\4S' jjrSS(.S\S\4S) jjrS\S\S\4S* jrS\S\S\4S+ jrSSSSS,.S\S\S-\S.\S/\S0\S\4S1 jjrS2rg)4UserManagementV1(   zThe User Management V1 service.z%https://user-management.cloud.ibm.comuser_managementservice_namereturnc                 N    [        U5      nU " U5      nUR                  U5        U$ )zw
Return a new client for the User Management service using the specified
       parameters and external configuration.
)r	   configure_service)clsr   authenticatorservices       b/home/james-whalen/.local/lib/python3.13/site-packages/ibm_platform_services/user_management_v1.pynew_instanceUserManagementV1.new_instance.   s+     ;<Hm$!!,/    Nr   c                 B    [         R                  " X R                  US9  g)a6  
Construct a new client for the User Management service.

:param Authenticator authenticator: The authenticator specifies the authentication mechanism.
       Get up to date information from https://github.com/IBM/python-sdk-core/blob/main/README.md
       about initializing the authenticator of your choice.
)service_urlr   N)r   __init__DEFAULT_SERVICE_URL)selfr   s     r   r   UserManagementV1.__init__<   s     	T/G/GWder   )limitinclude_settingssearchstartuser_id
account_idr"   r#   r$   r%   r&   c                   U(       d  [        S5      e0 n[        U R                  SSS9n	UR                  U	5        UUUUUS.n
SU;   a#  UR                  UR	                  S5      5        US	 SUS'   S	/nU R                  U5      n[        [        X5      5      nS
R                  " S0 UD6nU R                  SUUU
S9nU R                  " U40 UD6nU$ )a  
List users.

Retrieve users in the account. You can use the IAM service token or a user token
for authorization. To use this method, the requesting user or service ID must have
at least the viewer, editor, or administrator role on the User Management service.
If unrestricted view is enabled, the user can see all users in the same account
without an IAM role. If restricted view is enabled and user has the viewer,
editor, or administrator role on the user management service, the API returns all
users in the account. If unrestricted view is enabled and the user does not have
these roles, the API returns only the current user. Users are returned in a
paginated list with a default limit of 100 users. You can iterate through all
users by following the `next_url` field. Additional substring search fields are
supported to filter the users.

:param str account_id: The account ID of the specified user.
:param int limit: (optional) The number of results to be returned.
:param bool include_settings: (optional) The user settings to be returned.
       Set to true to view language, allowed IP address, and authentication
       settings.
:param str search: (optional) The desired search results to be returned. To
       view the list of users with the additional search filter, use the following
       query options: `firstname`, `lastname`, `email`, `state`, `substate`,
       `iam_id`, `realm`, and `userId`. HTML URL encoding for the search query and
       `:` must be used. For example, search=state%3AINVALID returns a list of
       invalid users. Multiple search queries can be combined to obtain `OR`
       results using `,` operator (not URL encoded). For example,
       search=state%3AINVALID,email%3Amail.test.ibm.com.
:param str start: (optional) An optional token that indicates the beginning
       of the page of results to be returned. If omitted, the first page of
       results is returned. This value is obtained from the 'next_url' field of
       the operation response.
:param str user_id: (optional) Filter users based on their user ID.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
:rtype: DetailedResponse with `dict` result representing a `UserList` object
account_id must be providedV1
list_usersr   service_versionoperation_id)r"   r#   r$   _startr&   headersapplication/jsonAcceptr'   /v2/accounts/{account_id}/usersGETmethodurlr0   params 
ValueErrorr   DEFAULT_SERVICE_NAMEupdategetencode_path_varsdictzipformatprepare_requestsend)r    r'   r"   r#   r$   r%   r&   kwargsr0   sdk_headersr8   path_param_keyspath_param_valuespath_param_dictr7   requestresponses                    r   r+   UserManagementV1.list_usersM   s    b :;;%22 %

 	{#  0
 NN6::i01y!.'. 11*=s?FG/66II&&	 ' 
 99W//r   users
iam_policyaccess_groupsrN   
InviteUserrO   InviteUserIamPolicyrP   c                   U(       d  [        S5      eUb  U Vs/ s H  n[        U5      PM     nnUb  U Vs/ s H  n[        U5      PM     nn0 n[        U R                  SSS9nUR	                  U5        UUUS.n	U	R                  5        V
Vs0 s H  u  pUc  M
  X_M     n	n
n[        R                  " U	5      n	SUS'   SU;   a#  UR	                  UR                  S5      5        US	 SUS	'   S
/nU R                  U5      n[        [        X5      5      nSR                  " S0 UD6nU R                  SUUU	S9nU R                  " U40 UD6nU$ s  snf s  snf s  snn
f )a  
Invite users to an account.

Invite users to the account. You must use a user token for authorization. Service
IDs can't invite users to the account. To use this method, the requesting user
must have the editor or administrator role on the User Management service. For
more information, see the [Inviting
users](https://cloud.ibm.com/docs/account?topic=account-iamuserinv) documentation.
You can specify the user account role and the corresponding IAM policy information
in the request body. <br/><br/>When you invite a user to an account, the user is
initially created in the `PROCESSING` state. After the user is successfully
created, all specified permissions are configured, and the activation email is
sent, the invited user is transitioned to the `PENDING` state. When the invited
user clicks the activation email and creates and confirms their IBM Cloud account,
the user is transitioned to `ACTIVE` state. If the user email is already verified,
no email is generated.

:param str account_id: The account ID of the specified user.
:param List[InviteUser] users: (optional) A list of users to be invited.
:param List[InviteUserIamPolicy] iam_policy: (optional) A list of IAM
       policies.
:param List[str] access_groups: (optional) A list of access groups.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
:rtype: DetailedResponse with `dict` result representing a `InvitedUserList` object
r)   r*   invite_usersr,   rM   r1   content-typer0   r2   r'   r3   POSTr6   r7   r0   datar9   )r;   r
   r   r<   r=   itemsjsondumpsr>   r?   r@   rA   rB   rC   rD   )r    r'   rN   rO   rP   rE   xr0   rF   rX   kvrG   rH   rI   r7   rJ   rK   s                     r   rT   UserManagementV1.invite_users   s   H :;;/45u!]1%uE5!4>?Jq-*JJ?%22 '

 	{# $*

 $(::<A<!1<Azz$"4NN6::i01y!.'. 11*=s?FG/66II&&	 ' 
 99W//K 6? Bs   EE	EE)include_activityiam_idr`   c                   U(       d  [        S5      eU(       d  [        S5      e0 n[        U R                  SSS9nUR                  U5        SU0nSU;   a#  UR                  UR	                  S5      5        US	 SUS	'   S
S/nU R                  X5      n	[        [        X5      5      n
SR                  " S0 U
D6nU R                  SUUUS9nU R                  " U40 UD6nU$ )a  
Get user profile.

Retrieve a user's profile by the user's IAM ID in your account. You can use the
IAM service token or a user token for authorization. To use this method, the
requesting user or service ID must have at least the viewer, editor, or
administrator role on the User Management service.

:param str account_id: The account ID of the specified user.
:param str iam_id: The user's IAM ID.
:param str include_activity: (optional) Include activity information of the
       user, such as the last authentication timestamp.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
:rtype: DetailedResponse with `dict` result representing a `UserProfile` object
r)   iam_id must be providedr*   get_user_profiler,   r`   r0   r1   r2   r'   ra   (/v2/accounts/{account_id}/users/{iam_id}r4   r5   r9   r:   r    r'   ra   r`   rE   r0   rF   r8   rG   rH   rI   r7   rJ   rK   s                 r   rd   !UserManagementV1.get_user_profile   s   2 :;;677%22 +

 	{#  0
 NN6::i01y!.'2 11*Es?FG8??R/R&&	 ' 
 99W//r   )	firstnamelastnamestateemailphonenumberaltphonenumberphotor`   rh   ri   rj   rk   rl   rm   rn   c                h   U(       d  [        S5      eU(       d  [        S5      e0 n[        U R                  SSS9nUR                  U5        SU
0nUUUUUUU	S.nUR	                  5        VVs0 s H  u  nnUc  M  UU_M     nnn[
        R                  " U5      nSUS	'   S
U;   a#  UR                  UR                  S
5      5        US
	 SS/nU R                  X5      n[        [        UU5      5      nSR                  " S0 UD6nU R                  SUUUUS9nU R                  " U40 UD6nU$ s  snnf )aB  
Partially update user profile.

Partially update a user's profile by user's IAM ID. You can use the IAM service
token or a user token for authorization. To use this method, the requesting user
or service ID must have at least the editor or administrator role on the User
Management service. A user or service ID with these roles can change a user's
state between `ACTIVE`, `VPN_ONLY`, or `DISABLED_CLASSIC_INFRASTRUCTURE`, but they
can't change the state to `PROCESSING` or `PENDING` because these are system
states. For other request body fields, a user can update their own profile without
having User Management service permissions.

:param str account_id: The account ID of the specified user.
:param str iam_id: The user's IAM ID.
:param str firstname: (optional) The first name of the user.
:param str lastname: (optional) The last name of the user.
:param str state: (optional) The state of the user. Possible values are
       `PROCESSING`, `PENDING`, `ACTIVE`, `DISABLED_CLASSIC_INFRASTRUCTURE`, and
       `VPN_ONLY`.
:param str email: (optional) The email address of the user.
:param str phonenumber: (optional) The phone number of the user.
:param str altphonenumber: (optional) The alternative phone number of the
       user.
:param str photo: (optional) A link to a photo of the user.
:param str include_activity: (optional) Include activity information of the
       user, such as the last authentication timestamp.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
:rtype: DetailedResponse
r)   rc   r*   update_user_profiler,   r`   )rh   ri   rj   rk   rl   rm   rn   r1   rU   r0   r'   ra   re   PATCH)r6   r7   r0   r8   rX   r9   r;   r   r<   r=   rY   rZ   r[   r>   r?   r@   rA   rB   rC   rD   )r    r'   ra   rh   ri   rj   rk   rl   rm   rn   r`   rE   r0   rF   r8   rX   r]   r^   rG   rH   rI   r7   rJ   rK   s                           r   rp   $UserManagementV1.update_user_profile-  se   \ :;;677%22 .

 	{#  0

 # &,
 $(::<A<!Q11<Azz$"4NN6::i01y!'2 11*Es?4EFG8??R/R&& ' 
 99W//+ Bs   .
D.<D.c                   U(       d  [        S5      eU(       d  [        S5      e0 n[        U R                  SSS9nUR                  U5        SU0nSU;   a#  UR                  UR	                  S5      5        US	 SS	/nU R                  X5      n	[        [        X5      5      n
S
R                  " S0 U
D6nU R                  SUUUS9nU R                  " U40 UD6nU$ )a#  
Remove user from account.

Remove users from an account by user's IAM ID. You must use a user token for
authorization. Service IDs can't remove users from an account. To use this method,
the requesting user must have the editor or administrator role on the User
Management service. For more information, see the [Removing
users](https://cloud.ibm.com/docs/account?topic=account-remove) documentation.

:param str account_id: The account ID of the specified user.
:param str iam_id: The user's IAM ID.
:param str include_activity: (optional) Include activity information of the
       user, such as the last authentication timestamp.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
:rtype: DetailedResponse
r)   rc   r*   remove_userr,   r`   r0   r'   ra   re   DELETEr5   r9   r:   rf   s                 r   ru   UserManagementV1.remove_user  s    4 :;;677%22 &

 	{#  0
 NN6::i01y!'2 11*Es?FG8??R/R&&	 ' 
 99W//r   )r'   c                   0 n[        U R                  SSS9nUR                  U5        SU0nUR                  5        VVs0 s H  u  pgUc  M
  Xg_M     nnn[        R
                  " U5      nSUS'   SU;   a#  UR                  UR                  S5      5        US	 SnU R                  S	UUUS
9n	U R                  " U	40 UD6n
U
$ s  snnf )a&  
Accept an invitation.

Accept a user invitation to an account. You can use the user's token for
authorization. To use this method, the requesting user must provide the account ID
for the account that they are accepting an invitation for. If the user already
accepted the invitation request, it returns 204 with no response body.

:param str account_id: (optional) The account ID.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
:rtype: DetailedResponse
r*   acceptr,   r'   r1   rU   r0   z/v2/users/acceptrV   rW   )	r   r<   r=   rY   rZ   r[   r>   rC   rD   )r    r'   rE   r0   rF   rX   r]   r^   r7   rJ   rK   s              r   ry   UserManagementV1.accept  s    ( %22 !

 	{# *
 $(::<A<!1<Azz$"4NN6::i01y! &&	 ' 
 99W//# Bs    	CCc                    U(       d  [        S5      eU(       d  [        S5      e0 n[        U R                  SSS9nUR                  U5        SU;   a#  UR                  UR	                  S5      5        US	 SS/nU R                  X5      n[        [        Xg5      5      nS	R                  " S0 UD6n	U R                  S
U	US9n
U R                  " U
40 UD6nU$ )a	  
Remove user from account (Asynchronous).

Remove users from an account by using the user's IAM ID. You must use a user token
for authorization. Service IDs can't remove users from an account. If removing the
user fails it will set the user's state to ERROR_WHILE_DELETING. To use this
method, the requesting user must have the editor or administrator role on the User
Management service. For more information, see the [Removing
users](https://cloud.ibm.com/docs/account?topic=account-remove) documentation.

:param str account_id: The account ID of the specified user.
:param str iam_id: The user's IAM ID.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
:rtype: DetailedResponse
r)   rc   r*   v3_remove_userr,   r0   r'   ra   z(/v3/accounts/{account_id}/users/{iam_id}rv   r6   r7   r0   r9   r:   r    r'   ra   rE   r0   rF   rG   rH   rI   r7   rJ   rK   s               r   r|   UserManagementV1.v3_remove_user  s    . :;;677%22 )

 	{#NN6::i01y!'2 11*Es?FG8??R/R&& ' 
 99W//r   c                    U(       d  [        S5      eU(       d  [        S5      e0 n[        U R                  SSS9nUR                  U5        SU;   a#  UR                  UR	                  S5      5        US	 SUS'   S	S
/nU R                  X5      n[        [        Xg5      5      nSR                  " S0 UD6n	U R                  SU	US9n
U R                  " U
40 UD6nU$ )a  
Get user settings.

Retrieve a user's settings by the user's IAM ID. You can use the IAM service token
or a user token for authorization. To use this method, the requesting user or
service ID must have the viewer, editor, or administrator role on the User
Management service. <br/><br/>The user settings have several fields. The
`language` field is the language setting for the user interface display language.
The `notification_language` field is the language setting for phone and email
notifications. The `allowed_ip_addresses` field specifies a list of IP addresses
that the user can log in and perform operations from as described in [Allowing
specific IP addresses for a
user](https://cloud.ibm.com/docs/account?topic=account-ips). For information about
the `self_manage` field, review information about the [user-managed login
setting](https://cloud.ibm.com/docs/account?topic=account-types).

:param str account_id: The account ID of the specified user.
:param str iam_id: The user's IAM ID.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
:rtype: DetailedResponse with `dict` result representing a `UserSettings` object
r)   rc   r*   get_user_settingsr,   r0   r1   r2   r'   ra   1/v2/accounts/{account_id}/users/{iam_id}/settingsr4   r}   r9   r:   r~   s               r   r   "UserManagementV1.get_user_settings1  s    : :;;677%22 ,

 	{#NN6::i01y!.'2 11*Es?FGAHH[?[&& ' 
 99W//r   languagenotification_languageallowed_ip_addressesself_manager   r   r   r   c                R   U(       d  [        S5      eU(       d  [        S5      e0 n[        U R                  SSS9n	UR                  U	5        UUUUS.n
U
R	                  5        VVs0 s H  u  pUc  M
  X_M     n
nn[
        R                  " U
5      n
SUS'   S	U;   a#  UR                  UR                  S	5      5        US		 S
S/nU R                  X5      n[        [        X5      5      nSR                  " S0 UD6nU R                  SUUU
S9nU R                  " U40 UD6nU$ s  snnf )a  
Partially update user settings.

Update a user's settings by the user's IAM ID. You can use the IAM service token
or a user token for authorization. To fully use this method, the user or service
ID must have the editor or administrator role on the User Management service.
Without these roles, a user can update only their own `language` or
`notification_language` fields. If `self_manage` is `true`, the user can also
update the `allowed_ip_addresses` field.

:param str account_id: The account ID of the specified user.
:param str iam_id: The user's IAM ID.
:param str language: (optional) The console UI language. By default, this
       field is empty.
:param str notification_language: (optional) The language for email and
       phone notifications. By default, this field is empty.
:param str allowed_ip_addresses: (optional) A comma-separated list of IP
       addresses.
:param bool self_manage: (optional) Whether user managed login is enabled.
       The default value is `false`.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
:rtype: DetailedResponse
r)   rc   r*   update_user_settingsr,   r   r1   rU   r0   r'   ra   r   rq   rW   r9   rr   )r    r'   ra   r   r   r   r   rE   r0   rF   rX   r]   r^   rG   rH   rI   r7   rJ   rK   s                      r   r   %UserManagementV1.update_user_settingsl  sC   H :;;677%22 /

 	{# !%:$8&	
 $(::<A<!1<Azz$"4NN6::i01y!'2 11*Es?FGAHH[?[&&	 ' 
 99W//) Bs   '	D#4D#r9   )N)__name__
__module____qualname____firstlineno____doc__r   r<   classmethodstrr   r   r   intboolr   r+   r   rT   rd   rp   ru   ry   r|   r   r   __static_attributes__r9   r   r   r   r   (   s   )A, 1 
  (,f$f 
f* !%TT 	T
 T T T T 
Tt %)26#'LL L!	L
 ./L CyL 
Lf !%:: :
 : 
:B " $\\ \
 \ \ \ \ \ \ \ \ 
\F !%:: :
 : 
:~ 0 0
 
0d22 2
 
2p99 9
 
9@ %)$( JJ J
 J  #J "J J 
J Jr   r   c            	           \ rS rSrSrSSSS.S\S\S\SS4S	 jjr\S
\SS 4S j5       r	\S 5       r
S\4S jrS rS\4S jrSS S\4S jrSS S\4S jrSrg)InvitedUseri  a  
Information about a user that has been invited to join an account.

:attr str email: (optional) The email address associated with the invited user.
:attr str id: (optional) The id associated with the invited user.
:attr str state: (optional) The state of the invitation for the user.
Nrk   idrj   rk   r   rj   r   c                (    Xl         X l        X0l        g)a  
Initialize a InvitedUser object.

:param str email: (optional) The email address associated with the invited
       user.
:param str id: (optional) The id associated with the invited user.
:param str state: (optional) The state of the invitation for the user.
Nr   )r    rk   r   rj   s       r   r   InvitedUser.__init__  s     

r   _dictc                     0 nSU;   a  UR                  S5      US'   SU;   a  UR                  S5      US'   SU;   a  UR                  S5      US'   U " S0 UD6$ )7Initialize a InvitedUser object from a json dictionary.rk   r   rj   r9   r>   r   r   argss      r   	from_dictInvitedUser.from_dict  sa     e!IIg.DM5=4DJe!IIg.DM{T{r   c                 $    U R                  U5      $ )r   r   r   r   s     r   
_from_dictInvitedUser._from_dict       }}U##r   c                    0 n[        U S5      (       a  U R                  b  U R                  US'   [        U S5      (       a  U R                  b  U R                  US'   [        U S5      (       a  U R                  b  U R                  US'   U$ )1Return a json dictionary representing this model.rk   r   rj   )hasattrrk   r   rj   r    r   s     r   to_dictInvitedUser.to_dict  su    4!!djj&<!ZZE'N4477#6''E$K4!!djj&<!ZZE'Nr   c                 "    U R                  5       $ r   r   r    s    r   _to_dictInvitedUser._to_dict      ||~r   c                 H    [         R                  " U R                  5       SS9$ )z2Return a `str` version of this InvitedUser object.   indentrZ   r[   r   r   s    r   __str__InvitedUser.__str__      zz$,,.33r   otherc                 j    [        XR                  5      (       d  gU R                  UR                  :H  $ z=Return `true` when self and other are equal, false otherwise.F
isinstance	__class____dict__r    r   s     r   __eq__InvitedUser.__eq__  '    %00}}..r   c                     X:X  + $ zAReturn `true` when self and other are not equal, false otherwise.r9   r   s     r   __ne__InvitedUser.__ne__        r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r9   r   r   r   r     s       	
  
& 	d 	} 	 	 $ $	 	4 4/M /d /!M !d !r   r   c                       \ rS rSrSrSS.S\S   SS4S jjr\S	\SS 4S
 j5       r	\S 5       r
S\4S jrS rS\4S jrSS S\4S jrSS S\4S jrSrg)InvitedUserListi	  z
A collection of invited users.  This is the response returned by the invite_users
operation.

:attr List[InvitedUser] resources: (optional) The list of users that have been
      invited to join the account.
N	resourcesr   r   r   c                    Xl         g)z
Initialize a InvitedUserList object.

:param List[InvitedUser] resources: (optional) The list of users that have
       been invited to join the account.
Nr   )r    r   s     r   r   InvitedUserList.__init__  s	     #r   r   c                     0 nSU;   a8  UR                  S5       Vs/ s H  n[        R                  U5      PM     snUS'   U " S0 UD6$ s  snf );Initialize a InvitedUserList object from a json dictionary.r   r9   )r>   r   r   r   r   r   r^   s       r   r   InvitedUserList.from_dict  sR     %CH99[CY ZCYa!6!6q!9CY ZD{T{ ![   A	c                 $    U R                  U5      $ )r   r   r   s     r   r   InvitedUserList._from_dict'  r   r   c                    0 n[        U S5      (       am  U R                  b`  / nU R                   HJ  n[        U[        5      (       a  UR	                  U5        M+  UR	                  UR                  5       5        ML     X!S'   U$ )r   r   )r   r   r   r@   appendr   r    r   resources_listr^   s       r   r   InvitedUserList.to_dict,  sn    4%%$..*DN^^a&&"))!,"))!))+6	 $
 "0+r   c                 "    U R                  5       $ r   r   r   s    r   r   InvitedUserList._to_dict9  r   r   c                 H    [         R                  " U R                  5       SS9$ )z6Return a `str` version of this InvitedUserList object.r   r   r   r   s    r   r   InvitedUserList.__str__=  r   r   r   c                 j    [        XR                  5      (       d  gU R                  UR                  :H  $ r   r   r   s     r   r   InvitedUserList.__eq__A  r   r   c                     X:X  + $ r   r9   r   s     r   r   InvitedUserList.__ne__G  r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r9   r   r   r   r   	  s     *.# &# 
	# d '8   $ $ 4 4/- /$ /!- !$ !r   r   c                       \ rS rSrSrSSSS.S\S\S\S\S	\S
   SS4S jjr\	S\
SS 4S j5       r\	S 5       rS\
4S jrS rS\4S jrSS S\4S jrSS S\4S jrSrg)UserListiL  ae  
The users returned.

:attr int total_results: The number of users returned.
:attr int limit: A limit to the number of users returned in a page.
:attr str first_url: (optional) The first URL of the get users API.
:attr str next_url: (optional) The next URL of the get users API.
:attr List[UserProfile] resources: (optional) A list of users in the account.
N)	first_urlnext_urlr   total_resultsr"   r   r   r   UserProfiler   c                @    Xl         X l        X0l        X@l        XPl        g)a{  
Initialize a UserList object.

:param int total_results: The number of users returned.
:param int limit: A limit to the number of users returned in a page.
:param str first_url: (optional) The first URL of the get users API.
:param str next_url: (optional) The next URL of the get users API.
:param List[UserProfile] resources: (optional) A list of users in the
       account.
N)r   r"   r   r   r   )r    r   r"   r   r   r   s         r   r   UserList.__init__W  s    & +
" "r   r   c                    0 nSU;   a  UR                  S5      US'   O[        S5      eSU;   a  UR                  S5      US'   O[        S5      eSU;   a  UR                  S5      US'   SU;   a  UR                  S5      US'   SU;   a8  UR                  S5       Vs/ s H  n[        R                  U5      PM     snUS'   U " S0 UD6$ s  snf )	4Initialize a UserList object from a json dictionary.r   z>Required property 'total_results' not present in UserList JSONr"   z6Required property 'limit' not present in UserList JSONr   r   r   r9   )r>   r;   r   r   r   s       r   r   UserList.from_dictp  s     e#$)IIo$>D!_``e!IIg.DMWXX% %		+ 6D$yy4D%CH99[CY ZCYa!6!6q!9CY ZD{T{ ![s   C	c                 $    U R                  U5      $ )r   r   r   s     r   r   UserList._from_dict  r   r   c                 n   0 n[        U S5      (       a  U R                  b  U R                  US'   [        U S5      (       a  U R                  b  U R                  US'   [        U S5      (       a  U R                  b  U R                  US'   [        U S5      (       a  U R                  b  U R                  US'   [        U S5      (       am  U R
                  b`  / nU R
                   HJ  n[        U[        5      (       a  UR                  U5        M+  UR                  UR                  5       5        ML     X!S'   U$ )r   r   r"   r   r   r   )
r   r   r"   r   r   r   r   r@   r   r   r   s       r   r   UserList.to_dict  s   4))d.@.@.L%)%7%7E/"4!!djj&<!ZZE'N4%%$..*D!%E+4$$)B $E*4%%$..*DN^^a&&"))!,"))!))+6	 $
 "0+r   c                 "    U R                  5       $ r   r   r   s    r   r   UserList._to_dict  r   r   c                 H    [         R                  " U R                  5       SS9$ )z/Return a `str` version of this UserList object.r   r   r   r   s    r   r   UserList.__str__  r   r   r   c                 j    [        XR                  5      (       d  gU R                  UR                  :H  $ r   r   r   s     r   r   UserList.__eq__  r   r   c                     X:X  + $ r   r9   r   s     r   r   UserList.__ne__  r   r   )r   r"   r   r   r   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r9   r   r   r   r   L  s     )-## #
 # # &# 
#2 d z  & $ $ *4 4/J /4 /!J !4 !r   r   c                       \ rS rSrSrSSSSSSSSSSSSSS.S\S\S\S\S	\S
\S\S\S\S\S\S\S\SS4S jjr\S\SS 4S j5       r	\S 5       r
S\4S jrS rS\4S jrSS S\4S jrSS S\4S jrSrg)r   i  a6  
Returned the user profile.

:attr str id: (optional) An alphanumeric value identifying the user profile.
:attr str iam_id: (optional) An alphanumeric value identifying the user's IAM
      ID.
:attr str realm: (optional) The realm of the user. The value is either `IBMid`
      or `SL`.
:attr str user_id: (optional) The user ID used for login.
:attr str firstname: (optional) The first name of the user.
:attr str lastname: (optional) The last name of the user.
:attr str state: (optional) The state of the user. Possible values are
      `PROCESSING`, `PENDING`, `ACTIVE`, `DISABLED_CLASSIC_INFRASTRUCTURE`, and
      `VPN_ONLY`.
:attr str email: (optional) The email address of the user.
:attr str phonenumber: (optional) The phone number of the user.
:attr str altphonenumber: (optional) The alternative phone number of the user.
:attr str photo: (optional) A link to a photo of the user.
:attr str account_id: (optional) An alphanumeric value identifying the account
      ID.
:attr str added_on: (optional) The timestamp for when the user was added to the
      account.
Nr   ra   realmr&   rh   ri   rj   rk   rl   rm   rn   r'   added_onr   ra   r  r&   rh   ri   rj   rk   rl   rm   rn   r'   r  r   c                    Xl         X l        X0l        X@l        XPl        X`l        Xpl        Xl        Xl        Xl	        Xl
        Xl        Xl        g)a]  
Initialize a UserProfile object.

:param str id: (optional) An alphanumeric value identifying the user
       profile.
:param str iam_id: (optional) An alphanumeric value identifying the user's
       IAM ID.
:param str realm: (optional) The realm of the user. The value is either
       `IBMid` or `SL`.
:param str user_id: (optional) The user ID used for login.
:param str firstname: (optional) The first name of the user.
:param str lastname: (optional) The last name of the user.
:param str state: (optional) The state of the user. Possible values are
       `PROCESSING`, `PENDING`, `ACTIVE`, `DISABLED_CLASSIC_INFRASTRUCTURE`, and
       `VPN_ONLY`.
:param str email: (optional) The email address of the user.
:param str phonenumber: (optional) The phone number of the user.
:param str altphonenumber: (optional) The alternative phone number of the
       user.
:param str photo: (optional) A link to a photo of the user.
:param str account_id: (optional) An alphanumeric value identifying the
       account ID.
:param str added_on: (optional) The timestamp for when the user was added
       to the account.
Nr  )r    r   ra   r  r&   rh   ri   rj   rk   rl   rm   rn   r'   r  s                 r   r   UserProfile.__init__  sH    T 
" 

&,
$ r   r   c                    0 nSU;   a  UR                  S5      US'   SU;   a  UR                  S5      US'   SU;   a  UR                  S5      US'   SU;   a  UR                  S5      US'   SU;   a  UR                  S5      US'   SU;   a  UR                  S5      US'   SU;   a  UR                  S5      US'   SU;   a  UR                  S5      US'   S	U;   a  UR                  S	5      US	'   S
U;   a  UR                  S
5      US
'   SU;   a  UR                  S5      US'   SU;   a  UR                  S5      US'   SU;   a  UR                  S5      US'   U " S0 UD6$ )7Initialize a UserProfile object from a json dictionary.r   ra   r  r&   rh   ri   rj   rk   rl   rm   rn   r'   r  r9   r   r   s      r   r   UserProfile.from_dict  sm    5=4DJu"YYx0DNe!IIg.DM#ii	2DO% %		+ 6D$yy4De!IIg.DMe!IIg.DME!"'))M":Du$%*YY/?%@D!"e!IIg.DM5 !&<!8D$yy4D{T{r   c                 $    U R                  U5      $ )r	  r   r   s     r   r   UserProfile._from_dict"  r   r   c                    0 n[        U S5      (       a  U R                  b  U R                  US'   [        U S5      (       a  U R                  b  U R                  US'   [        U S5      (       a  U R                  b  U R                  US'   [        U S5      (       a  U R                  b  U R                  US'   [        U S5      (       a  U R
                  b  U R
                  US'   [        U S5      (       a  U R                  b  U R                  US'   [        U S5      (       a  U R                  b  U R                  US'   [        U S5      (       a  U R                  b  U R                  US'   [        U S	5      (       a  U R                  b  U R                  US	'   [        U S
5      (       a  U R                  b  U R                  US
'   [        U S5      (       a  U R                  b  U R                  US'   [        U S5      (       a  U R                  b  U R                  US'   [        U S5      (       a  U R                  b  U R                  US'   U$ )r   r   ra   r  r&   rh   ri   rj   rk   rl   rm   rn   r'   r  )r   r   ra   r  r&   rh   ri   rj   rk   rl   rm   rn   r'   r  r   s     r   r   UserProfile.to_dict'  s   4477#6''E$K4""t{{'>"kkE(O4!!djj&<!ZZE'N4##(@#||E)4%%$..*D!%E+4$$)B $E*4!!djj&<!ZZE'N4!!djj&<!ZZE'N4''D,<,<,H#'#3#3E- 4)**t/B/B/N&*&9&9E"#4!!djj&<!ZZE'N4&&4??+F"&//E,4$$)B $E*r   c                 "    U R                  5       $ r   r   r   s    r   r   UserProfile._to_dictF  r   r   c                 H    [         R                  " U R                  5       SS9$ )z2Return a `str` version of this UserProfile object.r   r   r   r   s    r   r   UserProfile.__str__J  r   r   r   c                 j    [        XR                  5      (       d  gU R                  UR                  :H  $ r   r   r   s     r   r   UserProfile.__eq__N  r   r   c                     X:X  + $ r   r9   r   s     r   r   UserProfile.__ne__T  r   r   )r'   r  rm   rk   rh   ra   r   ri   rl   rn   r  rj   r&   r   r9   r   r   r   r     s;   6 "6! 6! 	6!
 6! 6! 6! 6! 6! 6! 6! 6! 6! 6! 6!  
!6!p d }  > $ $ >4 4/M /d /!M !d !r   r   c                       \ rS rSrSrSSSSS.S\S\S\S\S	S4
S
 jjr\S\	S	S 4S j5       r
\S 5       rS	\	4S jrS rS	\4S jrSS S	\4S jrSS S	\4S jrSrg)UserSettingsiY  a  
The user settings returned.

:attr str language: (optional) The console UI language. By default, this field
      is empty.
:attr str notification_language: (optional) The language for email and phone
      notifications. By default, this field is empty.
:attr str allowed_ip_addresses: (optional) A comma-separated list of IP
      addresses.
:attr bool self_manage: (optional) Whether user managed login is enabled. The
      default value is `false`.
Nr   r   r   r   r   r   c                4    Xl         X l        X0l        X@l        g)a  
Initialize a UserSettings object.

:param str language: (optional) The console UI language. By default, this
       field is empty.
:param str notification_language: (optional) The language for email and
       phone notifications. By default, this field is empty.
:param str allowed_ip_addresses: (optional) A comma-separated list of IP
       addresses.
:param bool self_manage: (optional) Whether user managed login is enabled.
       The default value is `false`.
Nr   )r    r   r   r   r   s        r   r   UserSettings.__init__g  s    ( !%:"$8!&r   r   c                     0 nSU;   a  UR                  S5      US'   SU;   a  UR                  S5      US'   SU;   a  UR                  S5      US'   SU;   a  UR                  S5      US'   U " S0 UD6$ )8Initialize a UserSettings object from a json dictionary.r   r   r   r   r9   r   r   s      r   r   UserSettings.from_dict  s     $yy4D"e+,1II6M,ND()!U*+0995K+LD'(E!"'))M":D{T{r   c                 $    U R                  U5      $ )r  r   r   s     r   r   UserSettings._from_dict  r   r   c                 r   0 n[        U S5      (       a  U R                  b  U R                  US'   [        U S5      (       a  U R                  b  U R                  US'   [        U S5      (       a  U R                  b  U R                  US'   [        U S5      (       a  U R                  b  U R                  US'   U$ )r   r   r   r   r   )r   r   r   r   r   r   s     r   r   UserSettings.to_dict  s    4$$)B $E*4011d6P6P6\-1-G-GE)*4/00T5N5N5Z,0,E,EE()4''D,<,<,H#'#3#3E- r   c                 "    U R                  5       $ r   r   r   s    r   r   UserSettings._to_dict  r   r   c                 H    [         R                  " U R                  5       SS9$ )z3Return a `str` version of this UserSettings object.r   r   r   r   s    r   r   UserSettings.__str__  r   r   r   c                 j    [        XR                  5      (       d  gU R                  UR                  :H  $ r   r   r   s     r   r   UserSettings.__eq__  r   r   c                     X:X  + $ r   r9   r   s     r   r   UserSettings.__ne__  r   r   )r   r   r   r   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r9   r   r   r  r  Y  s      %)$( ' '  #	'
 "' ' 
'2 d ~   $ $ 4 4/N /t /!N !t !r   r  c                       \ rS rSrSrSSS.S\S\SS4S jjr\S	\SS 4S
 j5       r	\S 5       r
S\4S jrS rS\4S jrSS S\4S jrSS S\4S jrSrg)	Attributei  z
An attribute/value pair.

:attr str name: (optional) The name of the attribute.
:attr str value: (optional) The value of the attribute.
Nnamevaluer-  r.  r   c                    Xl         X l        g)z
Initialize a Attribute object.

:param str name: (optional) The name of the attribute.
:param str value: (optional) The value of the attribute.
Nr,  )r    r-  r.  s      r   r   Attribute.__init__  s     	
r   r   c                 ~    0 nSU;   a  UR                  S5      US'   SU;   a  UR                  S5      US'   U " S0 UD6$ )5Initialize a Attribute object from a json dictionary.r-  r.  r9   r   r   s      r   r   Attribute.from_dict  sH     U? 99V,DLe!IIg.DM{T{r   c                 $    U R                  U5      $ )r2  r   r   s     r   r   Attribute._from_dict  r   r   c                     0 n[        U S5      (       a  U R                  b  U R                  US'   [        U S5      (       a  U R                  b  U R                  US'   U$ )r   r-  r.  )r   r-  r.  r   s     r   r   Attribute.to_dict  sR    4  TYY%: IIE&M4!!djj&<!ZZE'Nr   c                 "    U R                  5       $ r   r   r   s    r   r   Attribute._to_dict  r   r   c                 H    [         R                  " U R                  5       SS9$ )z0Return a `str` version of this Attribute object.r   r   r   r   s    r   r   Attribute.__str__  r   r   r   c                 j    [        XR                  5      (       d  gU R                  UR                  :H  $ r   r   r   s     r   r   Attribute.__eq__  r   r   c                     X:X  + $ r   r9   r   s     r   r   Attribute.__ne__  r   r   r   r9   r   r   r+  r+    s     	  	
 
 d {   $ $ 4 4/K /D /!K !D !r   r+  c                       \ rS rSrSrSSS.S\S\SS4S jjr\S	\SS 4S
 j5       r	\S 5       r
S\4S jrS rS\4S jrSS S\4S jrSS S\4S jrSrg)rQ   i  z
Invite a user.

:attr str email: (optional) The email of the user to be invited.
:attr str account_role: (optional) The account role of the user to be invited.
Nrk   account_rolerk   rB  r   c                    Xl         X l        g)z
Initialize a InviteUser object.

:param str email: (optional) The email of the user to be invited.
:param str account_role: (optional) The account role of the user to be
       invited.
NrA  )r    rk   rB  s      r   r   InviteUser.__init__  s     
(r   r   c                 ~    0 nSU;   a  UR                  S5      US'   SU;   a  UR                  S5      US'   U " S0 UD6$ )6Initialize a InviteUser object from a json dictionary.rk   rB  r9   r   r   s      r   r   InviteUser.from_dict  sJ     e!IIg.DMU"#(99^#<D {T{r   c                 $    U R                  U5      $ )rF  r   r   s     r   r   InviteUser._from_dict  r   r   c                     0 n[        U S5      (       a  U R                  b  U R                  US'   [        U S5      (       a  U R                  b  U R                  US'   U$ )r   rk   rB  )r   rk   rB  r   s     r   r   InviteUser.to_dict  sW    4!!djj&<!ZZE'N4((T->->-J$($5$5E.!r   c                 "    U R                  5       $ r   r   r   s    r   r   InviteUser._to_dict%  r   r   c                 H    [         R                  " U R                  5       SS9$ )z1Return a `str` version of this InviteUser object.r   r   r   r   s    r   r   InviteUser.__str__)  r   r   r   c                 j    [        XR                  5      (       d  gU R                  UR                  :H  $ r   r   r   s     r   r   InviteUser.__eq__-  r   r   c                     X:X  + $ r   r9   r   s     r   r   InviteUser.__ne__3  r   r   )rB  rk   r   r9   r   r   rQ   rQ     s      	) ) 	)
 
)  d |   $ $ 4 4/L /T /!L !T !r   rQ   c            	           \ rS rSrSrSSS.S\S\S   S\S	   S
S4S jjr\S\	S
S 4S j5       r
\S 5       rS
\	4S jrS rS
\4S jrSS S
\4S jrSS S
\4S jrSrg)rR   i8  z
Invite a user to an IAM policy.

:attr str type: The policy type. This can be either "access" or "authorization".
:attr List[Role] roles: (optional) A list of IAM roles.
:attr List[Resource] resources: (optional) A list of resources.
N)rolesr   typerU  Roler   Resourcer   c                (    Xl         X l        X0l        g)z
Initialize a InviteUserIamPolicy object.

:param str type: The policy type. This can be either "access" or
       "authorization".
:param List[Role] roles: (optional) A list of IAM roles.
:param List[Resource] resources: (optional) A list of resources.
N)rV  rU  r   )r    rV  rU  r   s       r   r   InviteUserIamPolicy.__init__A  s     	
"r   r   c                 n   0 nSU;   a  UR                  S5      US'   O[        S5      eSU;   a8  UR                  S5       Vs/ s H  n[        R                  U5      PM     snUS'   SU;   a8  UR                  S5       Vs/ s H  n[        R                  U5      PM     snUS'   U " S0 UD6$ s  snf s  snf )?Initialize a InviteUserIamPolicy object from a json dictionary.rV  z@Required property 'type' not present in InviteUserIamPolicy JSONrU  r   r9   )r>   r;   rW  r   rX  r   s       r   r   InviteUserIamPolicy.from_dictT  s     U? 99V,DLabbe8=		'8JK8J1T^^A.8JKDM%@E		+@V W@V1!3!3A!6@V WD{T{ L Ws   B- B2c                 $    U R                  U5      $ )r\  r   r   s     r   r   InviteUserIamPolicy._from_dictb  r   r   c                 \   0 n[        U S5      (       a  U R                  b  U R                  US'   [        U S5      (       am  U R                  b`  / nU R                   HJ  n[        U[        5      (       a  UR                  U5        M+  UR                  UR                  5       5        ML     X!S'   [        U S5      (       am  U R                  b`  / nU R                   HJ  n[        U[        5      (       a  UR                  U5        M+  UR                  UR                  5       5        ML     XAS'   U$ )r   rV  rU  r   )r   rV  rU  r   r@   r   r   r   )r    r   
roles_listr^   r   s        r   r   InviteUserIamPolicy.to_dictg  s    4  TYY%: IIE&M4!!djj&<JZZa&&%%a(%%aiik2	  
 ('N4%%$..*DN^^a&&"))!,"))!))+6	 $
 "0+r   c                 "    U R                  5       $ r   r   r   s    r   r   InviteUserIamPolicy._to_dict~  r   r   c                 H    [         R                  " U R                  5       SS9$ )z:Return a `str` version of this InviteUserIamPolicy object.r   r   r   r   s    r   r   InviteUserIamPolicy.__str__  r   r   r   c                 j    [        XR                  5      (       d  gU R                  UR                  :H  $ r   r   r   s     r   r   InviteUserIamPolicy.__eq__  r   r   c                     X:X  + $ r   r9   r   s     r   r   InviteUserIamPolicy.__ne__  r   r   )r   rU  rV  )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r9   r   r   rR   rR   8  s     #&*## F|	#
 
## 
#& d '<   $ $ .4 4/1 /d /!1 !d !r   rR   c                       \ rS rSrSrSS.S\S   SS4S jjr\S	\SS 4S
 j5       r	\S 5       r
S\4S jrS rS\4S jrSS S\4S jrSS S\4S jrSrg)rX  i  zp
A collection of attribute value pairs.

:attr List[Attribute] attributes: (optional) A list of IAM attributes.
N
attributesrm  r+  r   c                    Xl         g)zh
Initialize a Resource object.

:param List[Attribute] attributes: (optional) A list of IAM attributes.
Nrl  )r    rm  s     r   r   Resource.__init__  s	     %r   r   c                     0 nSU;   a8  UR                  S5       Vs/ s H  n[        R                  U5      PM     snUS'   U " S0 UD6$ s  snf )4Initialize a Resource object from a json dictionary.rm  r9   )r>   r+  r   r   s       r   r   Resource.from_dict  sR     5 BG))LBY!ZBYQ)"5"5a"8BY!ZD{T{ "[r   c                 $    U R                  U5      $ )rq  r   r   s     r   r   Resource._from_dict  r   r   c                    0 n[        U S5      (       am  U R                  b`  / nU R                   HJ  n[        U[        5      (       a  UR	                  U5        M+  UR	                  UR                  5       5        ML     X!S'   U$ )r   rm  )r   rm  r   r@   r   r   )r    r   attributes_listr^   s       r   r   Resource.to_dict  sn    4&&4??+F O__a&&#**1-#**199;7	 %
 #2,r   c                 "    U R                  5       $ r   r   r   s    r   r   Resource._to_dict  r   r   c                 H    [         R                  " U R                  5       SS9$ )z/Return a `str` version of this Resource object.r   r   r   r   s    r   r   Resource.__str__  r   r   r   c                 j    [        XR                  5      (       d  gU R                  UR                  :H  $ r   r   r   s     r   r   Resource.__eq__  r   r   c                     X:X  + $ r   r9   r   s     r   r   Resource.__ne__  r   r   r   r9   r   r   rX  rX    s     )-
% %
% 
	
% d z   $ $ 4 4/J /4 /!J !4 !r   rX  c                       \ rS rSrSrSS.S\SS4S jjr\S\SS 4S	 j5       r	\S
 5       r
S\4S jrS rS\4S jrSS S\4S jrSS S\4S jrSrg)rW  i  zi
The role of an IAM policy.

:attr str role_id: (optional) An alphanumeric value identifying the origin.
Nrole_idr  r   c                    Xl         g)zp
Initialize a Role object.

:param str role_id: (optional) An alphanumeric value identifying the
       origin.
Nr  )r    r  s     r   r   Role.__init__  s	     r   r   c                 J    0 nSU;   a  UR                  S5      US'   U " S0 UD6$ )0Initialize a Role object from a json dictionary.r  r9   r   r   s      r   r   Role.from_dict  s/     #ii	2DO{T{r   c                 $    U R                  U5      $ )r  r   r   s     r   r   Role._from_dict  r   r   c                 d    0 n[        U S5      (       a  U R                  b  U R                  US'   U$ )r   r  )r   r  r   s     r   r   Role.to_dict  s0    4##(@#||E)r   c                 "    U R                  5       $ r   r   r   s    r   r   Role._to_dict  r   r   c                 H    [         R                  " U R                  5       SS9$ )z+Return a `str` version of this Role object.r   r   r   r   s    r   r   Role.__str__  r   r   r   c                 j    [        XR                  5      (       d  gU R                  UR                  :H  $ r   r   r   s     r   r   Role.__eq__  r   r   c                     X:X  + $ r   r9   r   s     r   r   Role.__ne__  r   r   r   r9   r   r   rW  rW    s       
	 d v   $ $ 4 4/F /t /!F !t !r   rW  c                       \ rS rSrSrSSSSS.S\S\S\S\S	\S
\SS4S jjr	S\4S jr
S\\   4S jrS\\   4S jrSrg)
UsersPageri  zH
UsersPager can be used to simplify the use of the "list_users" method.
N)r"   r#   r$   r&   clientr'   r"   r#   r$   r&   r   c                l    SU l         Xl        SS0U l        X l        X0l        X@l        XPl        X`l        g)a  
Initialize a UsersPager object.
:param str account_id: The account ID of the specified user.
:param int limit: (optional) The number of results to be returned.
:param bool include_settings: (optional) The user settings to be returned.
       Set to true to view language, allowed IP address, and authentication
       settings.
:param str search: (optional) The desired search results to be returned. To
       view the list of users with the additional search filter, use the following
       query options: `firstname`, `lastname`, `email`, `state`, `substate`,
       `iam_id`, `realm`, and `userId`. HTML URL encoding for the search query and
       `:` must be used. For example, search=state%3AINVALID returns a list of
       invalid users. Multiple search queries can be combined to obtain `OR`
       results using `,` operator (not URL encoded). For example,
       search=state%3AINVALID,email%3Amail.test.ibm.com.
:param str user_id: (optional) Filter users based on their user ID.
TnextN)	_has_next_client_page_context_account_id_limit_include_settings_search_user_id)r    r  r'   r"   r#   r$   r&   s          r   r   UsersPager.__init__  s7    6 $d^%!1r   c                     U R                   $ )zE
Returns true if there are potentially more results to be retrieved.
)r  r   s    r   has_nextUsersPager.has_next:  s     ~~r   c           
         U R                  5       (       d	  [        SS9eU R                  R                  U R                  U R
                  U R                  U R                  U R                  U R                  R                  S5      S9R                  5       nSnUR                  S5      nUb  [        US5      nX R                  S'   Uc  SU l        UR                  S	5      $ )
z
Returns the next page of results.
:return: A List[dict], where each element is a dict that represents an instance of UserProfile.
:rtype: List[dict]
zNo more results available)messager  )r'   r"   r#   r$   r&   r%   Nr   r/   Fr   )r  StopIterationr  r+   r  r  r  r  r  r  r>   
get_resultr   r  )r    resultr  next_page_links       r   get_nextUsersPager.get_next@  s     }}(CDD((''++!33<<MM$$((0 ) 
 *, 	 J/%">8<D%)6"<"DNzz+&&r   c                     / nU R                  5       (       a8  U R                  5       nUR                  U5        U R                  5       (       a  M8  U$ )z
Returns all results by invoking get_next() repeatedly
until all pages of results have been retrieved.
:return: A List[dict], where each element is a dict that represents an instance of UserProfile.
:rtype: List[dict]
)r  r  extend)r    results	next_pages      r   get_allUsersPager.get_all\  s?     mmooINN9% mmoo r   )r  r  r  r  r  r  r  r  )r   r   r   r   r   r   r   r   r   r   r  r   r@   r  r  r   r9   r   r   r  r    s     !%"  !"  	" 
 "  "  "  "  
" H$ '$t* '8d r   r  )r   typingr   r   rZ   ibm_cloud_sdk_corer   r   r   /ibm_cloud_sdk_core.authenticators.authenticatorr   $ibm_cloud_sdk_core.get_authenticatorr	   ibm_cloud_sdk_core.utilsr
   commonr   r   r   r   r   r   r  r+  rQ   rR   rX  rW  r  r9   r   r   <module>r     s   &   M M I S 2 #N
{ N
lH! H!V@! @!Fb! b!Je! e!PW! W!t?! ?!D@! @!FV! V!r=! =!@8! 8!@V Vr   