
    
                         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  G d	 d
ej                        Zy)z$service-management undelete command.    )absolute_import)division)unicode_literals)services_util)base)arg_parsers)common_flagsc                   &    e Zd ZdZed        Zd Zy)UndeleteaV  Undeletes a service configuration that was previously deleted.

     Services that are deleted will be retained in the system for 30 days.
     If a deleted service is still within this retention window, it can be
     undeleted with this command.

     Note that this means that this command will not be effective for
     service configurations marked for deletion more than 30 days ago.

     ## EXAMPLES
     To undelete a service named `my-service`, run:

       $ {command} my-service

     To run the same command asynchronously (non-blocking), run:

       $ {command} my-service --async
  c                     t        j                  d      j                  |        t        j                  j                  |        y)zArgs is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go
          on the command line after this command. Positional arguments are
          allowed.
    zto undelete)suffixN)r	   producer_service_flagAddToParserr   
ASYNC_FLAG)parsers    *lib/surface/endpoints/services/undelete.pyArgszUndelete.Args1   s/     &&m<HHPOO'    c                 *   t        j                         }t        j                         }t        j                  |j
                        }|j                  |      }|j                  j                  |      }t        j                  ||j                        S )zRun 'service-management undelete'.

    Args:
      args: argparse.Namespace, The arguments that this command was invoked
          with.

    Returns:
      The response from the Undelete API call (or None if cancelled).
    )serviceName)r   GetMessagesModuleGetClientInstancer   GetServiceNameFromArgservice(ServicemanagementServicesUndeleteRequestservicesr   ProcessOperationResultasync_)selfargsmessagesclientr   request	operations          r   RunzUndelete.Run>   sz     ..0H,,.F//=G?? @ G ((1I//	4;;GGr   N)__name__
__module____qualname____doc__staticmethodr   r%    r   r   r   r      s!    ( 
( 
(Hr   r   N)r)   
__future__r   r   r    googlecloudsdk.api_lib.endpointsr   googlecloudsdk.callioper   $googlecloudsdk.command_lib.endpointsr   r	   Commandr   r+   r   r   <module>r1      s1    + &  ' : ( < =7Ht|| 7Hr   