
    u
                     R    S r SSKJr  SSKJr  SSKJr  SSKJr  Sr " S S\5      r	g	)
z5Support library to handle the automation subcommands.    )absolute_import)division)unicode_literals)client_utilz*,labelsc                   4    \ rS rSrSrS	S jrS rS rS rSr	g)
AutomationsClient   z6Client for automation 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 an automation.AutomationsClient.

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messages0projects_locations_deliveryPipelines_automations_service)selfr   r   s      4lib/googlecloudsdk/api_lib/clouddeploy/automation.py__init__AutomationsClient.__init__   sA     ;K99;DKE = =f EDMKKPPDM    c           	          U R                   R                  U R                  R                  USUR                  [
        S95      $ )zPatches a target resource.

Args:
  obj: apitools.base.protorpclite.messages.Message, automation message.

Returns:
  The operation message.
T)
automationallowMissingname
updateMask)r   Patchr   DClouddeployProjectsLocationsDeliveryPipelinesAutomationsPatchRequestr   AUTOMATION_UPDATE_MASK)r   objs     r   r   AutomationsClient.Patch(   sC     ==ZZ-	 	[ 	
 r   c                 j    U R                   R                  US9nU R                  R                  U5      $ )zGets the automation object by calling the automation get API.

Args:
  name: automation name.

Returns:
  an automation object.
)r   )r   BClouddeployProjectsLocationsDeliveryPipelinesAutomationsGetRequestr   Get)r   r   requests      r   r"   AutomationsClient.Get:   s8     mm^^ _ G ==W%%r   c                 h    U R                   R                  U R                  R                  SUS95      $ )zDeletes an automation resource.

Args:
  name: str, automation name.

Returns:
  The operation message. It could be none if the resource doesn't exist.
T)r   r   )r   Deleter   EClouddeployProjectsLocationsDeliveryPipelinesAutomationsDeleteRequest)r   r   s     r   r&   AutomationsClient.DeleteH   s8     ==[[D 	\ 	
 r   )r   r   r   )NN)
__name__
__module____qualname____firstlineno____doc__r   r   r"   r&   __static_attributes__ r   r   r   r      s    >	Q$&r   r   N)
r-   
__future__r   r   r   "googlecloudsdk.api_lib.clouddeployr   r   objectr   r/   r   r   <module>r3      s(    < &  ' :# ; ;r   