
                            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 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 ej.                  ej0                  j2                  gdgej4                         ej.                  ej0                  j2                  gdgej6                         ej.                  ej0                  j2                  gddgej8                        gZy)z*Describes a Gcloud Deploy Policy resource.    )encoding)
exceptions)base)deploy_policy_util)manifest_util)resource_argsz{description}z   To describe a deploy policy called 'test-policy' in region 'us-central1', run:

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

)DESCRIPTIONEXAMPLESc                 2    t        j                  | d       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.
  T)
positionalN)r   AddDeployPolicyResourceArgparsers    .lib/surface/deploy/deploy_policies/describe.py_CommonArgsr   %   s     **6dC    c                   h    e Zd ZdZeZed        Z ej                  e
j                        d        Zy)Describez#Show details about a deploy policy.c                     t        |        y )N)r   r   s    r   ArgszDescribe.Args8   s
    r   c                 R   |j                   j                  j                         }t        j                  |      }t        j                  |      }t        j                  |t        t        j                  j                  |j                         |j                  |j                         |S )z9This is what gets called when the user runs this command.)CONCEPTSdeploy_policyParser   GetDeployPolicyr   MessageToDictr   ApplyTransforms_TRANSFORMSResourceKindDEPLOY_POLICYName
projectsIdlocationsId)selfargs
policy_ref
policy_objmanifests        r   RunzDescribe.Run<   s    
 ,,224J#33J?J%%j1H!!""00 Or   N)__name__
__module____qualname____doc___DETAILED_HELPdetailed_helpstaticmethodr   gcloud_exception CatchHTTPErrorRaiseHTTPExceptiondeploy_exceptionsHTTP_ERROR_FORMATr)    r   r   r   r   /   sI    
 , -  544))r   r   name)kindsfieldsmovez7rules[].rolloutRestriction.timeWindows.oneTimeWindows[])r7   r8   replacez@rules[].rolloutRestriction.timeWindows.weeklyWindows[].startTimez>rules[].rolloutRestriction.timeWindows.weeklyWindows[].endTimeN)r-   apitools.base.pyr   googlecloudsdk.api_lib.utilr   r1   googlecloudsdk.callioper   !googlecloudsdk.command_lib.deployr   r3   r   r   r.   r   ReleaseTracksReleaseTrackALPHABETAGADefaultUniverseOnlyDescribeCommandr   TransformConfigr   r    AddApiVersionAndKind&ConvertPolicyOneTimeWindowToYamlFormatConvertTimeProtoToStringr   r5   r   r   <module>rJ      sJ   1 & F ( @ M ; ; #D T..33T5F5F5I5I t##  D "M!!))778 x// "M!!))778IJDD
 "M!!))778NL
 66r   