
                            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dZe
j*                   e
j,                  e
j.                  j0                         G d de
j2                                      Ze
j*                   e
j,                  e
j.                  j6                         G d de                    Zee_        y)z!Command for creating wire groups.    )absolute_import)division)unicode_literals)base_classes)client)base)scope)flags)
propertiesa          *{command}* is used to create wire groups. A wire group represents a
        group of redundant wires between interconnects in two different metros.
        Each WireGroup belongs to a CrossSiteNetwork.

        For an example, refer to the *EXAMPLES* section below.
        z        To create a wire group, run:

          $ {command} example-wire-group               --project my-project               --cross-site-network example-cross-site-network               --bandwidth-unmetered 1
        )DESCRIPTIONEXAMPLESc                   4    e Zd ZdZdZdZed        Zd Zd Z	y)CreateCreate a Compute Engine wire group.

  *{command}* is used to create wire groups. A wire group represents a
  group of redundant wires between interconnects in two different metros.
  Each WireGroup belongs to a CrossSiteNetwork.
  Nc                    t        j                         | _        | j                  j                  |       t	        j
                  d      | _        | j                  j                  |d       t	        j                  |       t	        j                  |       t	        j                  |       t	        j                  |       t	        j                  |       t	        j                  |       t	        j                  |       y )NF)pluralcreate)operation_type)cross_site_network_flags(CrossSiteNetworkArgumentForOtherResourceCROSS_SITE_NETWORK_ARGAddArgumentr
   WireGroupArgumentWIRE_GROUP_ARGAddDescriptionAddTypeAddBandwidthUnmeteredAddBandwidthAllocationAddFaultResponseAddAdminEnabledAddValidateOnly)clsparsers     7lib/surface/compute/interconnects/wire_groups/create.pyArgszCreate.Args>   s     	!IIK  **6200>C""6("C	 	MM&	'	  (	6"	&!	&!    c                      y)Nzcompute.wireGroups )selfs    r$   
CollectionzCreate.CollectionN   s    r&   c                    t        j                  | j                               }| j                  j	                  ||j
                  t        j                  j                  d|j                  i      }t        j                  j                  j                  j                         }t        j                   |||j                  |j                        }|j#                  |j$                  |j&                  |j(                  t+        |dd       |j,                  |j.                  t+        |dd       t+        |dd       |j0                  	      S )NcrossSiteNetwork)default_scopeadditional_params)compute_clientbandwidth_meterednetwork_service_classbandwidth_allocation)	descriptionwire_group_typebandwidth_unmeteredr0   fault_responseadmin_enabledr1   r2   validate_only)r   ComputeApiHolderReleaseTrackr   ResolveAsResource	resourcescompute_scope	ScopeEnumGLOBALcross_site_networkr   VALUEScoreproject	GetOrFailr   	WireGroupr   r3   typer5   getattrr6   r7   r8   )r)   argsholderrefrC   
wire_groups         r$   Runz
Create.RunQ   s   **4+<+<+>?F



/
/#--44-t/F/FG	 0 C $$,,668G!!Wd--fmmJ $$		 44!$(;TB**((%d,CTJ$T+A4H((   r&   )
__name__
__module____qualname____doc__r   r   classmethodr%   r*   rL   r(   r&   r$   r   r   1   s0     ." " r&   r   c                   ,     e Zd ZdZe fd       Z xZS )CreateAlphar   c                     t         t        |   |       t        j                  |       t        j
                  |       y )N)superrS   r%   r
   AddBandwidthMeteredAddNetworkServiceClass)r"   r#   	__class__s     r$   r%   zCreateAlpha.Argsw   s.    	+s (	f%	  (r&   )rM   rN   rO   rP   rQ   r%   __classcell__)rX   s   @r$   rS   rS   m   s     ) )r&   rS   N)rP   
__future__r   r   r   googlecloudsdk.api_lib.computer   8googlecloudsdk.api_lib.compute.interconnects.wire_groupsr   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer	   r=   Dgooglecloudsdk.command_lib.compute.interconnects.cross_site_networksr
   r   <googlecloudsdk.command_lib.compute.interconnects.wire_groupsgooglecloudsdk.corer   DETAILED_HELPUniverseCompatibleReleaseTracksr:   BETACreateCommandr   ALPHArS   detailed_helpr(   r&   r$   <module>ri      s    ( &  ' 7 K ( E r N *& D%%**+7T 7 , 7t D%%++,)& ) - ) % r&   