
                         N    d 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      Zy)	z9Support library to handle the automation run subcommands.    )absolute_import)division)unicode_literals)client_utilc                       e Zd ZdZddZd Zy)AutomationRunsClientz:Client for automation run service in the Cloud Deploy API.Nc                     |xs t        j                         | _        |xs t        j                  |      | _        | j                  j
                  | _        y)zInitialize an automation_run.AutomationRunsClient.

    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messages3projects_locations_deliveryPipelines_automationRuns_service)selfr   r   s      8lib/googlecloudsdk/api_lib/clouddeploy/automation_run.py__init__zAutomationRunsClient.__init__   sD     ;K99;DKE = =f EDMGG 	M    c                 p    | j                   j                  |      }| j                  j                  |      S )a	  Cancels an automation run.

    Args:
      name: Name of the AutomationRun. Format is
        projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/automationRuns/{automationRun}.

    Returns:
      CancelAutomationRunResponse message.
    )name)r   HClouddeployProjectsLocationsDeliveryPipelinesAutomationRunsCancelRequestr   Cancel)r   r   requests      r   r   zAutomationRunsClient.Cancel(   s8     mmdd e G ==((r   )NN)__name__
__module____qualname____doc__r   r    r   r   r   r      s    B)r   r   N)	r   
__future__r   r   r   "googlecloudsdk.api_lib.clouddeployr   objectr   r   r   r   <module>r!      s#    @ &  ' :)6 )r   