
                         B    S r SSKJr  SSKJr  SSKJr  SrS r	S r
S rg	)
z3Utilities for the cloud deploy automation resource.    )
automation)
exceptions)	resourcesz<clouddeploy.projects.locations.deliveryPipelines.automationsc           	           U R                  S5      u  p4[        R
                  R                  S[        UUUUS.S9$ ! [         a    [        R                  " U 5      ef = f)a  Creates the automation reference base on the parameters.

Returns the reference of the automation name.

Args:
  automation_name: str, in the format of pipeline_id/automation_id.
  project: str,project number or ID.
  location_id: str, region ID.

Returns:
  Automation name reference.
/N)
projectsIdlocationsIddeliveryPipelinesIdautomationsId)
collectionparams)split
ValueErrorcd_exceptionsAutomationNameFormatErrorr   REGISTRYParse_AUTOMATION_COLLECTION)automation_nameprojectlocation_idpipeline_idautomation_ids        8lib/googlecloudsdk/command_lib/deploy/automation_util.pyAutomationReferencer      sv    C!0!6!6s!;K 
			!	!
'$!,(	 
" 	
 	 
 C

1
1/
BBCs	   = !Ac                 J    [         R                  " 5       R                  U 5      $ )zPatches an automation resource by calling the patch automation API.

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

Returns:
    The operation message.
)r   AutomationsClientPatch)resources    r   PatchAutomationr    9   s     
	%	%	'	-	-h	77    c                 J    [         R                  " 5       R                  U 5      $ )zDeletes an automation resource by calling the delete automation API.

Args:
  name: str, automation name.

Returns:
  The operation message.
)r   r   Delete)names    r   DeleteAutomationr%   E   s     
	%	%	'	.	.t	44r!   N)__doc__"googlecloudsdk.api_lib.clouddeployr   !googlecloudsdk.command_lib.deployr   r   googlecloudsdk.corer   r   r   r    r%    r!   r   <module>r+      s/    : : I ) C 
<	8	5r!   