
                            d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddl	mZ dd	lmZ  ej                  ej                  j                   ej                  j"                         G d
 dej$                               Zy)zBCommand to update an archive deployment in an Apigee organization.    )absolute_import)division)unicode_literals)apigee)base)defaults)resource_args)labels_utilc                   0    e Zd ZdZdddZed        Zd Zy)Updatez-Update an existing Apigee archive deployment.zD  {description}

  `{command}` updates an Apigee archive deployment.am    To update the ``tag'' and ``rev'' labels of an archive deployment with the id
  ``abcdef01234'' in the Apigee environment called ``my-env'' using the active
  Cloud Platform project, run:

      $ {command} abcdef01234 --environment=my-env --update-labels=tag=my-tag,rev=1234

  To remove the ``dev'' label on an archive deployment with the id
  ``uvwxyz56789'', in the Apigee environment called ``my-env'', in an
  organization called ``my-org'', run:

      $ {command} uvwxyz56789 --environment=my-env --organization=my-org --remove-labels=dev

  To clear all labels on an archive deployment with the id ``mnop4321'', in
  the Apigee environment called ``my-env'', in an organization called
  ``my-org'', and return the updated archive deployment as a JSON object, run:

      $ {command} mnop4321 --environment=my-env --organization=my-org --clear-labels --format=json
  )DESCRIPTIONEXAMPLESc           
          t        j                  | dddddt        j                         g       t	        j
                  |        y )Nz+organization.environment.archive_deploymentziArchive deployment to update. To get a list of existing archive deployments, run `{parent_command} list`.archive_deploymentT)	help_textargument_name
positionalrequiredfallthroughs)r	   AddSingleResourceArgumentr   !GCPProductOrganizationFallthroughr
   AddUpdateLabelsFlags)parsers    %lib/surface/apigee/archives/update.pyArgszUpdate.Args?   sE    ++5E*@@BCE $$V,    c                    t        j                  |       |j                  j                  j	                         j                         }t        j                  j                  |      }d|v r|j                  s|d   }ni }|j                  r|j                  |j                         |j                  r|j                  D ]
  }||v s||=  d|i}t        j                  j                  ||      S )zRun the update command.labels)r
   GetAndValidateOpsFromArgsCONCEPTSr   ParseAsDictr   ArchivesClientDescribeclear_labelsupdate_labelsupdateremove_labelsr   )selfargsidentifiersexisting_archive
new_labelslabellabels_protos          r   Runz
Update.RunM   s    ))$/--2288:AACK,,55kB##D,=,=#H-jj**+%%%J & j)L  ''\BBr   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r0    r   r   r   r      s0    57
-8 - -Cr   r   N)r4   
__future__r   r   r   googlecloudsdk.api_libr   googlecloudsdk.callioper   !googlecloudsdk.command_lib.apigeer   r	   $googlecloudsdk.command_lib.util.argsr
   ReleaseTracksReleaseTrackALPHABETADescribeCommandr   r7   r   r   <module>rB      so    I &  ' ) ( 6 ; < D%%++T->->-C-CD?CT!! ?C E?Cr   