
    /                     z    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
  G d d	ej                        Zy
)z#Cloud vmware LoggingServers client.    )absolute_import)division)unicode_literals)
list_pager)util)	arg_utilsc                   P     e Zd ZdZ fdZd Zd Zd Zd Z	 d
dZ	d Z
d	 Z xZS )LoggingServersClientz#Cloud VMware LoggingServers client.c                 `    t         t        |           | j                  j                  | _        y )N)superr
   __init__client/projects_locations_privateClouds_loggingServersservice)self	__class__s    3lib/googlecloudsdk/api_lib/vmware/loggingservers.pyr   zLoggingServersClient.__init__   s"    	
.0;;NNDL    c                     | j                   j                  |j                               }| j                  j	                  |      S N)name)messagesBVmwareengineProjectsLocationsPrivateCloudsLoggingServersGetRequestRelativeNamer   Getr   resourcerequests      r   r   zLoggingServersClient.Get!   s?    mm^^""$ _ G <<G$$r   c                 j   |j                         j                         }| j                  j                  |      }| j	                  |      |_        | j                  |      |_        ||_        | j                  j                  |||j                               }| j                  j                  |      S )N)hostname)parentloggingServerloggingServerId)Parentr   r   LoggingServerGetSourceType
sourceTypeGetProtocolprotocolportEVmwareengineProjectsLocationsPrivateCloudsLoggingServersCreateRequestNamer   Create)	r   r   r    source_typer)   r*   r!   logging_serverr   s	            r   r-   zLoggingServersClient.Create'   s    __++-F]]00(0CN $ 2 2; ?N"..x8NNmmaa$  b G <<w''r   c                     | j                   j                  |j                               }| j                  j	                  |      S r   )r   EVmwareengineProjectsLocationsPrivateCloudsLoggingServersDeleteRequestr   r   Deleter   s      r   r2   zLoggingServersClient.Delete5   s?    mmaa""$ b G <<w''r   c                     |j                         }| j                  j                  |      }t        j                  | j
                  |dd      S )N)r!   pageSizeloggingServers)batch_size_attributefield)r   r   CVmwareengineProjectsLocationsPrivateCloudsLoggingServersListRequestr   YieldFromListr   )r   private_cloud_resourceprivate_cloudr   s       r   ListzLoggingServersClient.List;   sR    *779Mmm__ ` G ##'	 r   c                    | j                  |      }g }|||_        |j                  d       |'| j                  |      |_        |j                  d       |'| j                  |      |_        |j                  d       |||_        |j                  d       | j                  j                  ||j                         dj                  |            }| j                  j                  |      S )Nr    r.   r)   r*   ,)r"   r   
updateMask)r   r    appendr&   r'   r(   r)   r*   r   DVmwareengineProjectsLocationsPrivateCloudsLoggingServersPatchRequestr   joinr   Patch)	r   r   r    r.   r)   r*   r/   update_maskr   s	            r   UpdatezLoggingServersClient.UpdateG   s     XXh'NK (n$"&"4"4["An' $ 0 0 :n$ n mm``$""$88K( a G
 <<g&&r   c                     t        j                  d| j                  j                  j                  d       j                  t        j                  |            }|S )Nr.   c                 
    d| vS )NSOURCE_TYPE_UNSPECIFIED xs    r   <lambda>z4LoggingServersClient.GetSourceType.<locals>.<lambda>c   s
    !:!!Cr   arg_namemessage_enuminclude_filter)r   ChoiceEnumMapperr   r%   SourceTypeValueValuesEnumGetEnumForChoiceEnumNameToChoice)r   r.   source_type_enums      r   r&   z"LoggingServersClient.GetSourceType_   sN     11]]00JJC y11+>?	 
 r   c                     t        j                  d| j                  j                  j                  d       j                  t        j                  |            }|S )Nr)   c                 
    d| vS )NPROTOCOL_UNSPECIFIEDrI   rJ   s    r   rL   z2LoggingServersClient.GetProtocol.<locals>.<lambda>k   s
    !7q!@r   rM   )r   rQ   r   r%   ProtocolValueValuesEnumrS   rT   )r   r)   protocol_enums      r   r(   z LoggingServersClient.GetProtocolg   sN    ..]]00HH@ y11(;<	 
 r   )NNNN)__name__
__module____qualname____doc__r   r   r-   r2   r<   rE   r&   r(   __classcell__)r   s   @r   r
   r
      s6    +O%((
 LP'0r   r
   N)r^   
__future__r   r   r   apitools.base.pyr   googlecloudsdk.api_lib.vmwarer   $googlecloudsdk.command_lib.util.apisr   VmwareClientBaser
   rI   r   r   <module>re      s0    * &  ' ' . :S400 Sr   