
    
                         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	lmZ  G d
 dej                        Zy)z,service-management configs describe command.    )absolute_import)division)unicode_literals)services_util)base)arg_parsers)common_flags)	resourcesc                   ,    e Zd ZdZed        Zd Zd Zy)Describea  Describes the configuration for a given version of a service.

  This command prints out the configuration for the given version of a
  given service. You specify the name of the service and the ID of the
  configuration, and the command will print out the specified config.

  ## EXAMPLES

  To print the configuration with ID ``2017-01-01R0'' for the service
  called ``my-service'', run:

    $ {command} --service=my-service 2017-01-01R0
  c                 v    t        j                  dd      j                  |        | j                  dd       y)zArgs is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go
          on the command line after this command. Positional arguments are
          allowed.
    	--servicez)from which to retrieve the configuration.)	flag_namesuffix	config_idz!The configuration ID to retrieve.)helpN)r	   producer_service_flagAddToParseradd_argument)parsers    )lib/surface/endpoints/configs/describe.pyArgszDescribe.Args,   s;     &&:<<GK<O
@  B    c                     fd}t         j                  j                  j                  d|id      }| j	                  |j
                  |j                        S )zRun 'service-management configs describe'.

    Args:
      args: argparse.Namespace, The arguments that this command was invoked
          with.

    Returns:
      The response from the Get API call.
    c                  V    t        j                    j                  d                   S )Nr   )r   GetServiceNameFromArgMakeGetOrRaise)argss   r   _GetServiceNamez%Describe.Run.<locals>._GetServiceNameG   s)    ..
*$

k
*
,. .r   serviceNamez"servicemanagement.services.configs)params
collection)r
   REGISTRYParser   
_GetConfigr    configId)selfr   r   
config_refs    `  r   RunzDescribe.Run<   sV    . ##))/7 * 9J ??:11:3F3FGGr   c                     t        j                         }t        j                         }|j                  ||      }|j                  j                  |      S )N)r    r&   )r   GetMessagesModuleGetClientInstance*ServicemanagementServicesConfigsGetRequestservices_configsGet)r'   servicer   messagesclientrequests         r   r%   zDescribe._GetConfigS   sP    ..0H,,.FAAi B 1G""&&w//r   N)__name__
__module____qualname____doc__staticmethodr   r)   r%    r   r   r   r      s(     B BH.0r   r   N)r7   
__future__r   r   r    googlecloudsdk.api_lib.endpointsr   googlecloudsdk.callioper   $googlecloudsdk.command_lib.endpointsr   r	   googlecloudsdk.corer
   DescribeCommandr   r9   r   r   <module>r@      s4     3 &  ' : ( < = )<0t## <0r   