
    ~8                     B   S r SSKJr  SSKJr  SSKJr  SSK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SKJr  SSKJr  \R&                  R(                  S\R&                  R*                  S\R&                  R,                  S0r\R&                  R(                  S\R&                  R*                  S\R&                  R,                  S0r\R&                  R,                  4S jr\R&                  R(                  4S jrS\R&                  4S jr\R&                  R,                  4S\R8                  4S jjr\R&                  R(                  4S\R<                  4S jjr\R&                  R,                  4S jr SAS jr!S r"SAS jr#S\R&                  R(                  4S jr$S  r%S! r&SAS" jr'SAS# jr(S$S\R&                  R(                  4S\RR                  4S% jjr*S$S\R&                  R(                  4S\+4S& jjr,S\R&                  R(                  4S' jr-SAS( jr.\R&                  R(                  4S) jr/\R&                  R(                  4S* jr0\R&                  R(                  4S+ jr1\R&                  R(                  4S, jr2\R&                  R(                  4S- jr3\R&                  R(                  4S. jr4\R&                  R(                  4S/ jr5\R&                  R(                  4S0 jr6\R&                  R(                  4S1 jr7\R&                  R(                  4S2 jr8S\R&                  R,                  4S3 jr9S\R&                  R,                  4S4 jr:SAS5 jr;S6\Rx                  S\RR                  4S7 jr=S8\R|                  S\RR                  4S9 jr?S8\R|                  S\+4S: jr@S8\R|                  4S; jrAS8\R|                  S\+4S< jrBS8\R|                  S\RR                  4S= jrCS8\R|                  S\+4S> jrDS8\R|                  4S? jrES8\R|                  S\+4S@ jrFg)BzFleet API utils.    )absolute_import)division)unicode_literalsN)types)apis)base)parser_extensions)
exceptions)	resources)gkehub_v1alpha_messagesv1alphav1betav1v2alphav2betav2c                 >    [         R                  " S[        U    5      $ Ngkehub)r   GetMessagesModuleVERSION_MAPrelease_tracks    2lib/googlecloudsdk/api_lib/container/fleet/util.pyr   r   -   s    			+m*D	EE    c                 >    [         R                  " S[        U    5      $ r   )r   r   V2_VERSION_MAPr   s    r   GetV2MessagesModuler   1   s    			.*G	HHr   r   c                     U [         R                  R                  :X  a  [        $ [	        SR                  U R                  5      5      e)ah  Dynamically load Fleet message module based on command track.

Explicitly import message to enable type hint in Cider-V since
`apis.GetMessagesModule()` cannot derive type to the specific Python module.

Args:
  release_track: Determines the generated API message module to be returned.

Returns:
  An API message module that corresponds to the release track.
z0Fleet command has not been promoted to {} track.)r   ReleaseTrackALPHAalpha_messagesNotImplementedErrorformatnamer   s    r   FleetMessageModuler&   5   sB     d''---8??


	 r   returnc                 >    [         R                  " S[        U    5      $ r   )r   GetClientInstancer   r   s    r   r)   r)   K   s     
		+m*D	EEr   c                 >    [         R                  " S[        U    5      $ r   )r   r)   r   r   s    r   GetV2ClientInstancer+   Q   s     
		.*G	HHr   c                 >    [         R                  " S[        U    5      $ r   )r   GetClientClassr   r   s    r   r-   r-   W   s    			X{='A	BBr   globalc                 \    [         R                  R                  SU US9R                  5       $ )Ngkehub.projects.locations
projectsIdlocationsIdr   REGISTRYCreateRelativeName)projectlocations     r   LocationResourceNamer:   [   s2    				"	"! 
# 
 LN	r   c                     [         R                  " SU 5      nU(       a  UR                  S5      $ [        R                  " SR                  U 5      5      e)N+projects/.*/locations/(.*)/memberships/(.*)   $Invalid membership resource name: {}researchgroupr
   Errorr$   	full_namematchess     r   MembershipLocationrG   d   sF    IICYO'==,33I>	 r   c                 ^    [         R                  R                  SU UUS9R                  5       $ )N%gkehub.projects.locations.membershipsr2   r3   membershipsIdr4   )r8   
membershipr9   s      r   MembershipResourceNamerM   m   s5    				"	"-	 
# 

 LNr   c                 v    [         R                  R                  S U UUUS.S[        U   S9R	                  5       $ )N)r2   r3   rK   
featuresIdz.gkehub.projects.locations.memberships.featureslineparams
collectionapi_version)r   r5   Parser   r7   )r8   rL   featurer9   r   s        r   MembershipFeatureResourceNamerW   w   sM     
			!	!!%	 B / 
" 
 LNr   c                     [         R                  " SU 5      nU(       a&  UR                  S5      S-   UR                  S5      -   $ [        R                  " SR                  U 5      5      e)Nr<   r=   /   r>   r?   rD   s     r   MembershipPartialNamer[      sY    IICYO'==c!GMM!$444,33I>	 r   c                 Z    [         R                  R                  U SS9R                  5       $ )NrI   rS   )r   r5   ParseRelativeNameName)rE   s    r   MembershipShortnamer`      s-    				-	-C 
. 
DFr   c                 ^    [         R                  R                  SU UUS9R                  5       $ )Nz"gkehub.projects.locations.features)r2   r3   rO   r4   )r8   rV   r9   s      r   FeatureResourceNamerb      s5    				"	"*	 
# 

 LNr   c                 ^    [         R                  R                  SU UUS9R                  5       $ )N$gkehub.projects.locations.operations)r2   r3   operationsIdr4   )r8   	operationr9   s      r   OperationResourceNamerg      s5    				"	",	 
# 

 LNr   defaultc                 X    [         R                  R                  S U UUS.S[        U   S9$ )N)r2   r3   fleetsIdz gkehub.projects.locations.fleetsrP   )r   r5   rU   r   r8   fleetr9   r   s       r   FleetRefrm      s@     
			!	!!
 4m, 
" 	
 	r   c                 6    [        XX#5      R                  5       $ N)rm   r7   rk   s       r   FleetResourceNamerp      s     
'(	:	G	G	IIr   c                 r    [         R                  R                  S U US.S[        U   S9R	                  5       $ )Nr1   r0   rP   r   r5   rU   r   r7   )r8   r9   r   s      r   FleetParentNamers      sF     
			!	!! -m, 
" 
 LNr   c                 $    SR                  X5      $ )Nzorganizations/{0}/locations/{1})r$   )organizationr9   s     r   FleetOrgParentNamerv      s    	*	1	1,	IIr   c                 r    [         R                  R                  S U SS.S[        U   S9R	                  5       $ Nr.   r1   r0   rP   rr   r8   r   s     r   ScopeParentNamerz      D    				!	!! -m, 
" 
 LNr   c                 r    [         R                  R                  S U SS.S[        U   S9R	                  5       $ rx   rr   ry   s     r   NamespaceParentNamer}      r{   r   c                 t    [         R                  R                  S U SUS.S[        U   S9R	                  5       $ Nr.   )r2   r3   namespacesIdz$gkehub.projects.locations.namespacesrP   rr   )r8   r%   r   s      r   NamespaceResourceNamer      sG    				!	!!
 8m, 
" 	
 LN	r   c                 t    [         R                  R                  S U SUS.S[        U   S9R	                  5       $ Nr.   r2   r3   scopesId gkehub.projects.locations.scopesrP   rr   r8   scoper   s      r   ScopeNamespaceParentNamer     I     
			!	!!
 4m, 
" 	
 LN	r   c                 v    [         R                  R                  S U SUUS.S[        U   S9R	                  5       $ )Nr.   )r2   r3   r   r   z+gkehub.projects.locations.scopes.namespacesrP   rr   r8   r   r%   r   s       r   ScopeNamespaceResourceNamer     sL     
			!	!!	 ?m, 
" 

 LN
r   c                 t    [         R                  R                  S U SUS.S[        U   S9R	                  5       $ r   rr   )r8   	namespacer   s      r   RBACRoleBindingParentNamer   (  sI     
			!	!!#
 8m, 
" 	
 LN	r   c                 t    [         R                  R                  S U SUS.S[        U   S9R	                  5       $ r   rr   r   s      r   ScopeRBACRoleBindingParentNamer   8  r   r   c                 v    [         R                  R                  S U SUUS.S[        U   S9R	                  5       $ )Nr.   )r2   r3   r   rbacrolebindingsIdz5gkehub.projects.locations.namespaces.rbacrolebindingsrP   rr   )r8   r   r%   r   s       r   RBACRoleBindingResourceNamer   H  sM     
			!	!!# $	 Im, 
" 

 LN
r   c                 v    [         R                  R                  S U SUUS.S[        U   S9R	                  5       $ )Nr.   )r2   r3   r   r   z1gkehub.projects.locations.scopes.rbacrolebindingsrP   rr   r   s       r    ScopeRBACRoleBindingResourceNamer   Y  sM     
			!	!! $	 Em, 
" 

 LN
r   c                 v    [         R                  R                  SU UUUS.S[        U   S9R	                  5       $ )aq  Parses a Membership RBAC Role Binding resource.

Args:
  project: the full project ID or number for the resource.
  location: the location of the resource.
  membership: the parent membership of the resource.
  name: the resource name for the role binding.
  release_track: the API version for the resource parsing.

Returns:
  A Membership RBAC Role Binding resource.
N)r2   r3   rK   r   z6gkehub.projects.locations.memberships.rbacrolebindingsrP   rr   )r8   r9   rL   r%   r   s        r   %MembershipRBACRoleBindingResourceNamer   j  sM      
			!	!!% $	 Jm, 
" 

 LN
r   c                 v    [         R                  R                  S U UUUS.S[        U   S9R	                  5       $ )N)r2   r3   rK   
bindingsIdz.gkehub.projects.locations.memberships.bindingsrP   rr   )r8   r%   rL   r9   r   s        r   MembershipBindingResourceNamer     sM     
			!	!!%	 Bm, 
" 

 LN
r   c                 t    [         R                  R                  S U UUS.S[        U   S9R	                  5       $ )NrJ   rI   rP   rr   )r8   rL   r9   r   s       r   MembershipBindingParentNamer     sI     
			!	!!%
 9m, 
" 	
 LN	r   c                 ^    [         R                  R                  SU UUS9R                  5       $ )Nr   r   r4   )r8   r   r9   s      r   ScopeResourceNamer     s5    				"	"(	 
# 

 LNr   rf   c                 R    [         R                  R                  U R                  SS9$ )z6Parses a gkehub Operation reference from an operation.rd   r]   )r   r5   r^   r%   )rf   s    r   OperationRefr     s*    				-	-nn!G 
. 
 r   argsc                     [        U R                  SS 5      (       a$  U R                  R                  R                  5       $ g )Nrollout)getattrCONCEPTSr   rU   r   s    r   
RolloutRefr     s3    T]]It,,==  &&(( -r   c                 H    [        U 5      nU(       a  UR                  5       $ g ro   )r   r7   r   rollout_refs     r   RolloutNamer     s!    4 +##%%	r   c                 d    [        U 5      nU(       a  UR                  5       R                  5       $ g ro   )r   Parentr7   r   s     r   RolloutParentNamer     s*    4 +,,..	r   c                 H    [        U 5      nU(       a  UR                  5       $ g ro   )r   r_   r   s     r   	RolloutIdr     s!    4 +	r   c                     [        U R                  SS 5      (       a$  U R                  R                  R                  5       $ g )Nrolloutsequence)r   r   r   rU   r   s    r   RolloutSequenceRefr     s4     T]]-t44==((..00	r   c                 H    [        U 5      nU(       a  UR                  5       $ g ro   )r   r7   r   rollout_sequence_refs     r   RolloutSequenceNamer     s"    +D1,,..	r   c                 d    [        U 5      nU(       a  UR                  5       R                  5       $ g ro   )r   r   r7   r   s     r   RolloutSequenceParentNamer     s+    +D1&&(5577	r   c                 H    [        U 5      nU(       a  UR                  5       $ g ro   )r   r_   r   s     r   RolloutSequenceIdr     s"    +D1$$&&	r   )r.   )G__doc__
__future__r   r   r   r@   &googlecloudsdk.api_lib.container.fleetr   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper   r	   googlecloudsdk.corer
   r   4googlecloudsdk.generated_clients.apis.gkehub.v1alphar   r"   r    r!   BETAGAr   r   r   r   r&   TrackClientr)   V2TrackClientr+   r-   r:   rG   rM   rW   r[   r`   rb   rg   Resourcerm   strrp   rs   rv   rz   r}   r   r   r   r   r   r   r   r   r   r   r   	Operationr   	Namespacer   r   r   r   r   r   r   r    r   r   <module>r      s    &  ' 	 8 , ( 5 * ) j 	YH$ 	YH$ %)$5$5$8$8 F '+&7&7&=&= Id&7&7 . ##&&F
F ##))I
I "&!2!2!5!5 C ##)), ##))	
 ( ##))	J
 	J d.?.?.E.EJ ,0+<+<+B+B 
 04/@/@/F/F 
 8<7H7H7N7N  #'"3"3"9"9" )-(9(9(?(?$ '+&7&7&=&=" #'"3"3"9"9" -1,=,=,C,C$ )-(9(9(?(?$ 8<7H7H7N7NB ##&&, #+$:K:K:N:N N44 9K9K )&00 )Y5G5G )
'11 c -77 %// C 

%
%/99 c $5$?$? -77 C r   