
                         z    S r SSKJ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S rg)z9Client for interaction with EntryGroup API CRUD DATAPLEX.    )absolute_import)division)unicode_literals)util)iam_utilc                     [         R                  " 5       nUR                  U R                  U R                  [         R
                  " UR                  U 5      S9nU$ )zCreate Entry Group Request.)descriptiondisplayNamelabels)dataplex_apiGetMessageModuleGoogleCloudDataplexV1EntryGroupr	   display_nameCreateLabels)argsmodulerequests      2lib/googlecloudsdk/api_lib/dataplex/entry_group.py"GenerateEntryGroupForCreateRequestr      sW    ((*&22""##&&v'M'M'+- 3 .'
 
.    c           	          [         R                  " 5       nUR                  U R                  U R                  U R
                  [         R                  " UR                  U 5      S9$ )zUpdate Entry Group Request.)r	   r
   etagr   )r   r   r   r	   r   r   r   )r   r   s     r   "GenerateEntryGroupForUpdateRequestr   $   sZ    ((*&		/	/""##99&&v'M'M'+-	 
0 
. .r   c                     / nU R                  S5      (       a  UR                  S5        U R                  S5      (       a  UR                  S5        U R                  S5      (       a  UR                  S5        U$ )z"Create Update Mask for EntryGroup.r	   r   r
   r   )IsSpecifiedappend)r   update_masks     r   GenerateEntryGroupUpdateMaskr   /   sj    +	m$$}%	n%%}%	hx 	r   c                 j    [         R                  " U [         R                  " 5       R                  5      $ )z=Waits for the given google.longrunning.Operation to complete.)r   WaitForOperationGetClientInstanceprojects_locations_entryGroups)	operations    r   r    r    ;   s,    		&	&$$&EE
G Gr   c                     [         R                  " 5       R                  U R                  5       [         R                  " 5       R	                  US9S9n[         R
                  " 5       R                  R                  U5      $ )zSet Iam Policy request.)policy)resourcegoogleIamV1SetIamPolicyRequest)r   r   7DataplexProjectsLocationsEntryGroupsSetIamPolicyRequestRelativeNameGoogleIamV1SetIamPolicyRequestr!   r"   SetIamPolicy)entry_group_refr%   set_iam_policy_reqs      r   EntryGroupSetIamPolicyr.   B   sq    #44 ;;++-%1%B%B%D%%V%4 < 6 
 
	'	' 
""<<0B#CDr   c                     [         R                  " 5       R                  U R                  5       S9n[         R                  " 5       R
                  R                  U5      $ )zGet Iam Policy request.)r&   )r   r   7DataplexProjectsLocationsEntryGroupsGetIamPolicyRequestr)   r!   r"   GetIamPolicy)r,   get_iam_policy_reqs     r   EntryGroupGetIamPolicyr3   M   sW    #44 ;;++- < /  
	'	' 
""<<0B#CDr   c                     [        U 5      n[        R                  " [        R                  " 5       R
                  X1U5        [        X5      $ )zAdd IAM policy binding request.)r3   r   AddBindingToIamPolicyr   r   GoogleIamV1Bindingr.   r,   memberroler%   s       r   EntryGroupAddIamPolicyBindingr:   V   s<    !/2&
  ##%88&$P		88r   c                 \    [        U 5      n[        R                  " X1U5        [        X5      $ )z"Remove IAM policy binding request.)r3   r   RemoveBindingFromIamPolicyr.   r7   s       r    EntryGroupRemoveIamPolicyBindingr=   ^   s'    !/2&
%%fd;		88r   c                     [         R                  " U[        R                  " 5       R                  5      n[        X5      $ )z)Set IAM policy binding request from file.)r   ParsePolicyFiler   r   GoogleIamV1Policyr.   )r,   policy_filer%   s      r   EntryGroupSetIamPolicyFromFilerB   e   s4    ####%779& 
 	88r   N)__doc__
__future__r   r   r   googlecloudsdk.api_lib.dataplexr   r   googlecloudsdk.command_lib.iamr   r   r   r   r    r.   r3   r:   r=   rB    r   r   <module>rH      sJ    @ &  ' @ 3.	GDD999r   