
    >                     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	)
z<API client library for Certificate Manager certificate maps.    )absolute_import)division)unicode_literals)
list_pager)
api_clientc                   T    \ 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)CertificateMapClient   z4API client for Certificate Manager certificate maps.Nc                     U=(       d    [         R                  " 5       U l        U R                  R                  U l        U=(       d    U R                  R
                  U l        g )N)r   GetClientInstance_client"projects_locations_certificateMaps_serviceMESSAGES_MODULEmessages)selfclientr   s      Blib/googlecloudsdk/api_lib/certificate_manager/certificate_maps.py__init__CertificateMapClient.__init__   s>    ;Z99;DLLLCCDM< < <DM    c           
          U R                   R                  UR                  5       UU R                   R                  UUUS9S9nU R                  R                  U5      $ )a  Creates a certificate map.

Args:
  parent_ref: a Resource reference to a
    certificatemanager.projects.locations resource for the parent of this
    certificate map.
  map_id: str, the ID of the map to create.
  description: str, user-provided description.
  labels: Unified GCP Labels for the resource.
  tags: Unified GCP Tags for the resource.

Returns:
  Operation: the long running operation to create a map.
)labelsdescriptiontags)parentcertificateMapIdcertificateMap)r   ?CertificatemanagerProjectsLocationsCertificateMapsCreateRequestRelativeNameCertificateMapr   Create)r   
parent_refmap_idr   r   r   reqs          r   r"   CertificateMapClient.Create"   sd     --
W
W&&(}}33# 4 
 X C ==$$r   c                     U R                   R                  UR                  5       S9nU R                  R	                  U5      $ )zGets certificate map.

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

Returns:
  Certificate Map API representation.
name)r   <CertificatemanagerProjectsLocationsCertificateMapsGetRequestr    r   Get)r   map_refget_reqs      r   r+   CertificateMapClient.Get<   s?     mmXX!!# Y %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 maps in a given project and location.

Args:
  parent_ref: a Resource reference to a
    certificatemanager.projects.locations resource to list maps 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 certificate maps in the project.
)r   filterorderBy	pageTokennextPageTokencertificateMapspageSize)
batch_sizelimitcurrent_token_attributenext_token_attributefieldbatch_size_attribute)r   =CertificatemanagerProjectsLocationsCertificateMapsListRequestr    r   YieldFromListr   )r   r#   r7   	page_sizelist_filterorder_bylist_reqs          r   ListCertificateMapClient.ListJ   s\    * }}ZZ&&( [ PH## +,') )r   c                     U R                   R                  UR                  5       S9nU R                  R	                  U5      $ )zDeletes certificate map.

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

Returns:
  Operation: the long running operation to delete certificate map.
r(   )r   ?CertificatemanagerProjectsLocationsCertificateMapsDeleteRequestr    r   Delete)r   r,   
delete_reqs      r   rF   CertificateMapClient.Deletek   s?     ^^!!# _ %J==
++r   c                 \   U R                   R                  5       n/ nU(       a  X$l        UR                  S5        U(       a  X4l        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      $ )aU  Updates a certificate map.

Used for updating labels and description.

Args:
  map_ref: a Resource reference to a
    certificatemanager.projects.locations.certificateMaps resource.
  labels: unified GCP Labels for the resource.
  description: str, new description

Returns:
  Operation: the long running operation to patch certificate map.
r   r   ,)r   r)   
updateMask)
r   r!   r   appendr   join>CertificatemanagerProjectsLocationsCertificateMapsPatchRequestr    r   Patch)r   r,   r   r   certificate_mapupdated_fieldsupdate_mask	patch_reqs           r   rO   CertificateMapClient.Patchz   s     mm224ON%H%$/!M*((>*K\\&!!# ]  I ==y))r   )r   r   r   )NN) NN)NNNN)__name__
__module____qualname____firstlineno____doc__r   r"   r+   rB   rF   rO   __static_attributes__ r   r   r	   r	      s2    <=
%4&" )B,*r   r	   N)rZ   
__future__r   r   r   apitools.base.pyr   *googlecloudsdk.api_lib.certificate_managerr   objectr	   r\   r   r   <module>ra      s(    C &  ' ' A|*6 |*r   