
    ?                     V    S 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.    )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   8   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+   ?   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   EntryGroupGetIamPolicyr0   J   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.)r0   r   AddBindingToIamPolicyr	   r
   GoogleIamV1Bindingr+   r)   memberroler"   s       r   EntryGroupAddIamPolicyBindingr7   S   s<    !/2&
  ##%88&$P		88r   c                 \    [        U 5      n[        R                  " X1U5        [        X5      $ )z"Remove IAM policy binding request.)r0   r   RemoveBindingFromIamPolicyr+   r4   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   EntryGroupSetIamPolicyFromFiler?   b   s4    ####%779& 
 	88r   N)__doc__googlecloudsdk.api_lib.dataplexr   r	   googlecloudsdk.command_lib.iamr   r   r   r   r   r+   r0   r7   r:   r?    r   r   <module>rD      sD    @ A 3.	GDD999r   