
    ,                     ~   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  \R                  \R                   " \R"                  R$                  5       " S	 S
\
R&                  5      5       5       rS S jrS rS rS rS rS rS rS rS rS rS rS r S r!S r"S r#S r$S r%S r&S r'S r(g)!z@Flags and helpers for the compute interconnects groups commands.    )absolute_import)division)unicode_literals)arg_parsers)base)
completers)flagsc                   (   ^  \ rS rSrU 4S jrSrU =r$ )InterconnectGroupsCompleter   c                 4   > [         [        U ]
  " SSSS.UD6  g )Ncompute.interconnectGroupsz'compute interconnects groups list --uri)
collectionlist_command )superr   __init__)selfkwargs	__class__s     Dlib/googlecloudsdk/command_lib/compute/interconnects/groups/flags.pyr   $InterconnectGroupsCompleter.__init__    s(    	
%t5 />     r   )__name__
__module____qualname____firstlineno__r   __static_attributes____classcell__)r   s   @r   r   r      s     r   r   c                 :    [         R                  " S[        UU SS9$ )Nzinterconnect groupr   )resource_name	completerpluralrequiredglobal_collection)compute_flagsResourceArgumentr   )r$   r#   s     r   InterconnectGroupArgumentr(   (   s$    		'	'(+4
 r   c                 @    Uc  gU R                   R                  U5      $ )zConverts the interconnect type flag to a message enum.

Args:
  messages: The API messages holder.
  interconnect_type_arg: The interconnect type flag value.

Returns:
  An InterconnectTypeValueValuesEnum of the flag value, or None if absent.
N)0InterconnectGroupsCreateMembersInterconnectInputInterconnectTypeValueValuesEnum)messagesinterconnect_type_args     r   GetInterconnectTyper.   2   s)     "DDdd r   c                 @    Uc  gU R                   R                  U5      $ )zConverts the link type flag to a message enum.

Args:
  messages: The API messages holder.
  link_type_arg: The link type flag value.

Returns:
  An LinkTypeValueValuesEnum of the flag value, or None if absent.
N)r*   LinkTypeValueValuesEnum)r,   link_type_args     r   GetLinkTyper2   D   s)     DD\\ r   c           	      f   ^  U(       d  / $ [        [        [        SU 4S jU 5       5      5      5      $ )a  Converts the requested-features flag to a list of message enums.

Args:
  messages: The API messages holder.
  requested_features_arg: A list of the interconnect feature type flag values.

Returns:
  A list of RequestedFeaturesValueListEntryValuesEnum values, or None if
  absent.
Nc              3   <   >#    U  H  n[        TU5      v   M     g 7f)N)GetRequestedFeature).0fr,   s     r   	<genexpr>'GetRequestedFeatures.<locals>.<genexpr>g   s"      1a &h221s   )listsetfilter)r,   requested_features_args   ` r   GetRequestedFeaturesr>   V   s:     
 I		
1

 
r   c                     US:X  a  U R                   R                  S5      $ US:X  a  U R                   R                  S5      $ g)zConverts interconnect feature type flag to a message enum.

Args:
  messages: The API messages holder.
  feature_arg: The feature type flag value.

Returns:
  A RequestedFeaturesValueListEntryValuesEnum of the flag value.
MACSEC	IF_MACSECCROSS_SITE_NETWORKIF_CROSS_SITE_NETWORKN)r*   )RequestedFeaturesValueListEntryValuesEnum)r,   feature_args     r   r5   r5   p   sT     HDDnn  ((DDnn  
r   c                 $    U R                  SSS9  g)z2Adds facility flag to the argparse.ArgumentParser.z
--facilityz@The facility (zone free location) to create the interconnect in.helpNadd_argumentparsers    r   AddFacilityrM      s    M  r   c                 $    U R                  SSS9  g)z9Adds remote location flag to the argparse.ArgumentParser.z--remote-locationz>The location of the interconnect for Cross-Cloud Interconnect.rG   NrI   rK   s    r   AddRemoteLocationrO      s    K  r   c                 $    U R                  SSS9  g)z5Adds description flag to the argparse.ArgumentParser.z--descriptionz<An optional, textual description for the interconnect group.rG   NrI   rK   s    r   AddDescriptionrQ      s    I  r   c                 &    U R                  SSSS9  g)DAdds IntendedTopologyCapability flag to the argparse.ArgumentParser.--intended-topology-capabilityT{      The reliability the user intends this group to be capable of, in terms of
      the Interconnect product SLAs.
      r$   rH   NrI   rK   s    r   &AddIntendedTopologyCapabilityForCreaterW      s     &
  r   c                 &    U R                  SSSS9  g)rS   rT   FrU   rV   NrI   rK   s    r   &AddIntendedTopologyCapabilityForUpdaterY      s     &
  r   c                 $    U R                  SSS9  g)z4Adds UpdateMask flag to the argparse.ArgumentParser.z--update-maskz      Optional update mask to specify which fields to update. Use commas to
      separate masks. If not specified, all fields present in the command will
      be updated.
      rG   NrI   rK   s    r   AddUpdateMaskr[      s    
  r   c                 @    Uc  gU R                   R                  U5      $ )a  Converts the intended-topology-capability flag to a message enum.

Args:
  messages: The API messages holder.
  intended_topology_capability: The intended topology capability flag value.

Returns:
  An TopologyCapabilityValueValuesEnum of the flag value, or None if absent.
N)InterconnectGroupIntent!TopologyCapabilityValueValuesEnum)r,   intended_topology_capabilitys     r   GetTopologyCapabilityr`      s)     ")++MM$ r   c           	      P    U R                  S[        R                  " SS9S/ SSS9  g)	7Adds interconnects flag to the argparse.ArgumentParser.--interconnects   
max_lengthTINTERCONNECTzR      Member interconnects to add to or remove from the interconnect group.
      typer$   defaultmetavarrH   NrJ   r   ArgListrK   s    r   GetMemberInterconnectsrn      s4    "-
  	r   c           	      P    U R                  S[        R                  " SS9S/ SSS9  g)	rb   rc   rd   re   Frg   zM      Member interconnects to add to the interconnect group initially.
      rh   Nrl   rK   s    r   GetMemberInterconnectsForCreaterp      4    "-
  	r   c           	      P    U R                  S[        R                  " SS9S/ SSS9  g)	rb   rc   rd   re   Frg   zK      Member interconnects to set the interconnect group to contain.
      rh   Nrl   rK   s    r   GetMemberInterconnectsForUpdaters      rq   r   c                 
   U R                  S[        R                  " [        [        [        [	        5       [
        [        5       SS[        [        [        [        R                  " [        R                  SS9S.S/SS9S	SS
SS9  g)z6Adds interconnect flag to the argparse.ArgumentParser.z--interconnectN:)choicescustom_delim_char)facilitydescriptionnamez	link-typezrequested-link-countzinterconnect-typezadmin-enabledzno-admin-enabledznoc-contact-emailzcustomer-namezremote-locationzrequested-featuresrz   T)specrequired_keysallow_key_onlyappendrg   a=        New member interconnects to create in the interconnect group. To create
      multiple interconnects, this flag should be specified multiple times.

      Each interconnect takes in the same set of flags as the `gcloud compute
      interconnects create` command, except instead of a location, a facility
      must be specified. These flags are defined as a comma separated list of
      flag=value pairs.

      Example:
      --interconnect name=interconnect1,facility=iad-1,description="my
      interconnect",link-type=LINK_TYPE_ETHERNET_10G_LR,requested-link-count=1,
      interconnect-type=DEDICATED,admin-enabled,
      noc-contact-email=noc@google.com,customer-name=customer-name
      requested-features=MACSEC:CROSS_SITE_NETWORK

      Note that for multiple requested-features, use a colon (:) as the
      delimiter, as the comma is used to separate the flags. Similarly, if you
      need to use a comma in another flag value, you should set an alternative
      delimiter for the --interconnect flag. Run `gcloud topic escaping` for
      more information.
      )ri   actionr$   rk   rH   )
rJ   r   ArgDictstr_GetLinkTypeValidatorint_GetInterconnectTypeValidatorrm   interconnect_flagsREQUESTED_FEATURES_CHOICESrK   s    r   &AddMemberInterconnectsForCreateMembersr      s     02&)#@#B#"&#&"!$$/$7$7,GG$'%"  '* 
5  0r   c                      S n [         R                  " U SSR                  [        R                  R                  5       5       S35      $ )z+Returns a validator for the link-type flag.c                 0    U c  gU [         R                  ;   $ NT)r   LINK_TYPE_CHOICES)	link_types    r   _ValidateLinkType0_GetLinkTypeValidator.<locals>._ValidateLinkType5  s    *<<<<r   z$Invalid link-type, must be one of: [, ])r   CustomFunctionValidatorjoinr   r   keys)r   s    r   r   r   2  sK    =
 
	,	,

))&88==?
@	AD
 r   c                      S n [         R                  " U SSR                  [        R                  R                  5       5       S35      $ )z3Returns a validator for the interconnect-type flag.c                 0    U c  gU [         R                  ;   $ r   )r   INTERCONNECT_TYPE_CHOICES_GA)interconnect_types    r   _ValidateInterconnectType@_GetInterconnectTypeValidator.<locals>._ValidateInterconnectTypeD  s      2 O OOOr   z,Invalid interconnect-type, must be one of: [r   r   )r   r   r   r   r   r   )r   s    r   r   r   A  sL    P
 
	,	,

))&CCHHJ
K	LAO
 r   c                 *    U R                  SSS/SS9  g)zBAdds intent mismatch behavior flag to the argparse.ArgumentParser.z--intent-mismatch-behaviorREJECTCREATEz      The behavior when the intent of the interconnect group does not match the
      topology capability of the member interconnects.
      )rv   rH   NrI   rK   s    r   AddIntentMismatchBehaviorr   P  s%    ""
  r   c                 @    Uc  gU R                   R                  U5      $ )zConverts the intent mismatch behavior flag to a message enum.

Args:
  messages: The API messages holder.
  intent_mismatch_behavior: The intent mismatch behavior flag value.

Returns:
  An IntentMismatchBehaviorValueValuesEnum of the flag value.
N)InterconnectGroupsCreateMembers%IntentMismatchBehaviorValueValuesEnum)r,   intent_mismatch_behaviors     r   GetIntentMismatchBehaviorr   \  s)     %		1	1	W	W
 r   N)TF))__doc__
__future__r   r   r   googlecloudsdk.callioper   r   "googlecloudsdk.command_lib.computer   compute_completersr	   r&   0googlecloudsdk.command_lib.compute.interconnectsr   UniverseCompatibleReleaseTracksReleaseTrackALPHAListCommandCompleterr   r(   r.   r2   r>   r5   rM   rO   rQ   rW   rY   r[   r`   rn   rp   rs   r   r   r   r   r   r   r   r   <module>r      s    G &  ' / ( O E X D%%++,"4"I"I  - $$4*			$2j	r   