
    	                     8   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"                  e	j                  j$                         G d	 d
e	j&                               Zy)z(Update public advertised prefix command.    )absolute_import)division)unicode_literals)base_classes)public_advertised_prefixes)base)flagsc                   &    e Zd ZdZed        Zd Zy)UpdateaG  Updates a Compute Engine public advertised prefix.

  ## EXAMPLES

  To update a public advertised prefix:

    $ {command} my-pap --status=ptr-configured

  To announce a public advertised prefix:

    $ {command} my-pap --announce-prefix

  To withdraw a public advertised prefix:

    $ {command} my-pap --withdraw-prefix
  c                     t        j                         j                  |       |j                  d      }t        j                  |       y )NT)required)r	   MakePublicAdvertisedPrefixesArgAddArgumentadd_mutually_exclusive_groupAddUpdatePapArgsToParser)clsparserannounce_withdraw_parsers      8lib/surface/compute/public_advertised_prefixes/update.pyArgszUpdate.Args1   sB    	))+77?%BB  C  	""#;<    c                     t        j                  | j                               }|j                  }|j                  j                  }|j
                  }t        j                         j                  ||t        j                  |j                              }t        j                  |||      }|j                  |j                  ||j                        S |j                  r|j!                  |      S |j"                  r|j%                  |      S y )N)scope_lister)status)r   ComputeApiHolderReleaseTrackclientmessages	resourcesr	   r   ResolveAsResourcecompute_flagsGetDefaultScopeListerr   PublicAdvertisedPrefixesClientr   Patchannounce_prefixAnnouncewithdraw_prefixWithdraw)selfargsholderr   r   r   pap_ref
pap_clients           r   Runz
Update.Run8   s    **4+<+<+>?F]]F}}%%H  I335GG"88G H IG
 ,JJ)%J {{gdkk::  ))  )) r   N)__name__
__module____qualname____doc__classmethodr   r.    r   r   r   r      s     " = =*r   r   N)r2   
__future__r   r   r   googlecloudsdk.api_lib.computer   r   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer	   r!   =googlecloudsdk.command_lib.compute.public_advertised_prefixesReleaseTracksr   ALPHABETAGAUpdateCommandr   r4   r   r   <module>r?      s{    / &  ' 7 E ( E O T..33T5F5F5I5I,*T ,*,*r   