
    +-                        S r SSKJr  SSKJr  SSKJr  SSK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SS.rSrSrSrSrSrSrSrSrSr\R4                  " \R6                  R8                  5      \R:                   " S S\R<                  5      5       5       r\R4                  " \R6                  R@                  5      \R:                   " S S\R<                  5      5       5       r!g)z&Command to describe a shared template.    )absolute_import)division)unicode_literalsN)shared_templates)utils)base)
exceptions)
propertiesDescribe a shared template.a>           To describe the shared template `my-shared-template` in space `my-space`, project `my-project` and location `us-central1`, run:

          $ {command} my-shared-template --space=my-space --project=my-project --location=us-central1

        Or run:

          $ {command} projects/my-project/locations/us-central1/spaces/my-space/sharedTemplates/my-shared-template

        To describe a shared template `google-template` from the Google Catalog and location `us-central1`, run:

          $ {command} google-template --google-catalog --location=us-central1
        z         This command uses the designcenter/v1alpha API. The full documentation for
        this API can be found at:
        http://cloud.google.com/application-design-center/docs
        )DESCRIPTIONEXAMPLESzAPI REFERENCEz Error parsing [shared_template].a  The [sharedTemplate] resource is not properly specified.
Failed to find attribute [location]. The attribute can be set in the following ways:
- provide the argument `shared_template` on the command line with a fully specified name
- provide the argument `--location` on the command linea  The [sharedTemplate] resource is not properly specified.
Failed to find attribute [project]. [project] must be specified unless using --google-catalog, a full resource name, or the core/project property is set. The attribute can be set in the following ways:
- provide the argument `shared_template` on the command line with a fully specified name
- provide the argument `--project` on the command line
- set the property `core/project`ai  The [sharedTemplate] resource is not properly specified.
Failed to find attribute [space]. [space] must be specified unless using --google-catalog or a full resource name. The attribute can be set in the following ways:
- provide the argument `shared_template` on the command line with a fully specified name
- provide the argument `--space` on the command linea  ID of the sharedTemplate or fully qualified identifier for the sharedTemplate. Format: projects/$project/locations/$location/spaces/$space/sharedTemplates/$sharedTemplate
 To set the shared_template attribute:
  * provide the fully qualified identifier `shared_template` on the command line;
  * provide the argument `shared_template` which represents the shared template id and the other arguments `--location`, `--project`, `--space` or `--google-catalog` on the command line.zThe location id of the sharedTemplate resource.

To set the location attribute:
  * provide the argument `shared_template` on the command line with a fully specified name;
  * provide the argument `--location` on the command line.a  The project id of the sharedTemplate resource.

To set the project attribute:
  * provide the argument `shared_template` on the command line with a fully specified name;
  * provide the argument `--project` on the command line;
  * set the property `core/project`.zThe space id of the sharedTemplate resource.

To set the space attribute:
  * provide the argument `shared_template` on the command line with a fully specified name;
  * provide the argument `--space` on the command line.zIf provided, describes a shared template from the Google Catalog. This sets the project to "gcpdesigncenter" and space to "googlespace".c                   B    \ rS rSrSr\r\S 5       r\S 5       r	S r
Srg)DescribeAlpha   r   c                    U R                  SS[        S9  U R                  SS[        S9  U R                  5       nUR                  SS[        S	9  UR                  S
5      nUR                  SS[        S9  UR                  SS[        S9  g Nshared_templateSHARED_TEMPLATE)metavarhelpz
--locationF)requiredr   z--google-catalog
store_true)actionr   z:Specify --project and --space for custom shared templates.z	--projectz--spaceadd_argument_SHARED_TEMPLATE_HELP_TEXT_LOCATION_HELP_TEXTadd_mutually_exclusive_group_GOOGLE_CATALOG_HELP_TEXTadd_argument_group_PROJECT_HELP_TEXT_SPACE_HELP_TEXTparsergroupproject_space_groups      =lib/surface/design_center/spaces/shared_templates/describe.pyArgsDescribeAlpha.Args        !'       //1E	&    22D $$ % 
 $$ %     c                 T    [         R                  " S5      nUR                  U 5      SL$ z#Validates the shared template name.zF^projects/[^/]+/locations/[^/]+/spaces/[^/]+/sharedTemplates(/[^/]+)?$Nrecompilematchnamepatterns     r'   ValidSharedTemplateName%DescribeAlpha.ValidSharedTemplateName   +     jjQG ==d**r+   c                 8   [         R                  " [        R                  R                  S9nU R                  UR                  5      (       a  UR                  S5      (       d=  UR                  S5      (       d'  UR                  S5      (       d  UR                  (       a  [        R                  " S5      eUR                  UR                  S9$ UR                  S5      (       d#  [        R                  " [         S[         35      eUR                  nUR                  (       a  [         R"                  " 5       nSnOUR$                  =(       d2    [&        R(                  R*                  R$                  R-                  5       nU(       d#  [        R                  " [         S[.         35      eUR                  S5      (       d#  [        R                  " [         S[0         35      eUR2                  nS	R5                  XCXQR                  5      nUR                  US9$ 
zRun the describe command.)release_tracklocationprojectspacezj--location, --project, --space, and --google-catalog cannot be used when a full resource name is provided.)r3   
googlespacez5projects/{}/locations/{}/spaces/{}/sharedTemplates/{})apisSharedTemplatesClientr   ReleaseTrackALPHAr5   r   IsSpecifiedgoogle_catalogr	   ConflictingArgumentsExceptionDescribeToolException_BASE_ERROR_MESSAGE_LOCATION_NOT_SPECIFIED_MESSAGEr;   api_lib_utilsGetGoogleCatalogProjectIdr<   r
   VALUEScoreGet_PROJECT_NOT_SPECIFIED_MESSAGE_SPACE_NOT_SPECIFIED_MESSAGEr=   formatselfargsclientlocation_id
project_idspace_idshared_template_names          r'   RunDescribeAlpha.Run   s   ''d6G6G6M6MNF ##D$8$899


:
&
&i((g&&  66;
 	
 __$"6"6_77 J''$$ !$C#D
E  --K ::<jh<<G:#4#4#9#9#A#A#E#E#Gj&&"#2&D%EF
 	
 g&&&&"#2&B%CD
 	
 h
 	@FFX/C/C	
  ?? 4?55r+    N__name__
__module____qualname____firstlineno____doc___DETAILED_HELPdetailed_helpstaticmethodr(   r5   r[   __static_attributes__r]   r+   r'   r   r      8     $ -" "H + +16r+   r   c                   B    \ rS rSrSr\r\S 5       r\S 5       r	S r
Srg)
DescribeGa   r   c                    U R                  SS[        S9  U R                  SS[        S9  U R                  5       nUR                  SS[        S	9  UR                  S
5      nUR                  SS[        S9  UR                  SS[        S9  g r   r   r#   s      r'   r(   DescribeGa.Args   r*   r+   c                 T    [         R                  " S5      nUR                  U 5      SL$ r-   r.   r2   s     r'   r5   "DescribeGa.ValidSharedTemplateName  r7   r+   c                 8   [         R                  " [        R                  R                  S9nU R                  UR                  5      (       a  UR                  S5      (       d=  UR                  S5      (       d'  UR                  S5      (       d  UR                  (       a  [        R                  " S5      eUR                  UR                  S9$ UR                  S5      (       d#  [        R                  " [         S[         35      eUR                  nUR                  (       a  [         R"                  " 5       nSnOUR$                  =(       d2    [&        R(                  R*                  R$                  R-                  5       nU(       d#  [        R                  " [         S[.         35      eUR                  S5      (       d#  [        R                  " [         S[0         35      eUR2                  nS	R5                  XCXQR                  5      nUR                  US9$ r9   )r@   rA   r   rB   GAr5   r   rD   rE   r	   rF   rG   rH   rI   rJ   r;   rK   rL   r<   r
   rM   rN   rO   rP   rQ   r=   rR   rS   s          r'   r[   DescribeGa.Run  s   ''d6G6G6J6JKF ##D$8$899


:
&
&i((g&&  66;
 	
 __$"6"6_77 J''$$ !$C#D
E  --K ::<jh<<G:#4#4#9#9#A#A#E#E#Gj&&"#2&D%EF
 	
 g&&&&"#2&B%CD
 	
 h
 	@FFX/C/C	
  ?? 4?55r+   r]   Nr^   r]   r+   r'   rj   rj      rh   r+   rj   )"rc   
__future__r   r   r   r/   $googlecloudsdk.api_lib.design_centerr   r@   r   rK   googlecloudsdk.callioper   r	   googlecloudsdk.corer
   rd   rI   rJ   rP   rQ   r   r   r!   r"   r   ReleaseTracksrB   rC   UniverseCompatibleDescribeCommandr   rq   rj   r]   r+   r'   <module>rz      s(   - &  ' 	 I G ( . * 1, 9 >  ( ; I A + >   D%%++,c6D(( c6  -c6L D%%(()c6%% c6  *c6r+   