
    7                     Z    S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr   " S S\	5      r
g	)
zCAPI client library for Certificate Manager certificate map entries.    )absolute_import)division)unicode_literals)
list_pager)
api_clientc                   \    \ rS rSrSrSS jr    SS jrS r    SS jrS r	SS	 jr
S
rg)CertificateMapEntryClient   z;API client for Certificate Manager certificate map entries.Nc                     U=(       d    [         R                  " 5       U l        U R                  R                  U l        U=(       d    U R                  R
                  U l        g )N)r   GetClientInstance_client8projects_locations_certificateMaps_certificateMapEntries_serviceMESSAGES_MODULEmessages)selfclientr   s      Ilib/googlecloudsdk/api_lib/certificate_manager/certificate_map_entries.py__init__"CertificateMapEntryClient.__init__   s>    ;Z99;DLLLYYDM< < <DM    c                 h   U R                   R                  UR                  5       UU R                   R                  UUU(       d*  U R                   R                  R                  R
                  OSU Vs/ s H  owR                  5       PM     snUS9S9nU R                  R                  U5      $ s  snf )an  Creates a certificate map entry.

Args:
  parent_ref: a Resource reference to a
    certificatemanager.projects.locations.certificateMaps resource for the
    parent of this certificate map entry.
  entry_id: str, the ID of the entry to create.
  hostname: str, hostname of map entry. If None, primary entry is created.
  cert_refs: Resource references to
    certificatemanager.projects.locations.certificates resources to be
    attached to this entry.
  description: str, user-provided description.
  labels: Unified GCP Labels for the resource.

Returns:
  Operation: the long running operation to create a map entry.
N)labelshostnamematchercertificatesdescription)parentcertificateMapEntryIdcertificateMapEntry)r   TCertificatemanagerProjectsLocationsCertificateMapsCertificateMapEntriesCreateRequestRelativeNameCertificateMapEntryMatcherValueValuesEnumPRIMARYr   Create)	r   
parent_refentry_idr   	cert_refsr   r   refreqs	            r   r&    CertificateMapEntryClient.Create"   s    0 --
l
l&&(& MM==$ MM55LLW$8AB	**,	B# > 
 m 
C ==$$	 Cs   3B/c                     U R                   R                  UR                  5       S9nU R                  R	                  U5      $ )zGets certificate map entry.

Args:
  entry_ref: a Resource reference to a
    certificatemanager.projects.locations.certificateMaps.certificateMapEntries
    resource to get.

Returns:
  Certificate Map Entry API representation.
name)r   QCertificatemanagerProjectsLocationsCertificateMapsCertificateMapEntriesGetRequestr"   r   Get)r   	entry_refget_reqs      r   r1   CertificateMapEntryClient.GetH   s?     mmmm##% n 'G==W%%r   c                     U R                   R                  UR                  5       XES9n[        R                  " U R
                  UUUSSSSS9$ )a  List certificate map entries in a given certificate map.

Args:
  parent_ref: a Resource reference to a
    certificatemanager.projects.locations.certificateMaps resource to list
    entries for.
  limit: int, the total number of results to return from the API.
  page_size: int, the number of results in each batch from the API.
  list_filter: str, filter to apply in the list request.
  order_by: str, fields used for resource ordering.

Returns:
  A list of the entries in the certificate map.
)r   filterorderBy	pageTokennextPageTokencertificateMapEntriespageSize)
batch_sizelimitcurrent_token_attributenext_token_attributefieldbatch_size_attribute)r   RCertificatemanagerProjectsLocationsCertificateMapsCertificateMapEntriesListRequestr"   r   YieldFromListr   )r   r'   r=   	page_sizelist_filterorder_bylist_reqs          r   ListCertificateMapEntryClient.ListW   s\    , }}oo&&( p PH## +,%') )r   c                     U R                   R                  UR                  5       S9nU R                  R	                  U5      $ )a  Deletes certificate map entry.

Args:
  entry_ref: a Resource reference to a
    certificatemanager.projects.locations.certificateMaps.certificateMapEntries
    resource to delete.

Returns:
  Operation: the long running operation to delete certificate map entry.
r.   )r   TCertificatemanagerProjectsLocationsCertificateMapsCertificateMapEntriesDeleteRequestr"   r   Delete)r   r2   
delete_reqs      r   rL    CertificateMapEntryClient.Deletey   s?     ss##% t 'J==
++r   c                    U R                   R                  5       n/ nUb  X%l        UR                  S5        Ub  X5l        UR                  S5        UbJ  UR
                  R                  U Vs/ s H  owR                  5       PM     sn5        UR                  S5        SR                  U5      nU R                   R                  UUR                  5       US9n	U R                  R                  U	5      $ s  snf )a  Updates a certificate map entry.

Used for updating labels, description and attached certificates.

Args:
  entry_ref: a Resource reference to a
    certificatemanager.projects.locations.certificateMaps.certificateMapEntries
    resource.
  labels: unified GCP Labels for the resource.
  description: str, new description
  cert_refs: Resource references to
    certificatemanager.projects.locations.certificates resources to be
    attached to this entry.

Returns:
  Operation: the long running operation to patch certificate map entry.
r   r   r   ,)r    r/   
updateMask)r   r#   r   appendr   r   extendr"   joinSCertificatemanagerProjectsLocationsCertificateMapsCertificateMapEntriesPatchRequestr   Patch)
r   r2   r   r   r)   certificate_map_entryupdated_fieldsr*   update_mask	patch_reqs
             r   rV   CertificateMapEntryClient.Patch   s    $ !MM==?N%+"H%*5'M*((//)2
3#
35N+((>*Kqq1##% r  I ==y)) 4s   -C3)r   r   r   )NN)NNNN)NNN)__name__
__module____qualname____firstlineno____doc__r   r&   r1   rH   rL   rV   __static_attributes__ r   r   r	   r	      sA    C= $%L&$  )D,$*r   r	   N)r`   
__future__r   r   r   apitools.base.pyr   *googlecloudsdk.api_lib.certificate_managerr   objectr	   rb   r   r   <module>rg      s(    J &  ' ' AR* R*r   