
                             d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ	  e	j                  ddd	d
e	j                        Zd Zd Z	 ddZd Zd Z	 ddZd Zd Zy)z;Flags for the `compute public-delegated-prefixes` commands.    )absolute_import)division)unicode_literals)base)flags--public-delegated-prefixpublic delegated prefix%compute.globalPublicDelegatedPrefixescompute.publicDelegatedPrefixes)nameresource_nameglobal_collectionregional_collectionregion_explanationc                  2    t        j                  ddd      S )Nr	   r   r
   )r   r   r   compute_flagsResourceArgument     Ilib/googlecloudsdk/command_lib/compute/public_delegated_prefixes/flags.pyMakePublicDelegatedPrefixesArgr   !   s    		'	'-;?
 r   c                  0    t        j                  dd      S )Nr	   r   )r   r   r   r   r   r   &MakeRegionalPublicDelegatedPrefixesArgr   )   s    		'	'-;
 r   c                    | j                  d      }|j                  dd       |j                  dd       | j                  ddd	
       | j                  dd       | j                  dddd       g d}|r|j                  d       t        j                  d|d      j                  |        | j                  dd       y)z8Adds flags for public delegated prefixes create command.T)requiredz--public-advertised-prefixzDPublic advertised prefix that this delegated prefix is created from.helpr   zLRegional Public delegated prefix that this delegated prefix is created from.--rangezIP range from this public delegated prefix that should be delegated, in CIDR format. It must be smaller than parent public advertised prefix range.)r   r   --descriptionz,Description of this public delegated prefix.z--enable-live-migration
store_trueNzESpecify if this public delegated prefix is meant to be live migrated.actiondefaultr   
delegationz&external-ipv6-forwarding-rule-creationz!external-ipv6-subnetwork-creation!internal-ipv6-subnetwork-creation--mode$Specifies the mode of this IPv6 PDP.choiceshelp_str--allocatable-prefix-lengthz4The allocatable prefix length supported by this PDP.)add_mutually_exclusive_groupadd_argumentappendr   ChoiceArgumentAddToParser)parser)include_internal_subnetwork_creation_modeparent_prefix_argsmode_choicess       r   AddCreatePdpArgsToParserr7   0   s    ::D:I!!"
P "  !!! "  	%	   	J   	  ,
 /;<5 K#A  r   c                 0    | j                  dg dd       y)z8Adds flags for global public delegated prefixes purpose.z	--purpose)$APPLICATION_AND_PROXY_LOAD_BALANCERS-PASSTHROUGH_LOAD_BALANCER_AVAILABILITY_GROUP0-PASSTHROUGH_LOAD_BALANCER_AVAILABILITY_GROUP1zxThe purpose of the public delegated prefix. This field can only be set for the top-level global public delegated prefix.)r+   r   Nr/   r3   s    r   AddPdpPurposer>   i   s#    C  r   c                     | j                  ddj                  |             t        j                  | dj                  |             y)zCAdds common flags for delegate sub prefixes create/delete commands.r   z'Name of the delegated sub prefix to {}.r   z{} the delegate sub prefix for)operation_typeN)r/   format PUBLIC_DELEGATED_PREFIX_FLAG_ARGAddArgument)r3   verbs     r   _AddCommonSubPrefixArgsrE   y   sL    <CCDI   #..=DDTJ / r   c                 X   t        | d       | j                  dd       | j                  dd       | j                  dd       | j                  d	d
d       g d}|r|j                  d       t        j                  d|d      j                  |        | j                  dd       y)z4Adds flags for delegate sub prefixes create command.creater   zIPv4 range from this public delegated prefix that should be delegated, in CIDR format. If not specified, the entire range ofthe public advertised prefix is delegated.r   r    z2Description of the delegated sub prefix to create.z--delegatee-projectzProject to delegate the IPv4 range specified in `--range` to. If empty, the sub-range is delegated to the same/existing project.z--create-addressesr!   znSpecify if the sub prefix is delegated to create address resources in the delegatee project. Default is false.)r#   r   r%   r'   r(   r)   r*   r-   z?Specify allocatable prefix length supported by this sub prefix.N)rE   r/   r0   r   r1   r2   )r3   r4   r6   s      r   AddCreateSubPrefixArgsrH      s     &(+7   	P   	O   	B	  ,
 /;<5 K#L  r   c                     t        | d       y)z4Adds flags for delegate sub prefixes delete command.deleteN)rE   r=   s    r   AddDeleteSubPrefixArgsrK      s    &(+r   c                 X    | j                  dddd       | j                  dddd       y )Nz--announce-prefixr!   Fz:Specify if the prefix will be announced. Default is false.r"   z--withdraw-prefixz:Specify if the prefix will be withdrawn. Default is false.r<   r=   s    r   AddUpdatePrefixArgsrM      sB    G	   	G	  r   N)F)__doc__
__future__r   r   r   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer   r   r   REGION_PROPERTY_EXPLANATIONrB   r   r   r7   r>   rE   rH   rK   rM   r   r   r   <module>rS      sv    B &  ' ( E#A=#A#A	$+=9$@@$   7<6r  7<.b,
r   