
                         h    S r SSKJr  SSKJr  SSKJr  SSKJr  S rS rS r	S	 r
S
 rS rS rS rg)zHUseful commands for interacting with the Cloud Firestore User Creds API.    )absolute_import)division)unicode_literals)	api_utilsc                  @    [         R                  " 5       R                  $ )z>Returns the service to interact with the Firestore User Creds.)r   	GetClientprojects_databases_userCreds     2lib/googlecloudsdk/api_lib/firestore/user_creds.py_GetUserCredsServicer      s    					;	;;r   c                     [         R                  " 5       n[        5       R                  UR	                  SR                  U U5      US95      $ )a*  Creates a user creds.

Args:
  project: the project of the database of the user creds, a string.
  database: the database id of the user creds, a string.
  user_creds: The user-provided id for the user creds.

Returns:
  a user creds.

Raises:
  InvalidArgumentException: if user_creds is invalid.
projects/{}/databases/{})parentuserCredsId)r   GetMessagesr   Create0FirestoreProjectsDatabasesUserCredsCreateRequestformatprojectdatabase
user_credsmessagess       r   CreateUserCredsr      sU      ""$(			&	&??+22 ! @ 
 r   c           	          [         R                  " 5       n[        5       R                  UR	                  SR                  U UU5      S95      $ )zGets a user creds.

Args:
  project: the project of the database of the user creds, a string.
  database: the database id of the user creds, a string.
  user_creds: the user creds to read, a string.

Returns:
  a user creds.
%projects/{}/databases/{}/userCreds/{}name)r   r   r   Get-FirestoreProjectsDatabasesUserCredsGetRequestr   r   s       r   GetUserCredsr"   9   sR     ""$(			#	#<<6== = 
 r   c           
          [         R                  " 5       n[        [        5       R	                  UR                  SR                  U U5      S95      R                  5      $ )zLists user Creds under a database.

Args:
  project: the project of the database of the user creds, a string.
  database: the database id of the user creds, a string.

Returns:
  a list of user Creds.
r   )r   )r   r   listr   List.FirestoreProjectsDatabasesUserCredsListRequestr   	userCreds)r   r   r   s      r   ListUserCredsr(   P   s^     ""$(	t

A
A/66 B  y
 r   c           	          [         R                  " 5       n[        5       R                  UR	                  SR                  U UU5      S95      $ )zEnables a user creds.

Args:
  project: the project of the database of the user creds, a string.
  database: the database id of the user creds, a string.
  user_creds: the user creds to enable, a string.

Returns:
  a user creds.
r   r   )r   r   r   Enable0FirestoreProjectsDatabasesUserCredsEnableRequestr   r   s       r   EnableUserCredsr,   i   S     ""$(			&	&??6== @ 
 r   c           	          [         R                  " 5       n[        5       R                  UR	                  SR                  U UU5      S95      $ )zDisables a user creds.

Args:
  project: the project of the database of the user creds, a string.
  database: the database id of the user creds, a string.
  user_creds: the user creds to disable, a string.

Returns:
  a user creds.
r   r   )r   r   r   Disable1FirestoreProjectsDatabasesUserCredsDisableRequestr   r   s       r   DisableUserCredsr1      sS     ""$(			'	'@@6== A 
 r   c           	          [         R                  " 5       n[        5       R                  UR	                  SR                  U UU5      S95      $ )zResets a user creds.

Args:
  project: the project of the database of the user creds, a string.
  database: the database id of the user creds, a string.
  user_creds: the user creds to reset, a string.

Returns:
  a user creds.
r   r   )r   r   r   ResetPassword7FirestoreProjectsDatabasesUserCredsResetPasswordRequestr   r   s       r   ResetUserCredsr5      sS     ""$(			-	-FF6== G 
 r   c           	          [         R                  " 5       n[        5       R                  UR	                  SR                  U UU5      S95      $ )zDeletes a user creds.

Args:
  project: the project of the database of the user creds, a string.
  database: the database id of the user creds, a string.
  user_creds: the user creds to delete, a string.

Returns:
  Empty response message.
r   r   )r   r   r   Delete0FirestoreProjectsDatabasesUserCredsDeleteRequestr   r   s       r   DeleteUserCredsr9      r-   r   N)__doc__
__future__r   r   r    googlecloudsdk.api_lib.firestorer   r   r   r"   r(   r,   r1   r5   r9   r
   r   r   <module>r=      s?    O &  ' 6<
8.2...r   