
                             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)z4A command that describes a message from a given API.    )absolute_import)division)unicode_literals)base)
exceptions)flags)	arg_utils)registryc                   &    e Zd ZdZed        Zd Zy)Describez2Describe the details of a proto message in an API.c                     t         j                  j                  |        t         j                  j                  |        | j	                  dd       y )Nmessagez-The name of the message you want to describe.)help)r   API_REQUIRED_FLAGAddToParserAPI_VERSION_FLAGadd_argument)parsers    *lib/surface/meta/apis/messages/describe.pyArgszDescribe.Args    sC    	''/	&&v.
<  >    c                 Z   t        j                  |j                  |j                        }	 t	        |j                         |j                        }t        j                  |      S # t        $ r; t        j                  ddj                  |j                  |j                              w xY w)N)api_versionr   z(Message [{}] does not exist for API [{}])r
   GetAPIapir   getattrGetMessagesModuler   r	   GetRecursiveMessageSpecAttributeErrorr   InvalidArgumentExceptionformat)selfargsr   r   s       r   RunzDescribe.Run(   s    
//$((0@0@
AC'--/>g..w77 '//
?FFllDHH&' ''s   8A& &AB*N)__name__
__module____qualname____doc__staticmethodr   r$    r   r   r   r      s    :> >'r   r   N)r(   
__future__r   r   r   googlecloudsdk.callioper   r   $googlecloudsdk.command_lib.meta.apisr   $googlecloudsdk.command_lib.util.apisr	   r
   DescribeCommandr   r*   r   r   <module>r0      s4     ; &  ' ( . 6 : 9't## 'r   