
    O(                     P   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
\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.    )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   r-   r   r   s    r   r   %_ProjectNumberArgFallthrough.__init__.   s    	
&66Lr   c                 <   > [        [        [        U ]  U5      5      $ r   )r   r   r-   r   r   s     r   r   "_ProjectNumberArgFallthrough._Call2   s     *D7D r   r"   r#   r+   s   @r   r-   r-   +   s    EM r   r-   c                 R    [         R                  R                  U R                  SS9$ N+gkemulticloud.projects.locations.operations
collection)r	   REGISTRYParseRelativeNamename)ops    r   GetOperationResourcer=   9   s*    				-	-ggG 
. 
 r   c                  ,    [         R                  " SSS9$ )Nclusterzcluster of the {resource}.r;   	help_textr    ResourceParameterAttributeConfigr"   r   r   AzureClusterAttributeConfigrD   ?   s    		2	2 <
 r   c                  ,    [         R                  " SSS9$ )Nnodepoolznode pool of the {resource}.r@   rB   r"   r   r   AzureNodePoolAttributeConfigrG   E   s    		2	2!?
 r   c                  ,    [         R                  " SSS9$ )NclientzAzure client of the {resource}.r@   rB   r"   r   r   AzureClientAttributeConfigrJ   K   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;   rA   fallthroughs)r   rC   r   PropertyFallthroughr   r   container_azurerL   r"   r   r   LocationAttributeConfigrQ   Q   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}.rM   )r    DEFAULT_PROJECT_ATTRIBUTE_CONFIGrC   r-   r   use_project_numbers    r   ProjectAttributeConfigrV   \   s?    	444		2	2 '
(
+
-

 
r   c                  ,    [         R                  " SSS9$ )N	operationzOperation for the {resource}.r@   rB   r"   r   r   OperationAttributeConfigrY   l   s    		2	2"A
 r   c                  \    [         R                  " SS[        5       [         R                  S9$ )Nz gkemulticloud.projects.locationsrL   )resource_namelocationsId
projectsId)r   ResourceSpecrQ   rS   r"   r   r   GetLocationResourceSpecr_   r   s*    			()+::	
 r   c                  n    [         R                  " SS[        5       [        5       [         R                  S9$ )Nr6   rX   )r[   operationsIdr\   r]   )r   r^   rY   rQ   rS   r"   r   r   GetOperationResourceSpecrb   {   s0    			3+-)+::
 r   c                  n    [         R                  " SS[        5       [        5       [         R                  S9$ )N.gkemulticloud.projects.locations.azureClustersr?   )r[   azureClustersIdr\   r]   )r   r^   rD   rQ   rS   r"   r   r   GetAzureClusterResourceSpecrf      s0    			613)+::
 r   c            	          [         R                  " SS[        5       [        5       [	        5       [         R
                  S9$ )N=gkemulticloud.projects.locations.azureClusters.azureNodePoolsrF   )r[   azureNodePoolsIdre   r\   r]   )r   r^   rG   rD   rQ   rS   r"   r   r   GetAzureNodePoolResourceSpecrj      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.azureClientsrI   )r[   azureClientsIdr\   r]   )r   r^   rJ   rQ   rV   rT   s    r   GetAzureClientResourceSpecrn      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.
r?   z	--clusterzcluster {}.TrequiredN)r   ConceptParserForResourcerf   formatAddToParserparserverb
positionalr;   s       r   AddAzureClusterResourceArgrz      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 {}.Trp   N)r   rr   rs   rj   rt   ru   rv   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.
rI   --clientzAzure client {}.Trp   N)r   rr   rs   rn   rt   ru   rv   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 {}.Trp   N)r   rr   rs   r_   rt   ru   rw   rx   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 {}.Trp   N)r   rr   rs   rb   rt   ru   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.
r?   zAzure cluster to {}.updatecreateTrp   r   rT   z#Azure client to use for cluster {}.creationFrL    )rq   flag_name_overridesgroupz--client.locationzcluster.location)command_level_fallthroughsN)r   rr   r   ResourcePresentationSpecrf   rt   rn   ru   )rw   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$ )Nrl   r7   )r	   r9   r:   CONCEPTSrI   ParseRelativeNameargss    r   ParseAzureClientResourceArgr   $  sB    				-	-
mm  "//1@ 
. 
 r   c                     [         R                  R                  U R                  R                  R                  5       R                  5       SS9$ )Nrd   r7   )r	   r9   r:   r   r?   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$ )Nrh   r7   )r	   r9   r:   r   r|   r   r   r   s    r   ParseAzureNodePoolResourceArgr   2  sB    				-	-
mm##%224
I 
. 
 r   c                     [         R                  R                  U R                  R                  R                  5       R                  5       SS9$ r5   )r	   r9   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   B  s-    YHYY[[H		&	&q	))r   N)F)T)(r(    googlecloudsdk.calliope.conceptsr   r   #googlecloudsdk.command_lib.projectsr   r   (googlecloudsdk.command_lib.util.conceptsr   r   googlecloudsdk.corer   r	   rO   r   ArgFallthroughr-   r=   rD   rG   rJ   rQ   rV   rY   r_   rb   rf   rj   rn   rz   r}   r   r   r   r   r   r   r   r   r   r"   r   r   <module>r      s    C 6 1 D D G * )(@(@  4#6#6  *"""  ',!!H*r   