
                         D    S 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.    )	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   6   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%   M   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)   f   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	   DisableUserCredsr.   }   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	   ResetUserCredsr2      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	   DeleteUserCredsr6      r*   r   N)__doc__ googlecloudsdk.api_lib.firestorer   r
   r   r   r%   r)   r.   r2   r6   r   r   r	   <module>r9      s8    O 7<
8.2...r   