
                         D   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  \R&                  \R(                  " \R*                  R,                  \R*                  R.                  5       " S S\R0                  5      5       5       rg)z*Initialize a Backup and DR Service Config.    )absolute_import)division)unicode_literals)
exceptions)util)ServiceConfigClient)base)flags)logc                   <    \ rS rSrSrSSSSS.r\S 5       rS	 rS
r	g)Init   z1Initialize a Backup and DR Service configuration.z2Initializes a Backup and DR Service configuration.z{description}zThis command uses the backupdr/v1 API. The full documentation for this API can be found at: https://cloud.google.com/backup-disaster-recoverya           To initialize a new service configuration in location ``MY_LOCATION''
        and project ``MY_PROJECT'' for resource type ``MY_RESOURCE_TYPE'', run:

        $ {command} --project=MY_PROJECT             --location=MY_LOCATION             --resource-type=MY_RESOURCE_TYPE
        )BRIEFDESCRIPTIONzAPI REFERENCEEXAMPLESc                     [         R                  " U 5        [         R                  " U S5        [         R                  " U S5        g)zmSpecifies additional command flags.

Args:
  parser: argparse.Parser: Parser object for command line inputs.
zCThe location for which the service configuration should be created.zThe resource type to which the default service configuration
           will be applied. Examples include, "compute.<UNIVERSE_DOMAIN>.com/Instance"
N)r
   AddNoAsyncFlagAddLocationResourceArgAddResourceType)parsers    ,lib/surface/backup_dr/service_config/init.pyArgs	Init.Args5   s>     
 	  Q 
	    c           
      z   [        5       nUR                  R                  R                  5       R	                  5       nUR
                  nUR                  n UR                  UU5      nU(       aK  UR                  UR                  U5      SR!                  XC5      SS9n["        R$                  " SUSSSSSS9  U$ ["        R$                  " SUSS	[        R&                  R!                  UR(                  5      SS
9  U$ ! [        R                   a*  n[        R                  " U[        R                  5      eSnAff = f)zConstructs and sends request.

Args:
  args: argparse.Namespace, An object that contains the values for the
    arguments specified in the .Args() method.

Returns:
  ProcessHttpResponse of the request made.
NzxInitializing service configuration for resource type [{}] in location [{}]. (This operation could take up to 2 minutes.)F)operation_refmessage
has_resultz'Initialization of service configurationlocationz%Service configuration initialized for)kindis_asyncdetailsfailedoperation_past_tenseT)r    r!   r"   r#   )r   CONCEPTSr   ParseRelativeNameresource_typeno_asyncr   apitools_exceptions	HttpErrorr   HttpExceptionr   HTTP_ERROR_FORMATWaitForOperationGetOperationRefformatr   _PrintResourceChangeASYNC_OPERATION_MESSAGEname)	selfargsclientr   r(   r)   	operationeresources	            r   RunInit.RunH   s5    !"F}}%%++-::<H&&M}}H@++

i ((..y9Mvm. ) h 

3
F o 1,,33INNC K (( @$$Q(>(>??@s   C< <D:%D55D: N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   r:   __static_attributes__r<   r   r   r   r      s:     : D$?-$  $9r   r   N)rA   
__future__r   r   r   apitools.base.pyr   r*   googlecloudsdk.api_lib.backupdrr   .googlecloudsdk.api_lib.backupdr.service_configr   googlecloudsdk.api_lib.utilgooglecloudsdk.callioper	   #googlecloudsdk.command_lib.backupdrr
   googlecloudsdk.corer   DefaultUniverseOnlyReleaseTracksReleaseTrackALPHAGACommandr   r<   r   r   <module>rS      s~    1 &  ' > 0 N 2 ( 5 # D%%++T->->-A-ABa4<< a C ar   