
    a#                     B    d Z ddlmZ ddlmZ ddlmZ  G d de      Zy)zInterconnect Group.    )absolute_import)division)unicode_literalsc                       e Zd ZdZddZed        Zed        Z	 	 	 	 	 	 	 	 	 	 	 d dededed	ed
e	dede
dedededefdZd Zd Zd Zd Zd Zd Zd Z	 	 	 	 d!dZd"dZd"dZ	 	 	 	 d#dZd"dZ	 	 	 d$dZy)%InterconnectGroupz&Abstracts Interconnect Group resource.Nc                 <    || _         || _        || _        || _        y N)refproject_compute_client
_resources)selfr
   r   compute_client	resourcess        Alib/googlecloudsdk/api_lib/compute/interconnects/groups/client.py__init__zInterconnectGroup.__init__   s    DHDL)DDO    c                 .    | j                   j                  S r	   )r   apitools_clientr   s    r   _clientzInterconnectGroup._client    s    ///r   c                 .    | j                   j                  S r	   )r   messagesr   s    r   	_messageszInterconnectGroup._messages$   s    (((r   facilitydescriptionname	link_typerequested_link_countinterconnect_typeadmin_enablednoc_contact_emailcustomer_nameremote_locationrequested_featuresc                 N    | j                   j                  |||||||||	|
|      S )z9Make an InterconnectGroupsCreateMembersInterconnectInput.)r   r   r   linkTyperequestedLinkCountinterconnectTypeadminEnablednocContactEmailcustomerNameremoteLocationrequestedFeatures)r   0InterconnectGroupsCreateMembersInterconnectInput)r   r   r   r   r   r   r    r!   r"   r#   r$   r%   s               r   4MakeInterconnectGroupsCreateMembersInterconnectInputzFInterconnectGroup.MakeInterconnectGroupsCreateMembersInterconnectInput(   sB     >>JJ/*")"&, K  r   c                 :   |D cg c]  }| j                   j                  j                  j                  || j                   j	                  | j
                  j                  d|| j                  j                        j                                      c}S c c}w )Nzcompute.interconnects)interconnectr   )r2   )keyvalue)
r   r   InterconnectsValueAdditionalPropertyInterconnectGroupInterconnectr   Creater
   r   SelfLink)r   interconnectsr2   s      r   _MakeAdditionalPropertiesz+InterconnectGroup._MakeAdditionalPropertiesE   s     * *L 	((;;NN ..>>!__33+!- HH,, 4  (* ? 	 	O 	
 *  s   BBc                 J   | j                   }| j                  j                  d|j                  | j                  |j                  |j                  |      | j                  j                         ||j
                  j                  | j                  |                        fS )a)  Make a tuple for interconnect group insert request.

    Args:
      description: String that represents the description of the Cloud
        Interconnect Group resource.
      topology_capability: String that represents the topology capability of the
        Cloud Interconnect Group resource.
      interconnects: List of strings that represent the names of the Cloud
        Interconnect resources that are members of the Cloud Interconnect Group
        resource.

    Returns:
    Insert interconnect group tuple that can be used in a request.
    InserttopologyCapabilityadditionalProperties)intentr   r   r:   r   interconnectGroup)r   r   interconnectGroups&ComputeInterconnectGroupsInsertRequestr   r   InterconnectGroupIntentr
   Namer5   r;   )r   r   topology_capabilityr:   r   s        r   _MakeCreateRequestTuplez)InterconnectGroup._MakeCreateRequestTupleV   s    ( ~~H''77LL&8877': 8  XX]]_'&88KK)-)G)G%* L  9  	8 	
 r   c                    | j                   }d|j                  j                  | j                  |            i}|j	                  |       ||j                  |      |d<   | j                  j                  d|j                  | j                  | j                  j                          |j                  di ||      fS )z2Make a tuple for interconnect group patch request.r:   r@   r>   rB   Patch)r   rD   interconnectGroupResource
updateMask )r   r   r5   r;   updaterG   r   rE   %ComputeInterconnectGroupsPatchRequestr   r
   rH   )r   rI   r:   update_maskkwargsr   group_paramss          r   _MakePatchRequestTuplez(InterconnectGroup._MakePatchRequestTuple   s     ~~H33FF!%!?!?!N G 
L
 &'??0  @  l8 	''66LL"hhmmo&@h&@&@ '' # 	7 	
 r   c                     | j                   j                  d| j                  j                  | j                  j
                  | j                  j                               fS )NDeleterC   )r   rE   r   &ComputeInterconnectGroupsDeleteRequestr
   r   rH   r   s    r   _MakeDeleteRequestTuplez)InterconnectGroup._MakeDeleteRequestTuple   sL    ''==HH$$ 	> 	
 r   c                     | j                   j                  d| j                  j                  | j                  j
                  | j                  j                               fS )NGetrC   )r   rE   r   #ComputeInterconnectGroupsGetRequestr
   r   rH   r   s    r   _MakeDescribeRequestTuplez+InterconnectGroup._MakeDescribeRequestTuple   sL    ''::HH$$ 	; 	
 r   c                     | j                   j                  d| j                  j                  | j                  j
                  | j                  j                               fS )NGetOperationalStatusrC   )r   rE   r   4ComputeInterconnectGroupsGetOperationalStatusRequestr
   r   rH   r   s    r   %_MakeGetOperationalStatusRequestTuplez7InterconnectGroup._MakeGetOperationalStatusRequestTuple   sM    ''KKHH$$ 	L 	
 r   c                    | j                   }| j                  j                  d|j                  | j                  j
                  |j                  |j                  |||            | j                  j                               fS )NCreateMembers)intentMismatchBehaviortemplateInterconnectr:   )request)r   &interconnectGroupsCreateMembersRequestrD   )	r   r   rE   -ComputeInterconnectGroupsCreateMembersRequestr
   r   &InterconnectGroupsCreateMembersRequestInterconnectGroupsCreateMembersrH   )r   intent_mismatch_behaviortemplate_interconnectmember_interconnectsr   s        r   _MakeCreateMembersRequestTuplez0InterconnectGroup._MakeCreateMembersRequestTuple   s     ~~H''>>HH$$3;3b3b @@+C)>"6 A  4c 4 #hhmmo 	? 
	
 r   c                 r    | j                  |||      g}|s | j                  j                  |      }|d   S |S )zCreate an interconnect group.r   )rJ   r   MakeRequests)r   r   rI   r:   only_generate_requestrequestsr   s          r   r8   zInterconnectGroup.Create   sL     	$$	
H !&&33H=iq\Or   c                 b    | j                         g}|s| j                  j                  |      S |S r	   )rY   r   rp   )r   rq   rr   s      r   rW   zInterconnectGroup.Delete   s2    ,,./H !!..x88Or   c                 l    | j                         g}|s | j                  j                  |      }|d   S |S Nr   )r]   r   rp   r   rq   rr   r   s       r   DescribezInterconnectGroup.Describe   s;    ..01H &&33H=iq\Or   c                 v     | j                   |||fi |g}|s | j                  j                  |      }|d   S |S )zYPatch description, topology capability and member interconnects of an interconnect group.r   )rU   r   rp   )r   rI   r:   rR   rq   rS   rr   r   s           r   rL   zInterconnectGroup.Patch   sT     	$##	
?E	
H
 !&&33H=iq\Or   c                 l    | j                         g}|s | j                  j                  |      }|d   S |S ru   )ra   r   rp   rv   s       r   r_   z&InterconnectGroup.GetOperationalStatus  s;    ::<=H &&33H=iq\Or   c                 j    | j                  |||      g}| j                  j                  |      }|d   S )z5Create member interconnects in an interconnect group.r   )rn   r   rp   )r   rk   rl   rm   rr   r   s         r   rc   zInterconnectGroup.CreateMembers  sD     	++$! 	
H $$11(;IQ<r   )NN)NNNN   NTNNNN)NNrO   F)F)NrO    F)NNrO   )__name__
__module____qualname____doc__r   propertyr   r   strintboolr0   r;   rJ   rU   rY   r]   ra   rn   r8   rW   rw   rL   r_   rc   rO   r   r   r   r      s/   .  0 0 ) )
 "## #! $  	
         :"'R82 !( !&  $ 	r   r   N)r   
__future__r   r   r   objectr   rO   r   r   <module>r      s#     '  '@ @r   