
    
                         S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJ	r	  SSK
Jr  SSKJr  SSKJr  SS	KJr  SS
KJr   " S S\R$                  5      rg)z.Cloud Pub/Sub schemas delete revision command.    )absolute_import)division)unicode_literals)
exceptions)schemas)base)resource_args)util)logc                   6    \ rS rSrSrSS0r\S 5       rS rSr	g)	DeleteRevision   z!Delete a Pub/Sub schema revision.EXAMPLESz          To roll back to an existing schema revision called "key-schema" with revision_id: "0a0b0c0d", run:
                    
$ {command} key-schema@0a0b0c0d
          c                 2    [         R                  " U S5        g )Nzrevision to delete.)r	   AddSchemaResourceArg)parsers    -lib/surface/pubsub/schemas/delete_revision.pyArgsDeleteRevision.Args*   s     &&v/DE    c                    [         R                  " 5       n[        R                  " UR                  5      n UR                  US9n[        R                  " UR                  SS9  U$ ! [        R                   a^  n[        R                  " U5      n[        R                  " US[        R                  " UR                  R                  5      S9   SnAgSnAff = f)a  This is what gets called when the user runs this command.

Args:
  args: an argparse namespace. All the arguments that were provided to this
    command invocation.

Returns:
  A serialized object (dict) describing the results of the operation.
  This description fits the Resource described in the ResourceRegistry under
  'pubsub.projects.schemas'.

Raises:
  util.RequestFailedError: if any of the requests to the API failed.
)
schema_refzschema revision)kindfailedN)r   )r   SchemasClientr
   ParseSchemaNameschemar   api_ex	HttpErrorr   HttpExceptionr   DeletedResourceCreateFailureErrorMessagepayloadstatus_messagename)selfargsclientr   resulterrorexcs          r   RunDeleteRevision.Run/   s     ""$F%%dkk2J	$$
$;f *;<M  $$U+c	
 //0J0JK
 s   A' 'C;ACC N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   r,   __static_attributes__r.   r   r   r   r      s1    )  - F Fr   r   N)r3   
__future__r   r   r   apitools.base.pyr   r   googlecloudsdk.api_lib.pubsubr   googlecloudsdk.api_lib.utilgooglecloudsdk.callioper   !googlecloudsdk.command_lib.pubsubr	   r
   googlecloudsdk.corer   Commandr   r.   r   r   <module>r?      s8    5 &  ' 1 1 2 ( ; 2 #-T\\ -r   