
    U                        S r SSKJr  SSKr\R                  R                  S5      S:X  a  SSKJr  SSKJr  SSKJ	r	  SS	KJ
r
  SS
KJr  OSSKJr  SSKJr  SSKJ	r	  SS	KJ
r
  SS
KJr  SrSrSrSrSrSrSrSrSr " S S\R,                  5      r " S S\R,                  5      r " S S\5      r " S S\5      r " S S\5      rS rg)zdClient deploy info.

Library for parsing client_deploy.yaml files and working with these in memory.
    )absolute_importNAPPENGINE_RUNTIMEpython27)appinfo)
validation)yaml_builder)yaml_listener)yaml_objectruntimestart_time_usecend_time_usecrequestssuccesspathresponse_coderequest_size_bytessdk_versionc            
           \ rS rSrSr\\R                  \\R                  " SS5      \
\R                  \\R                  \\R                  0rSrg)Request5   zFA Request describes a single http request within a deployment attempt.d   iW   N)__name__
__module____qualname____firstlineno____doc__PATHr   TYPE_STRRESPONSE_CODERangeSTART_TIME_USEC	TYPE_LONGEND_TIME_USECREQUEST_SIZE_BYTES
ATTRIBUTES__static_attributes__r       5lib/googlecloudsdk/appengine/api/client_deployinfo.pyr   r   5   sJ    N
JZ%%c3/z++Z))*..*r(   r   c                       \ rS rSrSr\\R                  \\	R                  \\	R                  \\	R                  " \	R                  " \5      5      \\	R"                  \\	R                  " \	R&                  5      0rSrg)ClientDeployInfoExternal@   z6Describes the format of a client_deployinfo.yaml file.r   N)r   r   r   r   r   RUNTIMEr   RUNTIME_RE_STRINGr"   r   r#   r$   REQUESTSOptionalRepeatedr   SUCCESS	TYPE_BOOLSDK_VERSIONr   r&   r'   r   r(   r)   r+   r+   @   si    >w((z++Z))
##J$7$7$@Az##:&&z':':;*r(   r+   c                       \ rS rSrSrSrg)ErrorL   z%Base ClientDeployInfo Exception type.r   Nr   r   r   r   r   r'   r   r(   r)   r6   r6   L   s    -r(   r6   c                       \ rS rSrSrSrg)	EmptyYamlP   zTried to load an empty yaml.r   Nr8   r   r(   r)   r:   r:   P   s    $r(   r:   c                       \ rS rSrSrSrg)MultipleClientDeployInfoT   zHTried to load a yaml containing multiple client deploy info definitions.r   Nr8   r   r(   r)   r=   r=   T   s    Pr(   r=   c                 .   [         R                  " [        5      n[        R                  " U5      n[
        R                  " U5      nUR                  U 5        UR                  5       nU(       d
  [        5       e[        U5      S:  a
  [        5       eUS   $ )a  Returns a ClientDeployInfoExternal from a deploy_info.yaml file or string.

Args:
  client_deploy_info: The contents of a client_deploy_info.yaml file or
    string, or an open file object.

Returns:
  A ClientDeployInfoExternal instance which represents the contents of the
  parsed yaml.

Raises:
  EmptyYaml: when there are no documents in yaml.
  MultipleClientDeployInfo: when there are multiple documents in yaml.
  yaml_errors.EventError: when an error occurs while parsing the yaml.
   r   )r
   ObjectBuilderr+   r   BuilderHandlerr	   EventListenerParse
GetResultsr:   lenr=   )client_deploy_infobuilderhandlerlistenerparsed_yamls        r)   LoadSingleClientDeployInforL   X   s{      %%&>?'''0'((1(
..#$""$+	
+
"
$$	Qr(   )r   
__future__r   osenvirongetgoogle.appengine.apir   r   r   r	   r
   googlecloudsdk.appengine.apir-   r"   r$   r/   r2   r   r    r%   r4   	Validatedr   r+   	Exceptionr6   r:   r=   rL   r   r(   r)   <module>rU      s    ' 	 ::>>%&*4*-/0.25786 #
) j"" 	z33 	.I .% %Qu Qr(   