
                         B   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dZd	 Z ej                  ej                  j                  ej                  j                   ej                  j"                        ej$                   G d
 dej&                                      Zy)z4Get the Cloud Deploy config for the provided region.    )config)
exceptions)base)resource_argsz{description}z     To get the config for project `test-project` in region `us-central1`:

       $ {command} --project=test-project --region=us-central1

  )DESCRIPTIONEXAMPLESc                 .    t        j                  |        y)zRegister flags for this command.

  Args:
    parser: An argparse.ArgumentParser-like object. It is mocked out in order to
      capture some information, but behaves like an ArgumentParser.
  N)r   AddLocationResourceArgparsers     lib/surface/deploy/get_config.py_CommonArgsr   &   s     &&v.    c                   h    e Zd ZdZeZed        Z ej                  e
j                        d        Zy)	GetConfigzCGet the Cloud Deploy config for the provided region and project.
  c                     t        |        y )N)r   r   s    r   ArgszGetConfig.Args:   s
    r   c                     |j                   j                  j                         }|j                         d   }|j                         d   }t	        j
                         }|j                  ||      }|S )N
projectsIdlocationsId)CONCEPTSregionParseAsDictr   ConfigClientr   )selfargslocation_refprojectr   config_clientconfs          r   RunzGetConfig.Run>   sg     ==''--/L!!#L1G  "=1F'')M""7F3DKr   N)__name__
__module____qualname____doc___DETAILED_HELPdetailed_helpstaticmethodr   gcloud_exception CatchHTTPErrorRaiseHTTPExceptiondeploy_exceptionsHTTP_ERROR_FORMATr"    r   r   r   r   0   sK    
 !-  544))r   r   N)r&   "googlecloudsdk.api_lib.clouddeployr   googlecloudsdk.api_lib.utilr   r*   googlecloudsdk.callioper   !googlecloudsdk.command_lib.deployr,   r   r'   r   ReleaseTracksReleaseTrackALPHABETAGADefaultUniverseOnlyDescribeCommandr   r.   r   r   <module>r:      s    ; 6 F ( M ;
 			
/ T..33T5F5F5I5I $$  r   