
                         2   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  ej                  ej                  j                  ej                  j                   ej                  j"                         G d	 d
ej$                               Zd Zy)zDescribes a AlloyDB cluster.    )absolute_import)division)unicode_literals)api_util)base)flags)
propertiesc                   0    e Zd ZdZdddZed        Zd Zy)Describez:Describe an AlloyDB cluster in a given project and region.z{description}zc        To describe a cluster, run:

          $ {command} my-cluster --region=us-central1
        )DESCRIPTIONEXAMPLESc                 X    t        j                  |        t        j                  |        y)zySpecifies additional command flags.

    Args:
      parser: argparse.Parser: Parser object for command line inputs.
    N)r   	AddRegion
AddCluster)parsers    (lib/surface/alloydb/clusters/describe.pyArgszDescribe.Args+   s     
OOF	V    c                    t        j                  | j                               }|j                  }|j                  }|j
                  j                  dt        j                  j                  j                  j                  |j                  |j                        }|j                  |j                               }|j                   j#                  |      }t%        |j&                         |S )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.
    z#alloydb.projects.locations.clusters)
projectsIdlocationsId
clustersId)name)r   AlloyDBClientReleaseTrackalloydb_clientalloydb_messagesresource_parserCreater	   VALUEScoreproject	GetOrFailregioncluster*AlloydbProjectsLocationsClustersGetRequestRelativeNameprojects_locations_clustersGet!normalize_automated_backup_policyautomatedBackupPolicy)selfargsclientr   r   cluster_refreqr%   s           r   RunzDescribe.Run5   s     ##D$5$5$78F**N..((//-$$))11;;KKDLL 0 :K 
E
E%%' F C 88<<SAG%g&C&CDNr   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r1    r   r   r   r      s2     C 		-  r   r   c                     | y| j                   y| j                   j                  D ]  }|j                  d|_         y)z<Normalizes the policy so that it looks correct when printed.Nr   )weeklySchedule
startTimeshours)policy
start_times     r   r*   r*   N   sE    ^
"
))44j
 j 5r   N)r5   
__future__r   r   r   googlecloudsdk.api_lib.alloydbr   googlecloudsdk.callioper   "googlecloudsdk.command_lib.alloydbr   googlecloudsdk.corer	   ReleaseTracksr   ALPHABETAGADescribeCommandr   r*   r8   r   r   <module>rI      s~    # &  ' 3 ( 4 * D%%++T->->-C-C%%((*.t## .*.br   