
                         d    d Z ddlmZ ddlmZ ddlmZ ddlZddlmZ ddlm	Z	 ddl
mZ d	 Zd
 Zy)z;Request hooks for Cloud Media Asset's asset transformation.    )absolute_import)division)unicode_literalsN)encoding)apis)utilsc                     ~ t        j                         }t        j                  |      }t        j                  |||j                  |j
                  |j                        |_        |S )zVPython hook for yaml commands to wildcard the parent parameter in annotation requests.)r   
GetProjectGetLocationGetAnnotationParentTemplate
asset_typeassetannotation_setparent)refargsreqprojectlocations        ?lib/googlecloudsdk/command_lib/media/asset/annotations/hooks.py!AddParentInfoToAnnotationRequestsr      sW    	't$(00(15$**151D1DF#* 
*    c                    ~ t        j                  dd      }|j                  %t        j                  i |j
                        |_        |j                  d      rCt        j                  |j                  |j
                  j                        |j                  _        |j                  d      rXt        j                  |j                        }t        j                  ||j
                  j                        |j                  _        |S )z6Prepare the annotation for create and update requests.
mediaassetv1alphalabelsannotation_data_file)r   GetMessagesModule
annotationr   DictToMessage
AnnotationIsKnownAndSpecifiedr   LabelsValuejsonloadsr   	DataValuedata)r   r   r   messagesannotation_datas        r   ParseAnnotationRequestr*   '   s    	##L)<(^^++B0C0CDCN	h'$22X((446CNN	45jj!:!:;O"00191D1D1N1NPCNN	*r   )__doc__
__future__r   r   r   r$   apitools.base.pyr   googlecloudsdk.api_lib.utilr   &googlecloudsdk.command_lib.media.assetr   r   r*    r   r   <module>r1      s*    B &  '  % , 8r   