
    f                     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S jr	S	 r
S
 rg)zDUtility methods for the `compute sole-tenancy node-groups` commands.    )absolute_import)division)unicode_literals)
exceptions)ChoiceToEnumNameNc                 (    U R                  XUS.SS9$ )aa  Parses a node template resource and returns a resource reference.

Args:
  resources: Resource registry used to parse the node template.
  name: The name of the node template.
  project: The project the node template is associated with.
  region: The region the node temlpate is associated with.

Returns:
  The parsed node template resource reference.
)projectregionzcompute.nodeTemplates)
collection)Parse)	resourcesnamer	   r
   s       Glib/googlecloudsdk/command_lib/compute/sole_tenancy/node_groups/util.pyParseNodeTemplater      s%     

62( 
 
* *    c                 .   UR                  U R                  (       a.  UR                   R                  [        U R                  5      5      OSU R	                  S5      (       a  U R
                  OSU R	                  S5      (       a  U R                  OSS9nU$ )z2Build NodeGroupAutoscalingPolicy object from args.N	min_nodes	max_nodes)modeminNodesmaxNodes)NodeGroupAutoscalingPolicyautoscaler_modeModeValueValuesEnumr   IsSpecifiedr   r   )argsmessagesautoscaling_policys      r   BuildAutoscalingr   *   s      :: ## //CC
4//
02)-!%!1!1+!>!>t~~D!%!1!1+!>!>t~~D ; J 
r   c           
      d   UR                   S:X  a*  UR                  (       d  Sn[        R                  " SU5      eUR                   S:X  d  UR                   S:X  aC  UR                  (       a2  SR	                  UR                   5      n[        R
                  " SU5      eUR                   S:X  a  / nUR                   HC  nUR                  U R                  R                  R                  UU R                  US9S95        ME     U R                  U R                  R                  R                  U R                  R                  US	9S
9$ UR                   S:X  a-  U R                  U R                  R                  R                  S9$ U R                  U R                  R                  R                  S9$ )z+Build ShareSettings object from parameters.projectsz@[--share-setting=projects] must be specified with [--share-with]z--share-withorganizationlocalz7List of shared projects must be empty for {} share type)	projectId)keyvalue)additionalProperties)	shareType
projectMap)r(   )share_setting
share_withr   RequiredArgumentExceptionformatInvalidArgumentExceptionappendShareSettingsProjectMapValueAdditionalPropertyShareSettingsProjectConfigShareTypeValueValuesEnumSPECIFIC_PROJECTSORGANIZATIONLOCAL)r   r   msgadditional_propertiesr	   s        r   BuildShareSettingsr:   6   s   
J&
LC

.
.~s
CC
N*
G#
C
J
JC

-
-nc
BB	:%??""

 
 
0
0
C
C77'7J D LM #
 !!"";;MM))99!6 : 8 " 9 9
 ^+!!"";;HH " K K 
		''@@FF 
  
I Ir   )NN)__doc__
__future__r   r   r   googlecloudsdk.callioper   .googlecloudsdk.command_lib.util.apis.arg_utilsr   r   r   r:    r   r   <module>r@      s*    K &  ' . K*"	Ir   