
                            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 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 ddlmZ  ej(                  ej*                  j,                        ej.                   G d dej0                                      Z ej(                  ej*                  j4                         G d de             Z ej(                  ej*                  j8                         G d de             Zy)z'Create public delegated prefix command.    )absolute_import)division)unicode_literals)base_classes)public_delegated_prefixes)utils)base)flags)	arg_utils)logc                   H    e Zd ZdZej
                  ZdZed        Z	d Z
d Zy)CreateCreates a Compute Engine public delegated prefix.

  ## EXAMPLES

  To create a public delegated prefix:

    $ {command} my-public-delegated-prefix --public-advertised-prefix=my-pap \
      --range=120.120.10.128/27 --global
  Fc                     t        j                         j                  |       t        j                  || j                         y N)r
   MakePublicDelegatedPrefixesArgAddArgumentAddCreatePdpArgsToParser*_include_internal_subnetwork_creation_mode)clsparsers     7lib/surface/compute/public_delegated_prefixes/create.pyArgszCreate.Args/   s2    	((*66v>	"">>    c                 2   t        j                  | j                               }t        j                  |j
                  |j
                  j                  |j                        }t        j                         j                  ||j                  t        j                  |j
                              }|j                  rIt        j                  |j                  |j
                  j                  j                   j"                        }nd }t%        |d      rU|j&                  rIt        j                  |j&                  |j
                  j                  j                   j(                        }nd }|j+                  ||j,                  r|j,                  nd |j.                  r|j.                  nd |j0                  |j2                  |j4                  ||j6                  rt9        |j6                        nd |	      }t;        j<                  |j?                         d       |S )N)scope_listerpurpose)parent_pap_prefixparent_pdp_prefixip_cidr_rangedescriptionenable_live_migrationmodeallocatable_prefix_lengthr   zpublic delegated prefix) r   ComputeApiHolderReleaseTrackr   PublicDelegatedPrefixesClientclientmessages	resourcesr
   r   ResolveAsResourcecompute_flagsGetDefaultScopeListerr#   r   ChoiceToEnumPublicDelegatedPrefixModeValueValuesEnumhasattrr   PurposeValueValuesEnumr   public_advertised_prefixpublic_delegated_prefixranger!   r"   r$   intr   CreatedResourceName)selfargsholder
pdp_clientpdp_ref
input_moder   results           r   _RunzCreate._Run6   s   **4+<+<+>?F*HHv}}--v/?/?J 224FF"88G G G yy))
))
--
 
 
6
6
J
Jj
 jtYDLL&&
,,
--
 
 
6
6
M
Mg
 g(( 77'' 66jj$$"88)) #&d&D&D"E  F" (ABMr   c                 $    | j                  |      S r   r@   r9   r:   s     r   Runz
Create.Rune       99T?r   N)__name__
__module____qualname____doc__compute_apiCOMPUTE_GA_API_VERSION_api_versionr   classmethodr   r@   rD    r   r   r   r      s7     33,/4, -^r   r   c                   ,    e Zd ZdZej
                  ZdZy)
CreateBetar   FN)rF   rG   rH   rI   rJ   COMPUTE_BETA_API_VERSIONrL   r   rN   r   r   rP   rP   i   s     55,/4,r   rP   c                   N     e Zd ZdZej
                  ZdZe fd       Z	d Z
 xZS )CreateAlphar   Tc                 V    t        j                  |       t        t        |   |       y r   )r
   AddPdpPurposesuperrS   r   )r   r   	__class__s     r   r   zCreateAlpha.Args   s     		+s (r   c                 $    | j                  |      S r   rB   rC   s     r   rD   zCreateAlpha.Run   rE   r   )rF   rG   rH   rI   rJ   COMPUTE_ALPHA_API_VERSIONrL   r   rM   r   rD   __classcell__)rW   s   @r   rS   rS   y   s2     66,/3,) )r   rS   N)rI   
__future__r   r   r   googlecloudsdk.api_lib.computer   r   r   rJ   googlecloudsdk.callioper	   "googlecloudsdk.command_lib.computer
   r,   <googlecloudsdk.command_lib.compute.public_delegated_prefixes$googlecloudsdk.command_lib.util.apisr   googlecloudsdk.corer   ReleaseTracksr&   GAUniverseCompatibleCreateCommandr   BETArP   ALPHArS   rN   r   r   <module>rh      s    . &  ' 7 D ? ( E N : # D%%(()ET E  *EP D%%**+5 5 ,5 D%%++,*  -r   