
    (                     t   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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\R"                  5      r " S S\R&                  5      rS rS rS rS rS rS rS rS rS rS rS rS(S jr S)S jr!S)S jr"S)S jr#S r$S  r% S(S! jr&S" r'S# r(S$ r)S% r*S& r+g')*z<Shared resource flags for `gcloud container azure` commands.    )absolute_import)division)unicode_literals)concepts)deps)util)concept_parsers)presentation_specs)
properties)	resourcesc                   8   ^  \ rS rSrSrU 4S jrU 4S jrSrU =r$ )!_ProjectNumberPropertyFallthrough   z<A fallthrough for project number from property core/project.c                 l   > [         [        U ]  [        R                  R
                  R                  S9  g)See base class.)propN)superr   __init__r   VALUEScoreprojectself	__class__s    ?lib/googlecloudsdk/command_lib/container/azure/resource_args.pyr   *_ProjectNumberPropertyFallthrough.__init__!   s-    	
+T;##++ <     c                 <   > [        [        [        U ]  U5      5      $ r   )_EnsureProjectNumberr   r   _Callr   parsed_argsr   s     r   r!   '_ProjectNumberPropertyFallthrough._Call'   s     /<[I r    	__name__
__module____qualname____firstlineno____doc__r   r!   __static_attributes____classcell__r   s   @r   r   r      s    D r   r   c                   8   ^  \ rS rSrSrU 4S jrU 4S jrSrU =r$ )_ProjectNumberArgFallthrough.   z=A fallthrough for project number from the --project argument.c                 (   > [         [        U ]  SS9  g)r   z	--project)arg_nameN)r   r0   r   r   s    r   r   %_ProjectNumberArgFallthrough.__init__1   s    	
&66Lr   c                 <   > [        [        [        U ]  U5      5      $ r   )r    r   r0   r!   r"   s     r   r!   "_ProjectNumberArgFallthrough._Call5   s     *D7D r   r%   r&   r.   s   @r   r0   r0   .   s    EM r   r0   c                 R    [         R                  R                  U R                  SS9$ N+gkemulticloud.projects.locations.operations
collection)r   REGISTRYParseRelativeNamename)ops    r   GetOperationResourcer@   <   s*    				-	-ggG 
. 
 r   c                  ,    [         R                  " SSS9$ )Nclusterzcluster of the {resource}.r>   	help_textr    ResourceParameterAttributeConfigr%   r   r   AzureClusterAttributeConfigrG   B   s    		2	2 <
 r   c                  ,    [         R                  " SSS9$ )Nnodepoolznode pool of the {resource}.rC   rE   r%   r   r   AzureNodePoolAttributeConfigrJ   H   s    		2	2!?
 r   c                  ,    [         R                  " SSS9$ )NclientzAzure client of the {resource}.rC   rE   r%   r   r   AzureClientAttributeConfigrM   N   s    		2	2@
 r   c                      [         R                  " SS[        R                  " [        R
                  R                  R                  5      /S9$ )z.Gets Google Cloud location resource attribute.locationz)Google Cloud location for the {resource}.r>   rD   fallthroughs)r   rF   r   PropertyFallthroughr   r   container_azurerO   r%   r   r   LocationAttributeConfigrT   T   s@    		2	2;

"
":#4#4#D#D#M#M
N
 r   c                     U (       d  [         R                  $ [         R                  " SS[        5       [	        5       /S9$ )Nr   zGProject number of the Google Cloud Platform project for the {resource}.rP   )r    DEFAULT_PROJECT_ATTRIBUTE_CONFIGrF   r0   r   use_project_numbers    r   ProjectAttributeConfigrY   _   s?    	444		2	2 '
(
+
-

 
r   c                  ,    [         R                  " SSS9$ )N	operationzOperation for the {resource}.rC   rE   r%   r   r   OperationAttributeConfigr\   o   s    		2	2"A
 r   c                  \    [         R                  " SS[        5       [         R                  S9$ )Nz gkemulticloud.projects.locationsrO   )resource_namelocationsId
projectsId)r   ResourceSpecrT   rV   r%   r   r   GetLocationResourceSpecrb   u   s*    			()+::	
 r   c                  n    [         R                  " SS[        5       [        5       [         R                  S9$ )Nr9   r[   )r^   operationsIdr_   r`   )r   ra   r\   rT   rV   r%   r   r   GetOperationResourceSpecre   ~   s0    			3+-)+::
 r   c                  n    [         R                  " SS[        5       [        5       [         R                  S9$ )N.gkemulticloud.projects.locations.azureClustersrB   )r^   azureClustersIdr_   r`   )r   ra   rG   rT   rV   r%   r   r   GetAzureClusterResourceSpecri      s0    			613)+::
 r   c            	          [         R                  " SS[        5       [        5       [	        5       [         R
                  S9$ )N=gkemulticloud.projects.locations.azureClusters.azureNodePoolsrI   )r^   azureNodePoolsIdrh   r_   r`   )r   ra   rJ   rG   rT   rV   r%   r   r   GetAzureNodePoolResourceSpecrm      s6    			E3513)+::
 r   c           	      d    [         R                  " SS[        5       [        5       [	        U 5      S9$ )aW  Gets the resource spec for an Azure client.

Args:
  use_project_number: bool, whether to enforce using project number in the
    resource spec. Project number should always be used when a resource is
    referenced in a field e.g. the client field when creating/updating Azure
    clusters.

Returns:
  The resource spec for an Azure client.
-gkemulticloud.projects.locations.azureClientsrL   )r^   azureClientsIdr_   r`   )r   ra   rM   rT   rY   rW   s    r   GetAzureClientResourceSpecrq      s2     
		5/1)+'(:;
 r   c                     U(       a  SOSn[         R                  R                  U[        5       SR	                  U5      SS9R                  U 5        g)zAdds a resource argument for an Azure cluster.

Args:
  parser: The argparse.parser to add the resource arg to.
  verb: str, the verb to describe the resource, such as 'to update'.
  positional: bool, whether the argument is positional or not.
rB   z	--clusterzcluster {}.TrequiredN)r	   ConceptParserForResourceri   formatAddToParserparserverb
positionalr>   s       r   AddAzureClusterResourceArgr}      sL     !k$++
!#4 	 , 
 Kr   c                     U(       a  SOSn[         R                  R                  U[        5       SR	                  U5      SS9R                  U 5        g)zAdds a resource argument for an Azure node pool.

Args:
  parser: The argparse.parser to add the resource arg to.
  verb: str, the verb to describe the resource, such as 'to update'.
  positional: bool, whether the argument is positional or not.
	node_poolz--node-poolznode pool {}.Trs   N)r	   ru   rv   rm   rw   rx   ry   s       r   AddAzureNodePoolResourceArgr      sL     #$++
"$T"	 , 
 Kr   c                     U(       a  SOSn[         R                  R                  U[        5       SR	                  U5      SS9R                  U 5        g)zAdds a resource argument for an Azure client.

Args:
  parser: The argparse.parser to add the resource arg to.
  verb: str, the verb to describe the resource, such as 'to update'.
  positional: bool, whether the argument is positional or not.
rL   --clientzAzure client {}.Trs   N)r	   ru   rv   rq   rw   rx   ry   s       r   AddAzureClientResourceArgr      sL      Z$++
 "%	 , 
 Kr   c                     [         R                  R                  S[        5       SR	                  U5      SS9R                  U 5        g)zAdds a resource argument for Google Cloud location.

Args:
  parser: The argparse.parser to add the resource arg to.
  verb: str, the verb to describe the resource, such as 'to list'.
z
--locationzGoogle Cloud location {}.Trs   N)r	   ru   rv   rb   rw   rx   rz   r{   s     r   AddLocationResourceArgr      sC     ++!((.	 , 
 Kr   c                     [         R                  R                  S[        5       SR	                  U5      SS9R                  U 5        g)zAdds a resource argument for operation in Azure.

Args:
  parser: The argparse parser to add the resource arg to.
  verb: str, the verb to describe the resource, such as 'to update'.
operation_idzoperation {}.Trs   N)r	   ru   rv   re   rw   rx   r   s     r   AddOperationResourceArgr      sC     ++ T"	 , 
 Kr   c                 4   [         R                  " [        R                  " S[	        5       SR                  U(       a  SOS5      SS9[        R                  " S[        SS9S	R                  U(       a  SOS
5      SSS0US9/SS/0S9nUR                  U 5        g)a5  Adds resource arguments for both Azure cluster and client.

This is used for the create and update command.

Args:
  parser: The argparse.parser to add the resource arg to.
  auth_config_group: The Authentication Configuration argument group.
  update: bool, whether the resources are used in update command.
rB   zAzure cluster to {}.updatecreateTrs   r   rW   z#Azure client to use for cluster {}.creationFrO    )rt   flag_name_overridesgroupz--client.locationzcluster.location)command_level_fallthroughsN)r	   ru   r
   ResourcePresentationSpecri   rw   rq   rx   )rz   auth_config_groupr   
arg_parsers       r   $AddAzureClusterAndClientResourceArgsr     s     ,,

5
5)+$++HHM	 
5
5(DA3::$(* #-r"2%	$ #68J7K!L'**  r   c                     [         R                  R                  U R                  R                  R                  5       R                  5       SS9$ )Nro   r:   )r   r<   r=   CONCEPTSrL   ParseRelativeNameargss    r   ParseAzureClientResourceArgr   '  sB    				-	-
mm  "//1@ 
. 
 r   c                     [         R                  R                  U R                  R                  R                  5       R                  5       SS9$ )Nrg   r:   )r   r<   r=   r   rB   r   r   r   s    r   ParseAzureClusterResourceArgr   .  sB    				-	-
mm!!#002A 
. 
 r   c                     [         R                  R                  U R                  R                  R                  5       R                  5       SS9$ )Nrk   r:   )r   r<   r=   r   r   r   r   r   s    r   ParseAzureNodePoolResourceArgr   5  sB    				-	-
mm##%224
I 
. 
 r   c                     [         R                  R                  U R                  R                  R                  5       R                  5       SS9$ r8   )r   r<   r=   r   r   r   r   r   s    r   ParseOperationResourceArgr   >  sB    				-	-
mm  &&(557> 
. 
 r   c                 f    U c  U $ U R                  5       (       a  U $ [        R                  " U 5      $ )N)isdigitproject_utilGetProjectNumber)ps    r   r    r    E  s-    YHYY[[H		&	&q	))r   N)F)T),r+   
__future__r   r   r    googlecloudsdk.calliope.conceptsr   r   #googlecloudsdk.command_lib.projectsr   r   (googlecloudsdk.command_lib.util.conceptsr	   r
   googlecloudsdk.corer   r   rR   r   ArgFallthroughr0   r@   rG   rJ   rM   rT   rY   r\   rb   re   ri   rm   rq   r}   r   r   r   r   r   r   r   r   r   r    r%   r   r   <module>r      s    C &  ' 5 1 D D G * )(@(@  4#6#6  *"""  ',!!H*r   