
                         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<Support library to handle the delivery-pipeline subcommands.    )absolute_import)division)unicode_literals)
list_pager)client_utilc                   :    \ rS rSrSrS	S jrS r S
S jrS rSr	g)DeliveryPipelinesClient   z=Client for delivery pipeline service in the Cloud Deploy API.Nc                     U=(       d    [         R                  " 5       U l        U=(       d    [         R                  " U5      U l        U R                  R
                  U l        g)zInitialize a delivery_pipeline.DeliveryPipelinesClient.

Args:
  client: base_api.BaseApiClient, the client class for Cloud Deploy.
  messages: module containing the definitions of messages for Cloud Deploy.
N)r   GetClientInstanceclientGetMessagesModulemessages$projects_locations_deliveryPipelines_service)selfr   r   s      ;lib/googlecloudsdk/api_lib/clouddeploy/delivery_pipeline.py__init__ DeliveryPipelinesClient.__init__   sA     ;K99;DKE = =f EDMKKDDDM    c                 j    U R                   R                  US9nU R                  R                  U5      $ )zGets the delivery pipeline object by calling the delivery pipeline get API.

Args:
  name: delivery pipeline name.

Returns:
  a delivery pipeline object.
)name)r   7ClouddeployProjectsLocationsDeliveryPipelinesGetRequestr   Get)r   r   requests      r   r   DeliveryPipelinesClient.Get(   s;     	MM 	N 	
 
 ==W%%r   c           	      |    U R                   R                  XUS9n[        R                  " U R                  USUUSS9$ )a  Lists Delivery Pipeline resources that belong to a location.

Args:
  location: str, the full name of the location which owns the Delivery
    Pipelines.
  filter_str: optional[str], list filter.
  order_by: optional[str], field to sort by.
  page_size: optional[int], the maximum number of `DeliveryPipeline` objects
    to return.
  limit: int, The maximum number of records to yield. None if all available
    records should be yielded.

Returns:
  Delivery Pipeline list response.
)parentfilterorderBydeliveryPipelinespageSize)field
batch_sizelimitbatch_size_attribute)r   8ClouddeployProjectsLocationsDeliveryPipelinesListRequestr   YieldFromListr   )r   location
filter_strorder_by	page_sizer%   list_reqs          r   ListDeliveryPipelinesClient.List8   sQ    & 	NN 	O 	
 
 ##!' r   c                 l    U R                   R                  UUS9nU R                  R                  U5      $ )zCreates a rollback for a given target.

Args:
  name: pipeline name
  request: RollbackTargetRequest

Returns:
  RollbackTargetResponse
)r   rollbackTargetRequest)r   BClouddeployProjectsLocationsDeliveryPipelinesRollbackTargetRequestr   RollbackTarget)r   r   r   msgs       r   r3   &DeliveryPipelinesClient.RollbackTargetX   s;     --
Z
Z% [ C =='',,r   )r   r   r   )NN)NNr   N)
__name__
__module____qualname____firstlineno____doc__r   r   r.   r3   __static_attributes__ r   r   r	   r	      s"    E	E&" JN@-r   r	   N)r:   
__future__r   r   r   apitools.base.pyr   "googlecloudsdk.api_lib.clouddeployr   objectr	   r<   r   r   <module>rA      s(    C &  ' ' :L-f L-r   