
                         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 Attachment Group.    )absolute_import)division)unicode_literalsc                       e Zd ZdZddZed        Ze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y)InterconnectAttachmentGroupz1Abstracts Interconnect Attachment Group resource.Nc                 <    || _         || _        || _        || _        y N)refproject_compute_client
_resources)selfr
   r   compute_client	resourcess        Mlib/googlecloudsdk/api_lib/compute/interconnects/attachments/groups/client.py__init__z$InterconnectAttachmentGroup.__init__   s    DHDL)DDO    c                 .    | j                   j                  S r	   )r   apitools_clientr   s    r   _clientz#InterconnectAttachmentGroup._client    s    ///r   c                 .    | j                   j                  S r	   )r   messagesr   s    r   	_messagesz%InterconnectAttachmentGroup._messages$   s    (((r   c                 R   |D cg c]  \  }}| j                   j                  j                  j                  | d| | j                   j	                  | j
                  j                  d|| j                  j                  |      j                                      c}}S c c}}w )N/zcompute.interconnectAttachments)interconnectAttachmentr   region)
attachment)keyvalue)
r   r   AttachmentsValueAdditionalProperty%InterconnectAttachmentGroupAttachmentr   Creater
   r   SelfLink)r   attachmentsr   r   s       r   _MakeAdditionalPropertiesz5InterconnectAttachmentGroup._MakeAdditionalProperties(   s     #. #.FJ 	22CCVV (!J<(..FF??115+5 HH,,!	 2 
 (* G 	 	W 	
 #.  s   BB#c                 J   | j                   }| j                  j                  d|j                  | j                  |j                  |j                  |      | j                  j                         ||j
                  j                  | j                  |                        fS )ac  Make a tuple for interconnect attachment group insert request.

    Args:
      description: String that represents the description of the Cloud
        Interconnect Attachment Group resource.
      availability_sla: String that represents the availability SLA of the Cloud
        Interconnect Attachment Group resource.
      attachments: List of strings that represent the names of the Cloud
        Interconnect Attachment resources that are members of the Cloud
        Interconnect Attachment Group resource.

    Returns:
    Insert interconnect attachment group tuple that can be used in a request.
    InsertavailabilitySlaadditionalProperties)intentnamedescriptionr'   r   interconnectAttachmentGroup)r   r   interconnectAttachmentGroups0ComputeInterconnectAttachmentGroupsInsertRequestr   r   !InterconnectAttachmentGroupIntentr
   Namer"   r(   )r   r1   availability_slar'   r   s        r   _MakeCreateRequestTuplez3InterconnectAttachmentGroup._MakeCreateRequestTuple:   s    ( ~~H11AALL(0(L(LAA$4 B  XX]]_'$@@QQ)-)G)G#* R  )M ) 	B 	
 r   c                 l   | j                   }d|j                  j                  | j                  |            i}|||d<   ||j	                  |      |d<   | j
                  j                  d|j                  | j                  | j                  j                          |j                  di ||      fS )	z=Make a tuple for interconnect attachment group patch request.r'   r-   r1   r+   r/   Patch)r   r3   #interconnectAttachmentGroupResource
updateMask )r   r   r"   r(   r6   r   r4   /ComputeInterconnectAttachmentGroupsPatchRequestr   r
   r7   )r   r1   r8   r'   update_maskr   group_paramss          r   _MakePatchRequestTuplez2InterconnectAttachmentGroup._MakePatchRequestTuplec   s     ~~Hx;;LL!%!?!?!L M 
L
 $/l=!#'II*  J  l8 	11@@LL(,0T0T0T 11 # 	A 	
 r   c                     | j                   j                  d| j                  j                  | j                  j
                  | j                  j                               fS )NDeleter2   )r   r4   r   0ComputeInterconnectAttachmentGroupsDeleteRequestr
   r   r7   r   s    r   _MakeDeleteRequestTuplez3InterconnectAttachmentGroup._MakeDeleteRequestTuple   sN    11GGHH$$(, 	H 	
 r   c                     | j                   j                  d| j                  j                  | j                  j
                  | j                  j                               fS )NGetr2   )r   r4   r   -ComputeInterconnectAttachmentGroupsGetRequestr
   r   r7   r   s    r   _MakeDescribeRequestTuplez5InterconnectAttachmentGroup._MakeDescribeRequestTuple   sN    11DDHH$$(, 	E 	
 r   c                     | j                   j                  d| j                  j                  | j                  j
                  | j                  j                               fS )NGetOperationalStatusr2   )r   r4   r   >ComputeInterconnectAttachmentGroupsGetOperationalStatusRequestr
   r   r7   r   s    r   %_MakeGetOperationalStatusRequestTuplezAInterconnectAttachmentGroup._MakeGetOperationalStatusRequestTuple   sN    11UUHH$$(, 	V 	
 r   c                 r    | j                  |||      g}|s | j                  j                  |      }|d   S |S )z(Create an interconnect attachment group.r   )r9   r   MakeRequests)r   r1   r8   r'   only_generate_requestrequestsr   s          r   r%   z"InterconnectAttachmentGroup.Create   sL     	$$	
H !&&33H=iq\Or   c                 t    | j                  ||||      g}|s | j                  j                  |      }|d   S |S )z'Patch an interconnect attachment group.r   )rB   r   rP   )r   r1   r8   r'   r@   rQ   rR   r   s           r   r;   z!InterconnectAttachmentGroup.Patch   sM     	##);	
H
 !&&33H=iq\Or   c                 b    | j                         g}|s| j                  j                  |      S |S r	   )rF   r   rP   )r   rQ   rR   s      r   rD   z"InterconnectAttachmentGroup.Delete   s2    ,,./H !!..x88Or   c                 l    | j                         g}|s | j                  j                  |      }|d   S |S Nr   )rJ   r   rP   r   rQ   rR   r   s       r   Describez$InterconnectAttachmentGroup.Describe   s;    ..01H &&33H=iq\Or   c                 l    | j                         g}|s | j                  j                  |      }|d   S |S rV   )rN   r   rP   rW   s       r   rL   z0InterconnectAttachmentGroup.GetOperationalStatus   s;    ::<=H &&33H=iq\Or   )NN)NNr>   F)NNr>    F)F)__name__
__module____qualname____doc__r   propertyr   r   r(   r9   rB   rF   rJ   rN   r%   r;   rD   rX   rL   r>   r   r   r   r      s    9  0 0 ) )$'R: !, !&r   r   N)r^   
__future__r   r   r   objectr   r>   r   r   <module>rb      s#    % '  '@& @r   