
                           S r SSKJr  SSKJr  SSKJr  SSKrSSKrSSKrSSKrSSK	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  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SKJr  SSKJr  SrSrSrSrS\< S\< S3rSrSr/ SQrSSRA                  \5      -   S-   r!Sr"SSSS S!.r#S"r$S#r%S#r&S"r'S$r(S%r)S&r*S%r+S'r,S(\$-  r-\-< S)\(< 3r.S*\$-  r/\/< \)< 3r0S+\$S -
  -  r1S,\.< S-\0< S.\1< 3r2S/\%S -
  -  r3S/\&S -
  -  r4S0r5S1r6S2r7S3r8S4r9S5r:S6r;S7r<S8r=S9r>S:r?S;r@S<rAS=rBS>rCS?rDS@rESArFSBrGSCrHSDrISErJSFrKSGrLSHrMSIrNS'rOSJrPSKrQSDrRS'rSSLrTSMrUSNrVSOrWSPrXSQrYSRrZSSr[STr\SUr]SVr^S@r_SWr`SAraSXrbSBrcSYrdSCreSZrfS[rgS\rhS]riS^rjS_rkS`rlSarmSbrnScroSdrpSerqSfrrSgrsShrtSiruSjrvSkrwSlrxSmrySnrzSor{Spr|Sqr}Srr~SsrStrSurSvrSwrSxrSyrSzrS{rS|rS}rS~rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr/ SQrSr/ SQrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSnrSrSrSrSrSrSrSr " S S\5      r/ \" SSSS/SS/S9P\" SSSS/SS/S9P\" SSS/ SQS/ SQS9P\" SSSS/SS9P\" SGS GSGS/GSS9P\" GSGSGSGS/GSS9P\" GSGSGS	GS
/GS
S9P\" GSGSGSGS/GSGS/GS9P\" GSGSGSGS/GSGS/S9P\" GSGSGSGS/GSS9P\" GSGSGS/ GSQGSGSGS/S9P\" GSGS GS!GS"GS#/GS"S9P\" GS$GS%GS&GS'/GS'S9P\" GS(GS)GS*/ GS+QGS,GS-GS./S9P\" GS/GS)GS*GS0/GS0S9P\" GS1GS2GS3GS4/GS4S9P\" GS5GS6GS7GS8/GS8S9P\" GS9GS:GS;GS/GSGSGS<9P\" GS=GS>GS?/ GS@QGSAGSAGSBGSC/GSD9P\" GSEGSFGSGGSH/GSHS9P\" GSIGSJGSKGSL/GSLGSL/GS9P\" GSMGSNGSOGSP/GSPS9P\" GSQGSRGSSGSTGSU/GSTGSU/GS9P\" GSVGSWGSX/ GSYQGSGS/S9P\" GSZGS[GS\GS]GS^/GS^GS]/S9P\" GS_GS`GSaGSbGSc/GScGScGS<9P\" GSdGSeGSf/ GSgQGShGSiGSj/S9P\" GSkGSlGSmGSn/GSnS9P\" GSoGSpGSq/ GSrQGSsGSGSt/GSD9P\" GSuGSvGSwGSxGSy/GSyGSxGS<9P\" GSzGS{GS|GS}/GS}GS}GS<9P\" GS~GSGSGS/GSGSGS<9PrG\ " GS \ 5       5      GrGS// GSQGSGS/GSGS/GS/GS/GS/GS// GSQ/ GSQGS.
GrGSGrG\" GS5      GrG\" \GR                  SGS 5      G\-
  Gr\GR                  " GS\GR                  " GSRA                  G\5      5      -  5      Gr
G\" / GSQ5      GrGSGrGSGrGSGrGSGrG\GrGS GrGS Gr " GS GS\GR&                  5      Gr " GS GS\GR*                  5      Gr " GS GSG\5      Gr " GS GS\GR&                  5      Gr " GS GS\GR&                  5      Gr " GS GS\GR&                  5      Gr " GS GS\GR&                  5      Gr " GS GSG\5      Gr " GS GS\GR&                  5      Gr " GS GS\GR&                  5      Gr " GS GS\GR&                  5      Gr " GS GS\GR&                  5      Gr  " GS GS\GR&                  5      Gr! " GS GS\GR&                  5      Gr" " GS GS\GR&                  5      Gr# " GS GS\GR*                  5      Gr$ " GS GS\GR&                  5      Gr% " GS GS\GR*                  5      Gr& " GS GSG\&5      Gr' " GS GS\GR*                  5      Gr(GS Gr)GS Gr* " GS GS\GR&                  5      Gr+ " GS GS\GR&                  5      Gr, " GS GS\GR&                  5      Gr- " GS GSG\+5      Gr. " GS GS\GR&                  5      Gr/ " GS GS\GR&                  5      Gr0 " GS GS\GR&                  5      Gr1 " GS GS\GR&                  5      Gr2 " GS GS\GR&                  5      Gr3 " GS GS\GR&                  5      Gr4 " GS GS\GR&                  5      Gr5 " GS GS\GR&                  5      Gr6GSGS jGr7GS Gr8 " GS GS\GR&                  5      Gr9GS Gr:GS Gr;\GR                  " GS5      Gr<\GR                  " GS5      Gr=\GR                  " GS5      Gr>GS Gr?g(  zAppInfo tools.

This library allows you to work with AppInfo records in memory, as well as store
and load from configuration files.
    )absolute_import)division)print_functionNAPPENGINE_RUNTIMEpython27)
validation)yaml_builder)yaml_listener)yaml_object)appinfo_errors)backendinfo)
six_subsetz(?!\^)/.*|\..*|(\(.).*(?!\$).z.+z/.*z([0-9]+)([DdHhMm]|[sS]?)z\s*(z)(\s+z)*\s*z
/_ah/startz^\S+$)	mailmail_bouncexmpp_messagexmpp_subscribexmpp_presence
xmpp_errorchannel_presencerestwarmup(|)z^.+$iQ i  <      )dhmsd   ?   ~:.defaultz[a-z\d\-]{1,%d}\z(?!\-)[a-z\d\-\.]{1,%d}z(?!-)[a-z\d\-]{0,%d}[a-z\d]z(?:z)?(?:z)?z^(?!-)[a-z\d\-]{0,%d}[a-z\d]$z^([\d]+|automatic)$z^[1-9][\d]*$z^([1-9]\d*)$z#^(\d+((\.\d{1,3})?s|ms)|automatic)$z^[\d]+(s|m)$z^[a-z\d-]+(/[a-z\d-]+)*$z^[a-z]([a-z\d-]{0,61}[a-z\d])?$z'^(EXTERNAL|external|INTERNAL|internal)$z^[a-z\d-]+(/.+)*$z^[a-z\d-]+(,[a-z\d-]+)*$z-dot-z
ah-builtinz2((gs://[a-z0-9\-\._/]+)|([a-z][a-z0-9\-\.]{0,29}))z[\w.]{1,32}z(1|2|standard|flex|flexible)z[\w.\-]{1,32}static_files
static_dirscriptapi_endpointoptionalrequiredadminredirectunauthorizedlegacyneveralwaysrequire_matching_filez7^(.*/)?((#.*#)|(.*~)|(.*\.py[co])|(.*/RCS/.*)|(\..*)|)$z(?!)z^$loginauth_fail_actionsecureurlpositionheadtailupload	mime_type
expirationhttp_headersapplication_readableredirect_http_response_codeapplicationprojectmoduleserviceautomatic_scalingmanual_scalingbasic_scalingvmvm_settingszonesbeta_settingsflexible_runtime_settingsvm_health_checkhealth_check	resourcesliveness_checkreadiness_checknetworkvpc_access_connector
vpc_accessversionmajor_versionminor_versionruntimeruntime_channelapi_versionmainendpoints_api_serviceenv
entrypointruntime_configsource_languagebuiltinsincludeshandlers	librariesdefault_expiration
skip_filesnobuild_filesinbound_servicesderived_file_typejava_precompiledpython_precompiledadmin_consoleerror_handlersbackends
threadsafeservice_accountauto_id_policy
api_config	code_lockenv_variablesbuild_env_variablesstandard_websocketapp_engine_apisapp_engine_bundled_servicesz^[a-z][a-z0-9\-\+\.]*:[^#]*$z^[0-9a-fA-F]+$i   instance_classmin_pending_latencymax_pending_latencymin_idle_instancesmax_idle_instancesmax_concurrent_requestsmin_num_instancesmax_num_instancescool_down_period_seccpu_utilizationtarget_utilizationaggregation_window_length_sec!target_network_sent_bytes_per_sec#target_network_sent_packets_per_sec%target_network_received_bytes_per_sec'target_network_received_packets_per_sectarget_disk_write_bytes_per_sectarget_disk_write_ops_per_sectarget_disk_read_bytes_per_sectarget_disk_read_ops_per_sectarget_request_count_per_sectarget_concurrent_requestscustom_metricsmetric_nametarget_typez+^(GAUGE|DELTA_PER_SECOND|DELTA_PER_MINUTE)$single_instance_assignmentfilter	instancesmax_instancesidle_timeoutpagesname	config_idrollout_strategyfixedmanagedtrace_sampling
error_codefilez+(default|over_quota|dos_api_denial|timeout)on)yesyTruet1trueoff)nonFalsef0falseenable_health_checkcheck_interval_sectimeout_secapp_start_timeout_secunhealthy_thresholdhealthy_thresholdfailure_thresholdsuccess_thresholdrestart_thresholdinitial_delay_sechostpathcpu	memory_gbdisk_size_gbvolumesvolume_typesize_gbforwarded_portsinstance_tagsubnetwork_namesession_affinityinstance_ip_modemin_instancestarget_cpu_utilizationtarget_throughput_utilizationegress_settingzall-trafficzprivate-ranges-onlynetwork_interfacesubnettags
vpc_egressoperating_systemruntime_versionc                   J    \ rS rSrSr    SS jr\S 5       r\S 5       rSr	g)	_VersionedLibraryi  z,A versioned library supported by App Engine.Nc
                     Xl         X l        X0l        X@l        XPl        X`l        U=(       d    / U l        U=(       d    / U l        U	=(       d    / U l        g)a  Initializer for `_VersionedLibrary`.

Args:
  name: The name of the library; for example, `django`.
  url: The URL for the library's project page; for example,
      `http://www.djangoproject.com/`.
  description: A short description of the library; for example,
      `A framework...`.
  supported_versions: A list of supported version names, ordered by release
      date; for example, `["v1", "v2", "v3"]`.
  latest_version: The version of the library that will be used when you
      specify `latest.` The rule of thumb is that this value should be the
      newest version that is neither deprecated nor experimental; however
      this value might be an experimental version if all of the supported
      versions are either deprecated or experimental.
  default_version: The version of the library that is enabled by default
      in the Python 2.7 runtime, or `None` if the library is not available
      by default; for example, `v1`.
  deprecated_versions: A list of the versions of the library that have been
      deprecated; for example, `["v1", "v2"]`. Order by release version.
  experimental_versions: A list of the versions of the library that are
      currently experimental; for example, `["v1"]`. Order by release
      version.
  hidden_versions: A list of versions that will not show up in public
      documentation for release purposes.  If, as a result, the library
      has no publicly documented versions, the entire library won't show
      up in the docs. Order by release version.
N)	r   r8   descriptionsupported_versionslatest_versiondefault_versiondeprecated_versionsexperimental_versionshidden_versions)
selfr   r8   r   r   r   r   r   r   r   s
             +lib/googlecloudsdk/appengine/api/appinfo.py__init___VersionedLibrary.__init__  sN    L IH"0(*28bD!6!<"D*0bD    c                 X    [        U R                  5      [        U R                  5      :H  $ )zDetermines if the entire library should be hidden from public docs.

Returns:
  True if there is every supported version is hidden.
)sortedr   r   r   s    r   hidden_VersionedLibrary.hidden  s%     $))*fT5I5I.JJJr   c                 h    U R                    Vs/ s H  nXR                  ;  d  M  UPM     sn$ s  snf )zRetrieves the versions of the library that are not deprecated.

Returns:
  A list of the versions of the library that are not deprecated.
)r   r   )r   rV   s     r   non_deprecated_versions)_VersionedLibrary.non_deprecated_versions  s;     $(#:#: 8#:666 #: 8 8 8s   //)	r   r   r   r   r   r   r   r   r8   )NNNN)
__name__
__module____qualname____firstlineno____doc__r   propertyr   r   __static_attributes__ r   r   r   r     sC    4  $#'%)#.1` K K 8 8r   r   clearsilverzhttp://www.clearsilver.net/z<A fast, powerful, and language-neutral HTML template system.z0.10.5)r   r   clickzhttp://click.pocoo.org/z"A command line library for Python.6.6djangozhttp://www.djangoproject.com/z5A full-featured web application framework for Python.)1.21.31.41.51.91.11r   )r   r   r   r   )r   r   enumz#https://pypi.python.org/pypi/enum34z6A backport of the enum module introduced in python 3.40.9.23)r   	endpointszBhttps://cloud.google.com/appengine/docs/standard/python/endpoints/z9Libraries for building APIs in an App Engine application.z1.0flaskzhttp://flask.pocoo.org/zTFlask is a microframework for Python based on Werkzeug, Jinja 2 and good intentions.0.12futuresz9https://docs.python.org/3/library/concurrent.futures.htmlzBackport of Python 3.2 Futures.3.0.5grpciozhttp://www.grpc.io/z(A high performance general RPC framework1.0.0)r   r   itsdangerousz%http://pythonhosted.org/itsdangerous/z!HMAC and SHA1 signing for Python.0.24jinja2zhttp://jinja.pocoo.org/docs/z>A modern and designer friendly templating language for Python.2.6lxmlzhttp://lxml.de/z;A Pythonic binding for the C libraries libxml2 and libxslt.)2.32.3.53.7.3r	  r  r  
markupsafez&http://pypi.python.org/pypi/MarkupSafez/A XML/HTML/XHTML markup safe string for Python.0.15z0.23
matplotlibzhttp://matplotlib.org/zAA 2D plotting library which produces publication-quality figures.1.2.0MySQLdbz$http://mysql-python.sourceforge.net/z3A Python DB API v2.0 compatible interface to MySQL.)1.2.4b41.2.41.2.5r  r  r  mysqlclientz1.4.4numpyzhttp://numpy.scipy.org/z/A general-purpose library for array-processing.1.6.1PILz/http://www.pythonware.com/library/pil/handbook/z/A library for creating and transforming images.z1.1.7protorpcz"https://github.com/google/protorpczMA framework for implementing HTTP-based remote procedure call (RPC) services.)r   r   pytzz"https://pypi.python.org/pypi/pytz?z2A library for cross-platform timezone calculations)2016.42017.22017.3r  r  r  )r   r   r   crcmodzhttp://crcmod.sourceforge.net/z8A library for generating Cyclic Redundancy Checks (CRC).z1.7protobufz/https://developers.google.com/protocol-buffers/z)A library for serializing structured data3.0.0psycopg2zhttp://initd.org/psycopg/z8A Python DB API v2.0 compatible interface to PostgreSQL.z2.8.3PyAMFz"https://pypi.python.org/pypi/PyAMFzBA library that provides (AMF) Action Message Format functionality.z0.6.1z0.7.2pycryptoz(https://www.dlitz.net/software/pycrypto/zEA library of cryptography functions such as random number generation.)r  r  z2.6.1
setuptoolsz&http://pypi.python.org/pypi/setuptoolszBA library that provides package and module discovery capabilities.0.6c1136.6.0sixz https://pypi.python.org/pypi/sixz*Abstract differences between py2.x and py3z1.9.0z1.12.0sslz+http://docs.python.org/dev/library/ssl.htmlz'The SSL socket wrapper built-in module.)2.72.7.112.7.16z2.7.currentr'  r&  r(  ujsonz"https://pypi.python.org/pypi/ujsonzEUltraJSON is an ultra fast JSON encoder and decoder written in pure Cz1.35webapp2z#http://webapp-improved.appspot.com/z#A lightweight Python web framework.)r  2.5.12.5.2r,  r+  webobzhttp://www.webob.org/zEA library that provides wrappers around the WSGI request environment.z1.1.1z1.2.3werkzeugzhttp://www.werkzeug.pocoo.org/zA WSGI utility library.0.11.10yamlzhttp://www.yaml.org/z5A library for YAML serialization and deserialization.z3.10c              #   >   #    U  H  nUR                   U4v   M     g 7fNr   .0librarys     r   	<genexpr>r7    s!      "G1Eg $+<<"91Es   )r  r  ))r   r   )r  r  r  r  )r.  r/  )r
  r  )r!  r"  )r
  latestr!  r9  )r  r  )r  r9  r$  r9  )r  r  )r   r   )r   r   r;  )r!  r#  )r  r9  )r   r9  )r   r9  r;  r:  )
)r   r   )r   r   r8  )r  r9  )r  r  )r  r9  r<  r=  )r   r  )r   r9  zuse one of: "%s"z()<>@,;:\"/[]?={} 	z[%s]+$ )acceptzaccept-charsetzaccept-encodingzaccept-languageauthorizationexpectfromr   zif-matchzif-modified-sincezif-none-matchzif-rangezif-unmodified-sincezmax-forwardszproxy-authorizationrangereferertez
user-agenti   i  i (  )zcontrib-dartdartgophpphp55php72pythonr   zpython-compatjavajava7java8rI   customnodejsrubygo111go112c                      [         $ )zReturns the list of all valid runtimes.

This list can include third-party runtimes as well as canned runtimes.

Returns:
  Tuple of strings.
)_all_runtimesr   r   r   GetAllRuntimesrW  A  s
     
r   c                      U R                  S5      $ ! [         a    Ue[         a    Ue[         a4     U R	                  S5      R                  S5      s $ ! [         a    Uef = ff = f)zEnsure s contains only ASCII-safe characters; return it as bytes-type.

Arguments:
  s: the string or bytes to check
  err: the error to raise if not good.
Raises:
  err if it's not ASCII-safe.
Returns:
  s as a byte string
ascii)encodeUnicodeEncodeErrorUnicodeDecodeErrorAttributeErrordecode)r    errs     r   EnsureAsciiBytesr`  L  st    88G	 
I	  I	 XXg%%g.. is      A'AA'A##A'c                       \ rS rSrSr\\R                  " \5      \	\R                  " \\\\S9\\R                  " \\\S9\\R                  " \\\\\S9\\R                  " \5      0rSrg)HandlerBaseif  z+Base class for URLMap and ApiConfigHandler.r&   r   N)r   r   r   r   r   URLr   Optional
_URL_REGEXLOGINOptionsLOGIN_OPTIONALLOGIN_REQUIREDLOGIN_ADMINAUTH_FAIL_ACTIONAUTH_FAIL_ACTION_REDIRECTAUTH_FAIL_ACTION_UNAUTHORIZEDSECURESECURE_HTTPSECURE_HTTPSSECURE_HTTP_OR_HTTPSSECURE_DEFAULTHANDLER_SCRIPT_FILES_REGEX
ATTRIBUTESr   r   r   r   rb  rb  f  s    3 
:z*Z . +(68
 
**+D+H3LN j  !-!5!/)7	9 j)),7'*r   rb  c                      ^  \ rS rSrSr\" / SQ5      rSr\\\\\	\	\
S.rSr " S S\R                  5      r " S S	\R                  5      r\" 5       r\" 5       rS
 rU 4S jrSrU =r$ )HttpHeadersDicti  a~  A dict that limits keys and values to what `http_headers` allows.

`http_headers` is an static handler key; it applies to handlers with
`static_dir` or `static_files` keys. The following code is an example of how
`http_headers` is used::

    handlers:
    - url: /static
      static_dir: static
      http_headers:
        X-Foo-Header: foo value
        X-Bar-Header: bar value

)zcontent-encodingzcontent-lengthdateserveri  )zcontent-security-policyzx-content-security-policyzx-webkit-cspz#content-security-policy-report-onlyz
set-cookiezset-cookie2locationc                   "    \ rS rSrSrSS jrSrg)HttpHeadersDict.KeyValidatori  zEnsures that keys in `HttpHeadersDict` are valid.

`HttpHeadersDict` contains a list of headers. An instance is used as
`HttpHeadersDict`'s `KEY_VALIDATOR`.
Nc                    Un[        U[        R                  5      (       a   [        U[        R
                  " S5      5      nUR                  5       R                  S5      n[        R                  U5      (       d  [        R
                  " S5      eU[        ;   a  [        R
                  " SU-  5      eUR                  S5      (       a  [        R
                  " S5      e[        R                  R                  U5      (       a  [        R
                  " S5      eU[        R                   ;   a  [        R
                  " SU-  5      eU$ )	a  Returns an argument, or raises an exception if the argument is invalid.

HTTP header names are defined by `RFC 2616, section 4.2`_.

Args:
  name: HTTP header field value.
  unused_key: Unused.

Returns:
  name argument, unchanged.

Raises:
  appinfo_errors.InvalidHttpHeaderName: An argument cannot be used as an
      HTTP header name.

.. _RFC 2616, section 4.2:
   https://www.rfc-editor.org/rfc/rfc2616.txt
2HTTP header values must not contain non-ASCII datarY  z2An HTTP header must be a non-empty RFC 2616 token.z4%r can only be used in HTTP requests, not responses.zx-appenginez;HTTP header names that begin with X-Appengine are reserved.zEOnly use end-to-end headers may be used. See RFC 2616 section 13.5.1.z%s is a disallowed header.)
isinstancer   string_typesr`  r   InvalidHttpHeaderNamelowerr^  _HTTP_TOKEN_REmatch_HTTP_REQUEST_HEADERS
startswithwsgirefutilis_hop_by_hoprx  DISALLOWED_HEADERS)r   r   
unused_keyoriginal_names       r   Validate%HttpHeadersDict.KeyValidator.Validate  s1   & m 
D*11	2	2n&J&J@'B C ZZ\  )d!!$''22@B 	B 
&	&22B 	
 
	'	'22IK 	K 
	#	#D	)	)22 	 
33	322(4/1 	1 r   r   r2  )r   r   r   r   r   r  r   r   r   r   KeyValidatorr}    s    5r   r  c                   2    \ rS rSrSrSS jr\S 5       rSrg)HttpHeadersDict.ValueValidatori  zsEnsures that values in `HttpHeadersDict` are valid.

An instance is used as `HttpHeadersDict`'s `VALUE_VALIDATOR`.
Nc                   ^ [         R                  " S5      n[        U[        R                  5      (       a  [        X5      nO[        SU-  U5      nUR                  5       n[        [        R                  SS R                  S5      5      m[        U4S jU 5       5      (       d  [         R                  " S5      e[        R                  R                  X!5        U$ )a'  Returns a value, or raises an exception if the value is invalid.

According to `RFC 2616 section 4.2`_ header field values must consist "of
either *TEXT or combinations of token, separators, and quoted-string"::

    TEXT = <any OCTET except CTLs, but including LWS>

Args:
  value: HTTP header field value.
  key: HTTP header field name.

Returns:
  A value argument.

Raises:
  appinfo_errors.InvalidHttpHeaderValue: An argument cannot be used as an
      HTTP header value.

.. _RFC 2616, section 4.2:
   https://www.rfc-editor.org/rfc/rfc2616.txt
r  z%sNr>  rY  c              3   ,   >#    U  H	  oT;   v   M     g 7fr2  r   )r5  b	printables     r   r7  :HttpHeadersDict.ValueValidator.Validate.<locals>.<genexpr>  s     1Ais   z>HTTP header field values must consist of printable characters.)r   InvalidHttpHeaderValuer  r   r  r`  r  setstringr  rZ  allrx  ValueValidatorAssertHeaderNotTooLong)r   valuekeyerrorb_valuer  s        @r   r  'HttpHeadersDict.ValueValidator.Validate  s    . 33
>@e	E:22	3	3"50"D5L59 IIKc f&&s+227;<i111133LN 	N $$;;CGlr   c                 N   [        U < SU< S3R                  S5      5      nU[        R                  :  aK   [        R                  U    n[        U5      U:  a'  U [        U5      U4n[        R                  " SU-  5      eg g ! [
         a    [        R                  " S5      ef = f)Nz: z
rY  z'HTTP header (name + value) is too long.zD%r header value has length %d, which exceed the maximum allowed, %d.)lenrZ  rx  MAX_HEADER_LENGTHMAX_HEADER_VALUE_LENGTHSKeyErrorr   r  )r   r  header_lengthmax_leninserts        r   r  5HttpHeadersDict.ValueValidator.AssertHeaderNotTooLong  s    47??HIm
 
/;;	;	9#<<TB' u:UW,&55    
<  	95579 9	9s   B !B$r   r2  )	r   r   r   r   r   r  staticmethodr  r   r   r   r   r  r    s!    
,\  r   r  c                 f    U  H+  nUR                  5       UR                  5       :X  d  M'  X   s  $    g)a  Gets a header value.

Args:
  header_name: HTTP header name to look for.

Returns:
  A header value that corresponds to `header_name`. If more than one such
  value is in `self`, one of the values is selected arbitrarily and
  returned. The selection is not deterministic.
N)r  )r   header_namer   s      r   GetHttpHeadersDict.Get3  s-     	**,	,z r   c                    > U R                  U5      S L nU(       a@  [        U 5      U R                  :  a'  [        R                  " S[
        R                  -  5      e[        [
        U ]  X5        g )NzwTried to add another header when the current set of HTTP headers already has the maximum allowed number of headers, %d.)r  r  MAX_LENr   TooManyHttpHeadersrx  super__setitem__)r   r  r  is_addition	__class__s       r   r  HttpHeadersDict.__setitem__D  s_    ((3-4'Ks4yDLL0--D##$% % 
/4,S8r   r   )r   r   r   r   r   	frozensetr  r  %_MAX_HEADER_SIZE_FOR_EXEMPTED_HEADERS_MAX_COOKIE_LENGTH_MAX_URL_LENGTHr  r  r   	Validatorr  r  KEY_VALIDATORVALUE_VALIDATORr  r  r   __classcell__r  s   @r   rx  rx    s     ! "  !F#H;
/&'!# '<Z)) <|Kz++ KZ .-"$/"9 9r   rx  c                     ^  \ rS rSrSr\\R                  " \5      \	\R                  " \5      \
\R                  " \5      \\R                  " \5      \\R                  " \5      \\R                  " \5      \\R                  " \5      \\R                  " \5      \\R                  " \R*                  " \\5      5      \\R                  " \R*                  " \\4\\45      5      \\R                  " \R*                  " SSSS5      5      0r\R?                  \ R<                  5        \!" \"\#\$\%\/5      r&\\\	\\\\
4\\\\\\
4\'\\\\(40r)S r*S r+U 4S	 jr,S
 r-S r.S r/S r0Sr1U =r2$ )URLMapiN  a  Maps from URLs to handlers.

This class acts similar to a union type. Its purpose is to describe a mapping
between a set of URLs and their handlers. The handler type of a given instance
is determined by which `handler-id` attribute is used.

Every mapping can have one and only one handler type. Attempting to use more
than one `handler-id` attribute will cause an `UnknownHandlerType` to be
raised during validation. Failure to provide any `handler-id` attributes will
cause `MissingHandlerType` to be raised during validation.

The regular expression used by the `url` field will be used to match against
the entire URL path and query string of the request; therefore, partial maps
will not be matched. Specifying a `url`, such as `/admin`, is the same as
matching against the regular expression `^/admin$`. Don't start your matching
`url` with `^` or end them with `$`. These regular expressions won't be
accepted and will raise `ValueError`.

Attributes:
  login: Specifies whether a user should be logged in to access a URL.
      The default value of this argument is `optional`.
  secure: Sets the restriction on the protocol that can be used to serve this
      URL or handler. This value can be set to `HTTP`, `HTTPS` or `either`.
  url: Specifies a regular expression that is used to fully match against the
      request URLs path. See the "Special cases" section of this document to
      learn more.
  static_files: Specifies the handler ID attribute that maps `url` to the
      appropriate file. You can specify regular expression backreferences to
      the string matched to `url`.
  upload: Specifies the regular expression that is used by the application
      configuration program to determine which files are uploaded as blobs.
      Because it is difficult to determine this information using just the
      `url` and `static_files` arguments, this attribute must be included.
      This attribute is required when you define a `static_files` mapping. A
      matching file name must fully match against the `upload` regular
      expression, similar to how `url` is matched against the request path. Do
      not begin the `upload` argument with the `^` character or end it with
      the `$` character.
  static_dir: Specifies the handler ID that maps the provided `url` to a
      sub-directory within the application directory. See "Special cases."
  mime_type: When used with `static_files` and `static_dir`, this argument
      specifies that the MIME type of the files that are served from those
      directories must be overridden with this value.
  script: Specifies the handler ID that maps URLs to a script handler within
      the application directory that will run using CGI.
  position: Used in `AppInclude` objects to specify whether a handler should
      be inserted at the beginning of the primary handler list or at the end.
      If `tail` is specified, the handler is inserted at the end; otherwise,
      the handler is inserted at the beginning. This behavior implies that
      `head` is the effective default.
  expiration: When used with static files and directories, this argument
      specifies the time delta to use for cache expiration. This argument
      should use the following format: `4d 5h 30m 15s`, where each letter
      signifies days, hours, minutes, and seconds, respectively. The `s` for
      "seconds" can be omitted. Only one amount must be specified, though
      combining multiple amounts is optional. The following list contains
      examples of values that are acceptable: `10`, `1d 6h`, `1h 30m`,
      `7d 7d 7d`, `5m 30`.
  api_endpoint: Specifies the handler ID that identifies an endpoint as an API
      endpoint. Calls that terminate here will be handled by the API serving
      framework.

Special cases:
  When defining a `static_dir` handler, do not use a regular expression in the
  `url` attribute. Both the `url` and `static_dir` attributes are
  automatically mapped to these equivalents::

      <url>/(.*)
      <static_dir>/\1

  For example, this declaration...::

      url: /images
      static_dir: images_folder

  ...is equivalent to this `static_files` declaration::

      url: /images/(.*)
      static_files: images_folder/\1
      upload: images_folder/(.*)

301302303307c                 4    [        X R                  5       5      $ )zqGets the handler for a mapping.

Returns:
  The value of the handler, as determined by the handler ID attribute.
)getattrGetHandlerTyper   s    r   
GetHandlerURLMap.GetHandler  s     4,,.//r   c                 B   [        U [        5      b  [        nOI[        R                   H  n[        X5      c  M  Un  O$   [        R
                  " S[        U 5      -  5      e[        R                  U   nU R                   HR  n[        X5      c  M  XC;   a  M  U[        R                  ;   a  M.  XA:X  a  M5  [        R                  " SU< SU< S35      e   U[        :X  a>  U R                  (       d-  [        R                  " S[        < SU R                  < S35      eU$ )a  Gets the handler type of a mapping.

Returns:
  The handler type as determined by which handler ID attribute is set.

Raises:
  UnknownHandlerType: If none of the handler ID attributes are set.
  UnexpectedHandlerAttribute: If an unexpected attribute is set for the
      discovered handler type.
  HandlerTypeMissingAttribute: If the handler is missing a required
      attribute for its handler type.
  MissingHandlerAttribute: If a URL handler is missing an attribute.
zUnknown url handler type.
%szUnexpected attribute "z" for mapping type r%   z	Missing "z" attribute for URL "z".)r  HANDLER_API_ENDPOINTr  ALLOWED_FIELDSr   UnknownHandlerTypestrrv  COMMON_FIELDSUnexpectedHandlerAttributeHANDLER_STATIC_FILESr<   MissingHandlerAttributeUPLOADr8   )r   mapping_typeid_fieldallowed_fields	attributes        r   r  URLMap.GetHandlerType  s      t)*6)l++(4".!,
 , //+c$i79 	9 **<8N __	
$
"
.*F000(77&' 	' % ++DKK224:DHH
EG G r   c                    > [         [        U ]  5         U R                  5       [        [
        4;   a  U R                  5         gg)aY  Adds additional checking to make sure a handler has correct fields.

In addition to normal `ValidatedCheck`, this method calls `GetHandlerType`,
which validates whether all of the handler fields are configured properly.

Raises:
  UnknownHandlerType: If none of the handler ID attributes are set.
  UnexpectedHandlerAttribute: If an unexpected attribute is set for the
      discovered handler type.
  HandlerTypeMissingAttribute: If the handler is missing a required
      attribute for its handler type.
  ContentTypeSpecifiedMultipleTimes: If `mime_type` is inconsistent with
      `http_headers`.
N)r  r  CheckInitializedr  
STATIC_DIRSTATIC_FILESAssertUniqueContentTyper   r  s    r   r  URLMap.CheckInitialized
  s;     
&$(*\ :: ""$ ;r   c                     U R                   =(       a    U R                  nU(       d  gU R                  R                  S5      nUb)  [        R                  " SU< SU R                   < S35      eg)a  Makes sure that `self.http_headers` is consistent with `self.mime_type`.

This method assumes that `self` is a static handler, either
`self.static_dir` or `self.static_files`. You cannot specify `None`.

Raises:
  appinfo_errors.ContentTypeSpecifiedMultipleTimes: If `self.http_headers`
      contains a `Content-Type` header, and `self.mime_type` is set. For
      example, the following configuration would be rejected::

          handlers:
          - url: /static
            static_dir: static
            mime_type: text/html
            http_headers:
              content-type: text/html


    As this example shows, a configuration will be rejected when
    `http_headers` and `mime_type` specify a content type, even when they
    specify the same content type.
NzContent-Typez/http_header specified a Content-Type header of z1 in a handler that also specified a mime_type of r%   )r=   r?   r  r   !ContentTypeSpecifiedMultipleTimes)r   used_both_fieldscontent_types      r   r  URLMap.AssertUniqueContentType(  sd    . ~~;$*;*;$$((8L<<2>PQ Q  r   c                 D    U R                   [        :X  a  [        U l         gg)zForces omitted `secure` handler fields to be set to 'secure: optional'.

The effect is that `handler.secure` is never equal to the nominal default.
N)r7   rs  rr  r   s    r   FixSecureDefaultsURLMap.FixSecureDefaultsI  s     {{n$(dk %r   c                 R    U R                   S:X  a  [        R                  " S5        gg)zGenerates a warning for reserved URLs.

See the `version element documentation`_ to learn which URLs are reserved.

.. _`version element documentation`:
   https://cloud.google.com/appengine/docs/python/config/appref#syntax
z/formz9The URL path "/form" is reserved and will not be matched.N)r8   loggingwarningr   s    r   WarnReservedURLsURLMap.WarnReservedURLsR  s%     xx7oo
EG r   c                 R    U R                   (       a  [        R                  " S5      eg)zRaises an error if position is specified outside of AppInclude objects.

Raises:
  PositionUsedInAppYamlHandler: If the `position` attribute is specified for
      an `app.yaml` file instead of an `include.yaml` file.
zThe position attribute was specified for this handler, but this is an app.yaml file.  Position attribute is only valid for include.yaml files.N)r9   r   PositionUsedInAppYamlHandlerr   s    r   ErrorOnPositionForAppInfo URLMap.ErrorOnPositionForAppInfo^  s(     }}77 ! ! r   )r7   )3r   r   r   r   r   r  r   re  ru  r  APPLICATION_READABLEboolHANDLER_STATIC_DIR	MIME_TYPEr  
EXPIRATION_EXPIRATION_REGEXREQUIRE_MATCHING_FILEHTTP_HEADERSrx  POSITIONrh  POSITION_HEADPOSITION_TAILr  ON
ON_ALIASESOFFOFF_ALIASESREDIRECT_HTTP_RESPONSE_CODErv  updaterb  r  rd  rg  rl  ro  r  rt  SCRIPTr  r  r  r  r  r  r  r  r   r  r  s   @r   r  r  N  s   Qj J//=j!!,/J//5 *--l; $$S)*%%&78Z006J''8 
##J$6$6}7D%F G J//
0B0Bz

1  ":#6#6z7I7I
u8& $'1*6 K**+	5"F,GI J- Y
2L13 9j2G')=?xXv..03j%<QB)
G! !r   r  c                   $    \ rS rSrSr\\\\0r	Sr
g)AdminConsolePageil  zFClass representing the admin console page in an `AdminConsole` object.r   N)r   r   r   r   r   rd  rf  NAME_PAGE_NAME_REGEXrv  r   r   r   r   r  r  l  s    N	:
*r   r  c                   p    \ rS rSrSr\\R                  " \R                  " \	5      5      0r
\S 5       rSrg)AdminConsoleit  zCClass representing an admin console directives in application info.c                     U(       a  U(       d  U=(       d    U$ UR                   (       a8  UR                   (       a%  UR                   R                  UR                   5        U$ UR                   Ul         U$ )z9Returns the result of merging two `AdminConsole` objects.)r   extend)clsadminconsole_oneadminconsole_twos      r   MergeAdminConsole.Mergez  sb     #31!11			%%&6&<&<=   055r   r   N)r   r   r   r   r   PAGESr   re  Repeatedr  rv  classmethodr  r   r   r   r   r  r  t  s<    KZ  !4!45E!FG*  r   r  c                   h    \ rS rSrSr\\R                  " \5      \	\
\\R                  " \5      0rSrg)ErrorHandlersi  z@Class representing error handler directives in application info.r   N)r   r   r   r   r   
ERROR_CODEr   re  _ERROR_CODE_REGEXFILEru  r  r  rv  r   r   r   r   r  r    s2    H*%%&78
L$$S)*r   r  c            	          ^  \ rS rSrSr " S S\5      r\" \R                  " \R                  " \
\4\\45      5      5      rU 4S jrU 4S jrS rU 4S jrS	 r\S
 5       r\S 5       r\SS j5       rSrU =r$ )BuiltinHandleri  zClass representing built-in handler directives in application info.

This class permits arbitrary keys, but their values must be described by the
`validation.Options` object that is returned by `ATTRIBUTES`.
c                   *    \ rS rSrSrS rS rS rSrg) BuiltinHandler.DynamicAttributesi  zProvides a dictionary object that will always claim to have a key.

This dictionary returns a fixed value for any `get` operation. The fixed
value that you pass in as a constructor parameter should be a
`validation.Validated` object.
c                 :    Xl         [        R                  X5        g r2  ) _DynamicAttributes__return_valuedictr   )r   return_value
parameterss      r   r   )BuiltinHandler.DynamicAttributes.__init__  s    (
mmD%r   c                     g)NTr   r   _s     r   __contains__-BuiltinHandler.DynamicAttributes.__contains__  s    r   c                     U R                   $ r2  )r   r&  s     r   __getitem__,BuiltinHandler.DynamicAttributes.__getitem__  s       r   )__return_valueN)	r   r   r   r   r   r   r(  r+  r   r   r   r   DynamicAttributesr    s    &!r   r.  c                 <   > SU l         [        [        U ]  " S0 UD6  g)zEnsures all BuiltinHandler objects at least use the `default` attribute.

Args:
  **attributes: The attributes that you want to use.
r?  Nr   )builtin_namer  r  r   )r   
attributesr  s     r   r   BuiltinHandler.__init__  s     D	.$(6:6r   c                    > US:X  a  [         R                  XU5        gU R                  (       d)  SU R                  U'   Xl        [        [
        U ]  X5        g[        R                  " S5      e)a  Allows `ATTRIBUTES.iteritems()` to return set of items that have values.

Whenever `validate` calls `iteritems()`, it is always called on
`ATTRIBUTES`, not on `__dict__`, so this override is important to ensure
that functions such as `ToYAML()` return the correct set of keys.

Args:
  key: The key for the `iteritem` that you want to set.
  value: The value for the `iteritem` that you want to set.

Raises:
  MultipleBuiltinsSpecified: If more than one built-in is defined in a list
      element.
r0  r?  z[More than one builtin defined in list element.  Each new builtin should be prefixed by "-".N)object__setattr__r0  rv  r  r  r   MultipleBuiltinsSpecified)r   r  r  r  s      r   r5  BuiltinHandler.__setattr__  sc     nE*doocND-c9 44'( (r   c                 <    UR                  S5      (       a  [        eg )Nr'  )r  r]  )r   r  s     r   __getattr__BuiltinHandler.__getattr__  s    
~~c r   c                 b   >  [         [        U ]  U5      $ ! [         a    [	        X5      s $ f = fr2  )r  r  GetUnnormalizedr]  r  )r   r  r  s     r   r<  BuiltinHandler.GetUnnormalized  s4     >48==  T s    ..c                 D    U R                   [        X R                   5      0$ )zuConverts a `BuiltinHander` object to a dictionary.

Returns:
  A dictionary in `{builtin_handler_name: on/off}` form
r0  r  r   s    r   ToDictBuiltinHandler.ToDict  s      wt->->?@@r   c                 :    U H  nUR                   U:X  d  M    g   g)a|  Finds if a builtin is defined in a given list of builtin handler objects.

Args:
  builtins_list: A list of `BuiltinHandler` objects, typically
      `yaml.builtins`.
  builtin_name: The name of the built-in that you want to determine whether
      it is defined.

Returns:
  `True` if `builtin_name` is defined by a member of `builtins_list`; all
  other results return `False`.
TFr0  )r  builtins_listr0  r  s       r   	IsDefinedBuiltinHandler.IsDefined  s"     	
<	'  r   c                 n    U Vs/ s H#  o"R                   [        X"R                   5      4PM%     sn$ s  snf )zConverts a list of `BuiltinHandler` objects.

Args:
  builtins_list: A list of `BuildinHandler` objects to convert to tuples.

Returns:
  A list of `(name, status)` that is derived from the `BuiltinHandler`
  objects.
r?  )r  rD  r  s      r   ListToTuplesBuiltinHandler.ListToTuples"  s.     CPP-Q^^WQ78-PPPs   *2c                    [        5       nU H  nUR                  (       d  [        R                  " SU-  5      eUR                  U;   a#  [        R                  " SUR                  -  5      eUR                  S:X  a  US:X  a  [
        R                  " S5        O,UR                  S:X  a  US:X  a  [
        R                  " S5        UR                  UR                  5        M     g)	a  Verifies that all `BuiltinHandler` objects are valid and not repeated.

Args:
  builtins_list: A list of `BuiltinHandler` objects to validate.
  runtime: If you specify this argument, warnings are generated for
      built-ins that have been deprecated in the given runtime.

Raises:
  InvalidBuiltinFormat: If the name of a `BuiltinHandler` object cannot be
      determined.
  DuplicateBuiltinsSpecified: If a `BuiltinHandler` name is used more than
      once in the list.
z;Name of builtin for list object %s could not be determined.z9Builtin %s was specified more than once in one yaml file.datastore_adminrL  zThe datastore_admin builtin is deprecated. You can find information on how to enable it through the Administrative Console here: http://developers.google.com/appengine/docs/adminconsole/datastoreadmin.html	mapreducezThe mapreduce builtin is deprecated. You can find more information on how to configure and use it here: http://developers.google.com/appengine/docs/python/dataprocessing/overview.htmlN)r  r0  r   InvalidBuiltinFormatDuplicateBuiltinsSpecifiedr  r  add)r  rD  rY   seenr  s        r   r  BuiltinHandler.Validate/  s     5D^^11I 	 
4	77Gnn 	 
,	,H1D"	# >>[(W-@	 hhq~~; r   rC  r2  )r   r   r   r   r   r!  r.  r   re  rh  r  r   r  r  rv  r   r5  r9  r<  r@  r  rE  rH  r  r   r  r  s   @r   r  r    s    D!$ !$ !*,,b*-=.1;-?A BC*7(< A  $ 
Q 
Q , ,r   r  c                       \ rS rSrSr\R                  r\R                  \\	R                  " \5      \\	R                  " \5      05        Srg)ApiConfigHandleri_  zGClass representing `api_config` handler directives in application info.r   N)r   r   r   r   r   rb  rv  r  rd  r   Regexrf  rt  ru  r   r   r   r   rS  rS  _  sC    O%%*	:J'j&&|4 r   rS  c                   v   ^  \ rS rSrSr\R                  " \5      \R                  " \5      S.rU 4S jr	Sr
U =r$ )Libraryii  z9Class representing the configuration of a single library.r   rV   c                   > [         [        U ]  5         U R                  [        ;  a#  [
        R                  " SU R                  -  5      e[        U R                     nU R                  S:X  a  UR                  U l        gU R                  UR                  ;  aP  [
        R                  " S[        -   U R                  U R                  SR                  UR                  5      4-  5      eU R                  UR                  ;   aP  SR                  UR                  5      n[        R                   " S[        -   U R                  U R                  U5        gg)zDetermines if the library configuration is not valid.

Raises:
  appinfo_errors.InvalidLibraryName: If the specified library is not
      supported.
  appinfo_errors.InvalidLibraryVersion: If the specified library version is
      not supported.
z!the library "%s" is not supportedr9  z"%s version "%s" is not supported, z", "z%s version "%s" is deprecated, N)r  rV  r  r   _NAME_TO_SUPPORTED_LIBRARYr   InvalidLibraryNamerV   r   r   InvalidLibraryVersion_USE_VERSION_FORMATjoinr   r   r  r  )r   supported_libraryuse_versr  s      r   r  Library.CheckInitializedo  s    
'4)+yy22--
-		
9; ;2499=||x&55dl	.AA	A00/2EEiillkk+CCDJF FG G
 
*>>	>.FFGhoo
+.A
A
))
,,
	 
?r   )rV   )r   r   r   r   r   r   Typer  rv  r  r   r  r  s   @r   rV  rV  i  s/    A",%??3/1* r   rV  c            	           \ rS rSrSr\\R                  " \R                  " SS\	5      5      \
\R                  " \R                  " S\R                  5      5      0rSrg)CpuUtilizationi  z;Class representing the configuration of VM CPU utilization.gư>g      ?r   r   N)r   r   r   r   r   CPU_UTILIZATION_UTILIZATIONr   re  Rangefloat-CPU_UTILIZATION_AGGREGATION_WINDOW_LENGTH_SECsysmaxsizerv  r   r   r   r   rc  rc    sT    C ":#6#6


4e
,$.3Z5H5H


1ckk
*6,*r   rc  c                      ^  \ rS rSrSr\\R                  " \5      \	\R                  " \
5      \\R                  " \R                  5      \\R                  " \R                  5      \\R                  " \R                   5      0rU 4S jrSrU =r$ )CustomMetrici  z4Class representing CustomMetrics in AppInfoExternal.c                   > [         [        U ]  5         [        U R                  5      (       a=  [        U R
                  5      (       a#  [        R                  " S[        -  [        45      e[        U R                  5      (       d>  [        U R
                  5      (       d#  [        R                  " S[        -  [        45      egg)zDetermines if the CustomMetric is not valid.

Raises:
  appinfo_errors.TooManyAutoscalingUtilizationTargetsError: If too many
  scaling targets are set.
  appinfo_errors.NotEnoughAutoscalingUtilizationTargetsError: If no scaling
  targets are set.
z&There may be only one of '%s' or '%s'.z"There must be one of '%s' or '%s'.N)r  rk  r  r  r   r   r   )TooManyAutoscalingUtilizationTargetsErrorCUSTOM_METRIC_UTILIZATIONSINGLE_INSTANCE_ASSIGNMENT+NotEnoughAutoscalingUtilizationTargetsErrorr  s    r   r  CustomMetric.CheckInitialized  s     
,.0D##$$d.M.M)N)NDD36OO%'( ( 4**++42233FF/2KK%'( ( 4 ,r   r   )r   r   r   r   r   METRIC_NAMEr   rT  _NON_WHITE_SPACE_REGEXTARGET_TYPETARGET_TYPE_REGEXrn  re  
TYPE_FLOATro  FILTERTYPE_STRrv  r  r   r  r  s   @r   rk  rk    s}    < :##$:;:##$56!4!4Z5J5J!K *"5"5j6K6K"Lj!!*"5"56*( (r   rk  c            
          ^  \ rS rSrSr\\R                  " \5      \	\R                  " \R                  " \\5      5      \\R                  " \5      \\R                  " \R                   5      0rU 4S jrSrU =r$ )EndpointsApiServicei  z:Class representing EndpointsApiService in AppInfoExternal.c                   > [         [        U ]  5         U R                  [        :w  a#  U R
                  c  [        R                  " S5      eU R                  [        :X  a$  U R
                  b  [        R                  " S5      egg)a<  Determines if the Endpoints API Service is not valid.

Raises:
  appinfo_errors.MissingEndpointsConfigId: If the config id is missing when
      the rollout strategy is unspecified or set to "fixed".
  appinfo_errors.UnexpectedEndpointsConfigId: If the config id is set when
      the rollout strategy is "managed".
NzRconfig_id must be specified when rollout_strategy is unspecified or set to "fixed"z@config_id is forbidden when rollout_strategy is set to "managed")	r  rz  r  r   ROLLOUT_STRATEGY_MANAGEDr   r   MissingEndpointsConfigIdUnexpectedEndpointsConfigIdr  s    r   r  $EndpointsApiService.CheckInitialized  s     

t57!9933  

#;
;
..
$66
LN N % <r   r   )r   r   r   r   r   ENDPOINTS_NAMEr   rT  rs  ROLLOUT_STRATEGYre  rh  ROLLOUT_STRATEGY_FIXEDr|  	CONFIG_IDTRACE_SAMPLING	TYPE_BOOLrv  r  r   r  r  s   @r   rz  rz    s{    B


1
2


  !7!9;< 


4
5


j22
3*N Nr   rz  c                      \ rS rSrSr0 \\R                  " \5      _\	\R                  " \5      _\
\R                  " \5      _\\R                  " \5      _\\R                  " \5      _\\R                  " \R                   " S\R$                  5      5      _\\R                  " \R                   " S\R$                  5      5      _\\R                  " \R                   " S\R$                  \5      5      _\\R                  " \5      _\\R                  " \R2                  5      _\\R                  " \R2                  5      _\\R                  " \R8                  5      _\\R                  " \R8                  5      _\\R                  " \R                   " S\R$                  5      5      _\\R                  " \R                   " S\R$                  5      5      _\ \R                  " \R                   " S\R$                  5      5      _\!\R                  " \R                   " S\R$                  5      5      _\"\R                  " \R                   " S\R$                  5      5      \#\R                  " \R                   " S\R$                  5      5      \$\R                  " \R                   " S\R$                  5      5      \%\R                  " \R                   " S\R$                  5      5      \&\R                  " \R                   " S\R$                  5      5      \'\R                  " \R                   " S\R$                  5      5      \(\R                  " \RR                  " \*5      5      0Er+Sr,g)AutomaticScalingi  zAClass representing automatic scaling settings in AppInfoExternal.r   r   r   N)-r   r   r   r   r   MINIMUM_IDLE_INSTANCESr   re  _IDLE_INSTANCES_REGEXMAXIMUM_IDLE_INSTANCESMINIMUM_PENDING_LATENCY_PENDING_LATENCY_REGEXMAXIMUM_PENDING_LATENCYMAXIMUM_CONCURRENT_REQUEST_CONCURRENT_REQUESTS_REGEXMIN_NUM_INSTANCESre  rh  ri  MAX_NUM_INSTANCESCOOL_DOWN_PERIOD_SECintCPU_UTILIZATIONrc  STANDARD_MAX_INSTANCESTYPE_INTSTANDARD_MIN_INSTANCESSTANDARD_TARGET_CPU_UTILIZATIONrv  &STANDARD_TARGET_THROUGHPUT_UTILIZATION!TARGET_NETWORK_SENT_BYTES_PER_SEC#TARGET_NETWORK_SENT_PACKETS_PER_SEC%TARGET_NETWORK_RECEIVED_BYTES_PER_SEC'TARGET_NETWORK_RECEIVED_PACKETS_PER_SECTARGET_DISK_WRITE_BYTES_PER_SECTARGET_DISK_WRITE_OPS_PER_SECTARGET_DISK_READ_BYTES_PER_SECTARGET_DISK_READ_OPS_PER_SECTARGET_REQUEST_COUNT_PER_SECTARGET_CONCURRENT_REQUESTSCUSTOM_METRICSr  rk  rv  r   r   r   r   r  r    s,   I1


3
41 


3
4	1
 


4
51 


4
51 !


8
91 


j..q#++>
?1 


j..q#++>
?1  


j..r3;;D
E#1$ 


n
-'1( 


j11
2+1, 


j11
2/10 &


j33
4314 -


j33
4718 (


j..q#++>
?;1< *


j..q#++>
??1@ ,


j..q#++>
?C1D .


j..q#++>
?G1H &


j..q#++>
?#


j..q#++>
?$


j..q#++>
?"


j..q#++>
?"


j..q#++>
? 


j..q#++>
?j))**=*=l*KLa1*r   r  c                   @    \ rS rSrSr\\R                  " \5      0r	Sr
g)ManualScalingi  z>Class representing manual scaling settings in AppInfoExternal.r   N)r   r   r   r   r   	INSTANCESr   rT  _INSTANCES_REGEXrv  r   r   r   r   r  r    s    F!!"23*r   r  c                   d    \ rS rSrSr\\R                  " \5      \	\R                  " \5      0rSrg)BasicScalingi  z=Class representing basic scaling settings in AppInfoExternal.r   N)r   r   r   r   r   MAX_INSTANCESr   rT  r  IDLE_TIMEOUTre  _IDLE_TIMEOUT_REGEXrv  r   r   r   r   r  r    s.    EZ%%&67J''(;<*r   r  c                   @    \ rS rSrSr\R                  " S5      r\r	Sr
g)RuntimeConfigi"  zClass for "vanilla" runtime configuration.

Fields used vary by runtime, so validation is delegated to the per-runtime
build processes.

These are intended to be used during Dockerfile generation, not after VM boot.
[a-zA-Z_][a-zA-Z0-9_]*r   N)r   r   r   r   r   r   rT  r  r  r  r   r   r   r   r  r  "  s     ""#;<-/r   r  c                   d    \ rS rSrSr\\R                  " S5      \\R                  " \
5      0rSrg)FlexibleRuntimeSettingsi.  z/Class for App Engine Flexible runtime settings.z	[a-z0-9]+r   N)r   r   r   r   r   OPERATING_SYSTEMr   rT  RUNTIME_VERSIONre  r  rv  r   r   r   r   r  r  .  s,    7
((5z**3/*r   r  c                   P    \ rS rSrSr\R                  " S5      r\r	\
S 5       rSrg)
VmSettingsi5  ztClass for VM settings.

The settings are not further validated here. The settings are validated on
the server side.
r  c                     U=(       d    0 R                  5       nUR                  U=(       d    0 5        U(       a  [        S0 UD6$ S$ )ai  Merges two `VmSettings` instances.

If a variable is specified by both instances, the value from
`vm_settings_one` is used.

Args:
  vm_settings_one: The first `VmSettings` instance, or `None`.
  vm_settings_two: The second `VmSettings` instance, or `None`.

Returns:
  The merged `VmSettings` instance, or `None` if both input instances are
  `None` or empty.
Nr   )copyr  r  )r  vm_settings_onevm_settings_tworesult_vm_settingss       r   r  VmSettings.Merge?  sC      */R557 o34/A:+*+KtKr   r   Nr   r   r   r   r   r   rT  r  r  r  r  r  r   r   r   r   r  r  5  s3     ""#;<-/L Lr   r  c                   (    \ rS rSrSr\S 5       rSrg)BetaSettingsiW  a  Class for Beta (internal or unreleased) settings.

This class is meant to replace `VmSettings` eventually.

Note:
    All new beta settings must be registered in `shared_constants.py`.

These settings are not validated further here. The settings are validated on
the server side.
c                 p    [         R                  X5      nU(       a  [        S0 UR                  5       D6$ S$ )a  Merges two `BetaSettings` instances.

Args:
  beta_settings_one: The first `BetaSettings` instance, or `None`.
  beta_settings_two: The second `BetaSettings` instance, or `None`.

Returns:
  The merged `BetaSettings` instance, or `None` if both input instances are
  `None` or empty.
Nr   )r  r  r  r@  )r  beta_settings_onebeta_settings_twomergeds       r   r  BetaSettings.Mergec  s0     /CF.4<*&--/*>$>r   r   N)r   r   r   r   r   r  r  r   r   r   r   r  r  W  s    	 ? ?r   r  c                   P    \ rS rSrSr\R                  " S5      r\r	\
S 5       rSrg)EnvironmentVariablesis  zEClass representing a mapping of environment variable key/value pairs.r  c                     U=(       d    0 R                  5       nUR                  U=(       d    0 5        U(       a  [        S0 UD6$ S$ )a  Merges two `EnvironmentVariables` instances.

If a variable is specified by both instances, the value from
`env_variables_two` is used.

Args:
  env_variables_one: The first `EnvironmentVariables` instance or `None`.
  env_variables_two: The second `EnvironmentVariables` instance or `None`.

Returns:
  The merged `EnvironmentVariables` instance, or `None` if both input
  instances are `None` or empty.
Nr   )r  r  r  )r  env_variables_oneenv_variables_tworesult_env_variabless       r   r  EnvironmentVariables.Mergey  sJ      .399; 1 7R8# !8#78 /)-/r   r   Nr  r   r   r   r  r  s  s-    M""#;<-// /r   r  c                 @   U R                  SS5      nUS   n[        R                  " [        U5      (       d  [        R
                  " SU-  5      e[        U5      S:X  a?  US   n[        R                  " [        U5      (       d  [        R
                  " SU-  5      egg)	zDetermines if a source reference is valid.

Args:
  ref: A source reference in the following format:
      `[repository_uri#]revision`.

Raises:
  ValidationError: If the reference is malformed.
#r   zBad revision identifier: %s   r   zBad repository URI: %sN)splitrer  SOURCE_REVISION_RE_STRINGr   ValidationErrorr  SOURCE_REPO_RE_STRING)refrepo_revisionrevision_iduris       r   ValidateSourceReferencer    s     ))C#-b!+	+[	9	9

$
$%B%0&1 2 2 	1

C88)3//&&'?#'EFF 0 r   c                     [        U 5      [        :  a(  [        R                  " S[        U 5      [        4-  5      eU R	                  5        H  n[        UR                  5       5        M     g)zDetermines if `source_refs` contains a valid list of source references.

Args:
  source_refs: A multi-line string containing one source reference per line.

Raises:
  ValidationError: If the reference is malformed.
z9Total source reference(s) size exceeds the limit: %d > %dN)r  SOURCE_REFERENCES_MAX_SIZEr   r  
splitlinesr  strip)source_refsr  s     r   &ValidateCombinedSourceReferencesStringr    sa     	22

$
$C8G: 	:; ; ##%cCIIK( &r   c                   N   \ rS rSrSr\\R                  " \R                  5      \	\R                  " \R                  " S\R                  5      5      \\R                  " \R                  " S\R                  5      5      \\R                  " \R                  " S\R                  5      5      \\R                  " \R                  " S\R                  5      5      \\R                  " \R                  " S\R                  5      5      \\R                  " \R$                  5      0rSrg)HealthChecki  z2Class representing the health check configuration.r   r   N)r   r   r   r   r   ENABLE_HEALTH_CHECKr   re  r  CHECK_INTERVAL_SECre  rh  ri  TIMEOUT_SECUNHEALTHY_THRESHOLDHEALTHY_THRESHOLDRESTART_THRESHOLDHOSTrx  rv  r   r   r   r   r  r    s    ::..z/C/CD*--j.>.>q#++.NO:&&z'7'73;;'GH:..


1ckk
*,,,Z-=-=a-MN,,Z-=-=a-MN
J
 3 346*r   r  c                   N   \ rS rSrSr\\R                  " \R                  " S\	R                  5      5      \\R                  " \R                  " S\	R                  5      5      \\R                  " \R                  " S\	R                  5      5      \\R                  " \R                  " S\	R                  5      5      \\R                  " \R                  " S\	R                  5      5      \\R                  " \R                   5      \\R                  " \R                   5      0rSrg)LivenessChecki  z4Class representing the liveness check configuration.r   r   N)r   r   r   r   r   r  r   re  re  rh  ri  r  FAILURE_THRESHOLDSUCCESS_THRESHOLDINITIAL_DELAY_SECPATHrx  r  rv  r   r   r   r   r  r    s    <*--j.>.>q#++.NO:&&z'7'73;;'GH,,Z-=-=a-MN,,Z-=-=a-MN,,Z-=-=a-MN
J
 3 34
J
 3 346*r   r  c                   N   \ rS rSrSr\\R                  " \R                  " S\	R                  5      5      \\R                  " \R                  " S\	R                  5      5      \\R                  " \R                  " S\	R                  5      5      \\R                  " \R                  " S\	R                  5      5      \\R                  " \R                  " S\	R                  5      5      \\R                  " \R                   5      \\R                  " \R                   5      0rSrg)ReadinessChecki  z5Class representing the readiness check configuration.r   r   N)r   r   r   r   r   r  r   re  re  rh  ri  r  APP_START_TIMEOUT_SECr  r  r  rx  r  rv  r   r   r   r   r  r    s    =*--j.>.>q#++.NO:&&z'7'73;;'GHZ00


1ckk
*,,,Z-=-=a-MN,,Z-=-=a-MN
J
 3 34
J
 3 346*r   r  c                       \ rS rSrSrSrg)VmHealthChecki  zClass representing the configuration of the VM health check.

Note:
    This class is deprecated and will be removed in a future release. Use
    `HealthCheck` instead.
r   N)r   r   r   r   r   r   r   r   r   r  r    s     r   r  c                   d    \ rS rSrSr\\R                  \\R                  \
\R                  0rSrg)Volumei  z1Class representing the configuration of a volume.r   N)r   r   r   r   r   VOLUME_NAMEr   rx  SIZE_GBrv  VOLUME_TYPErv  r   r   r   r   r  r    s/    9 :&&z$$:&&*r   r  c                      \ rS rSrSr\\R                  " \R                  5      \	\R                  " \R                  5      \
\R                  " \R                  5      \\R                  " \R                  " \5      5      0rSrg)	Resourcesi  z5Class representing the configuration of VM resources.r   N)r   r   r   r   r   CPUr   re  rv  	MEMORY_GBDISK_SIZE_GBr  VOLUMESr  r  rv  r   r   r   r   r  r    sk    = 
:z445$$Z%:%:;J''
(;(;<z"":#6#6v#>?	*r   r  c                      \ rS rSrSr\\R                  " \R                  " \R                  " S5      5      5      \
\R                  " \R                  " \5      5      \\R                  " \R                  " \5      5      \\R                  " \R                  " \5      5      \\R                  " \5      \\R                  " \R                  " \5      5      0rSrg)Networki  z0Class representing the VM network configuration.z[0-9]+(:[0-9]+)?(/(udp|tcp))?r   N)r   r   r   r   r   FORWARDED_PORTSr   re  r  rT  INSTANCE_TAGGCE_RESOURCE_NAME_REGEXNETWORK_NAMEGCE_RESOURCE_PATH_REGEXSUBNETWORK_NAMESESSION_AFFINITYr  INSTANCE_IP_MODEFLEX_INSTANCE_IP_MODE_REGEXrv  r   r   r   r   r   r     s    8 


!!""#BCEF 


j../FG
H


j../FG
H


j../FG
H


d
#


j../JK
L*r   r   c            	           \ rS rSrSr\\R                  " \5      \	\R                  " \R                  " \\5      5      0rSrg)VpcAccessConnectori  z:Class representing the VPC Access connector configuration.r   N)r   r   r   r   r   VPC_ACCESS_CONNECTOR_NAMEr   rT  VPC_ACCESS_CONNECTOR_NAME_REGEX#VPC_ACCESS_CONNECTOR_EGRESS_SETTINGre  rh  /VPC_ACCESS_CONNECTOR_EGRESS_SETTING_ALL_TRAFFIC7VPC_ACCESS_CONNECTOR_EGRESS_SETTING_PRIVATE_RANGES_ONLYrv  r   r   r   r   r  r    sG    B  


:
;)


  AIKL	*r   r  c            
           \ rS rSrSr\\R                  " \R                  5      \	\R                  " \R                  5      \
\R                  " \R                  " \5      5      0rSrg)VpcAccessNetworkInterfacei   zA Direct VPC network interface.r   N)r   r   r   r   r   VPC_ACCESS_NETWORKr   re  rx  VPC_ACCESS_SUBNETVPC_ACCESS_TAGSrT  VPC_ACCESS_TAGS_REGEXrv  r   r   r   r   r  r     sY    ' *--j.A.AB,,Z-@-@Az**


0
1*r   r  c            	           \ rS rSrSr\\R                  " \5      \	\R                  " \R                  " \\5      5      0rSrg)	VpcAccessi,  zA Direct VPC configuration.r   N)r   r   r   r   r   VPC_ACCESS_NETWORK_INTERFACEr   re  r  VPC_EGRESS_SETTINGrh  VPC_EGRESS_SETTING_ALL_TRAFFIC&VPC_EGRESS_SETTING_PRIVATE_RANGES_ONLYrv  r   r   r   r   r  r  ,  sG    # #J$7$7
#% *--


,4	
*r   r  c                   R   \ rS rSrSr\\R                  " \R                  " \	5      5      \
\R                  " \R                  " \5      5      \\R                  " \R                  " \5      / S9\\R                  " \5      \\R                  " \5      \\R                  " \5      \\R                  " \5      \\R                  " \5      \\R                  " \5      \\R                  " \5      \\R:                  " \S90r\ S 5       r!\ S 5       r"\ S 5       r#\ S 5       r$\%S 5       r&S	r'g
)
AppIncludei<  zClass representing the contents of an included `app.yaml` file.

This class is used for both `builtins` and `includes` directives.
rc  c                     S nU" U5      (       d  U" U5      (       a/  [        U" U5      U" U5      5      n[        [        U5      S9Ul        U$ )a  Takes the greater of `<manual_scaling.instances>` from the arguments.

`appinclude_one` is mutated to be the merged result in this process.

Also, this function must be updated if `ManualScaling` gets additional
fields.

Args:
  appinclude_one: The first object to merge. The object must have a
      `manual_scaling` field that contains a `ManualScaling()`.
  appinclude_two: The second object to merge. The object must have a
      `manual_scaling` field that contains a `ManualScaling()`.
Returns:
  An object that is the result of merging
  `appinclude_one.manual_scaling.instances` and
  `appinclude_two.manual_scaling.instances`; this is returned as a revised
  `appinclude_one` object after the mutations are complete.
c                     U R                   (       a:  U R                   R                  (       a  [        U R                   R                  5      $ g)aF  Determines the number of `manual_scaling.instances` sets.

Args:
  appinclude: The include for which you want to determine the number of
      `manual_scaling.instances` sets.

Returns:
  The number of instances as an integer. If the value of
  `manual_scaling.instances` evaluates to False (e.g. 0 or None), then
  return 0.
r   )rG   r   r  )
appincludes    r   
_Instances1AppInclude.MergeManualScaling.<locals>._Instancesj  s6     
	"	"$$..Z..889
9r   )r   )maxr  r  rG   )r  appinclude_oneappinclude_twor"  r   s        r   MergeManualScalingAppInclude.MergeManualScalingU  sK    *& .!!Z%?%?j0*^2LMi&3c)n&Mn#r   c                 h   [         R                  X5        [        R                  UR                  UR                  5      Ul        UR
                  =(       d    UR
                  Ul        [        R                  UR                  UR                  5      Ul        [        US5      (       a/  [        R                  UR                  UR                  5      Ul
        [        R                  UR                  UR                  5      Ul        U R                  UR                  UR                  5      Ul        U$ )zThis function performs common merge operations.

Args:
  one: The first object that you want to merge.
  two: The second object that you want to merge.

Returns:
  An updated `one` object containing all merged data.
rL   )r  r'  r  r  rm   rI   r  rJ   hasattrr  rL   r  ru   MergeSkipFilesrg   )r  onetwos      r   _CommonMergeOpsAppInclude._CommonMergeOps  s     !!#+ %**3+<+<+.+<+<>C
 VVsvvCF !&&s'*8CO sO$$&,,S->->-0->->@c
 -2233D3D363D3DFC ''GCNJr   c                    U(       d  U$ UR                   (       a  UR                   =(       d    / n/ Ul         UR                    HX  nUR                  (       a  UR                  S:X  a  UR                   R                  U5        OUR                  U5        SUl        MZ     UR                   R                  U5        U R	                  X5      nUR                  5         U$ )a5  Merges an `app.yaml` file with referenced builtins/includes.

Args:
  appyaml: The `app.yaml` file that you want to update with `appinclude`.
  appinclude: The includes that you want to merge into `appyaml`.

Returns:
  An updated `app.yaml` file that includes the directives you specified in
  `appinclude`.
r:   N)rd   r9   appendr  r.  NormalizeVmSettings)r  appyamlr!  r;   r   s        r   MergeAppYamlAppInclude!AppInclude.MergeAppYamlAppInclude  s      n #dg""!zzQZZ61



!
!!
$
++a. 
 # d#!!'6G!Nr   c                    U(       a  U(       d  U=(       d    U$ UR                   (       a7  UR                   (       a%  UR                   R                  UR                   5        OUR                   Ul         U R                  X5      $ )ap  Merges the non-referential state of the provided `AppInclude`.

That is, `builtins` and `includes` directives are not preserved, but any
static objects are copied into an aggregate `AppInclude` object that
preserves the directives of both provided `AppInclude` objects.

`appinclude_one` is updated to be the merged result in this process.

Args:
  appinclude_one: First `AppInclude` to merge.
  appinclude_two: Second `AppInclude` to merge.

Returns:
  `AppInclude` object that is the result of merging the static directives of
  `appinclude_one` and `appinclude_two`. An updated version of
  `appinclude_one` is returned.
)rd   r  r.  )r  r%  r&  s      r   MergeAppIncludesAppInclude.MergeAppIncludes  sb    , -~- 		 	 &&~'>'>? . 7 7n~>>r   c                     U [         :X  a  U$ U[         :X  a  U $ [        R                  " 5       R                  X/[        5      $ )zMerges two `skip_files` directives.

Args:
  skip_files_one: The first `skip_files` element that you want to merge.
  skip_files_two: The second `skip_files` element that you want to merge.

Returns:
  A list of regular expressions that are merged.
)SKIP_NO_FILESr   RegexStrr  
SKIP_FILES)skip_files_oneskip_files_twos     r   r+  AppInclude.MergeSkipFiles  sD     && ))	(*6 6r   r   N)(r   r   r   r   r   BUILTINSr   re  r  r  INCLUDESra  listHANDLERSr  ADMIN_CONSOLEr  MANUAL_SCALINGr  VMr  VM_SETTINGSr  BETA_SETTINGSr  ENV_VARIABLESr  BUILD_ENV_VARIABLESr<  r;  r:  rv  r  r'  r.  r4  r7  r  r+  r   r   r   r   r  r  <  sK    
##J$7$7$GH
##JOOD$9:
##J$7$7$?LZ((6j))-8*

d
#:&&z2Z((6Z(()=>:../CD*%%m<*  * *X % %N % %N  ?  ?D 6 6r   r  c                   D  ^  \ rS rSrSr0 \\R                  " \5      _\	\R                  " \5      _\
\R                  " \\R                  " \5      5      _\\R                  " \
\R                  " \5      5      _\\R                  " \5      _\\R                  " \5      _\\R                  " \R(                  " \5      5      _\\R                  " \5      _\\R                  " \5      _\\R                  " \5      _\\R                  " \5      _\\R                  " \" \S5      (       a  \R@                  " 5       O\R(                  " \5      5      _\!\R                  " \"5      _\#\R                  " \R(                  " \5      5      _\$\R                  " \RJ                  " \&5      5      _\'\R                  " \(5      _\)\R                  " \*5      _0 \+\R                  " \,5      _\-\R                  " \.5      _\/\R                  " \05      _\1\R                  " \25      _\3\R                  " \45      _\5\R                  " \65      _\7\R                  " \85      _\9\R                  " \:5      _\;\R                  " \<5      _\=\R                  " \>5      _\?\R                  " \@5      _\A\R                  " \B5      _\C\R                  " \R                  " \R                  5      5      _\F\R                  " \R                  " \G5      5      _\H\R                  " \R(                  " \I5      5      _\J\R                  " \R                  " \K5      / S9_\L\R                  " \R                  " \M5      5      _E0 \N\R                  " \R                  " \RJ                  " \O5      5      5      _\P\R                  " \Q5      _\R\R                  " \TS9_\U\R                  " \VS9_\W\R                  " \R                  " \R                  " \Y\Z5      5      5      _\[\R                  " \\5      _\]\R                  " \R                  " \^5      5      _\_\R                  " \R                  " \`R                  5      5      _\b\R                  " \.5      _\c\R                  " \R(                  " \5      5      _\d\R                  " \R                  " \e\f5      5      _\g\R                  " \h5      _\i\R                  " \.5      _\j\R                  " \k5      _\l\R                  " \k5      _\m\R                  " \.5      _\n\R                  " \.5      _E\o\R                  " \p5      \q\R                  " \R                  " \RJ                  " S5      5      5      0ErrU 4S jrsS rtS ruS	 rvS
 rwS rxS ryS rzSr{U =r|$ )AppInfoExternali
	  a  Class representing users application info.

This class is passed to a `yaml_object` builder to provide the validation
for the application information file format parser.

Attributes:
  application: Unique identifier for application.
  version: Application's major version.
  runtime: Runtime used by application.
  api_version: Which version of APIs to use.
  source_language: Optional specification of the source language. For example,
      you could specify `php-quercus` if this is a Java app that was generated
      from PHP source using Quercus.
  handlers: List of URL handlers.
  default_expiration: Default time delta to use for cache expiration for
      all static files, unless they have their own specific `expiration` set.
      See the documentation for the `URLMap.expiration` field for more
      information.
  skip_files: A regular expression object. Files that match this regular
      expression will not be uploaded by `appcfg.py`. For example::
          skip_files: |
            .svn.*|
            #.*#
  nobuild_files: A regular expression object. Files that match this regular
      expression will not be built into the app. This directive is valid for
      Go only.
  api_config: URL root and script or servlet path for enhanced API serving.
Execrc  z^(app_identity_service|blobstore|capability_service|datastore_v3|deferred|images|mail|memcache|modules|namespaces|ndb|search|taskqueue|urlfetch|user)$c                 
  > [         [        U ]  5         U R                  c+  U R	                  5       (       d  [
        R                  " S5      eU R                  c  SU l        U R                  (       a:  [        U R                  5      [        :  a  [
        R                  " S[        -  5      eU R                  S:H  =(       aD    [        U S5      =(       a1    U R                  =(       a    U R                  R                  S5      S:H  =(       dD    [        U S	5      =(       a1    U R                  =(       a    U R                  R                  S5      S:H  nU R                  c-  U R                  S:X  d  U(       a  [
        R                   " S
5      eU R"                  [$        :X  a&  SnSn[&        R(                  " SU-   S-   U-   S-   5        [        U S	5      (       aU  U R                  (       aD  U R                  R                  S5      (       a$  [+        U R                  R                  S5      5        U R,                  (       a  U(       d&  U R                  S:X  d  [
        R.                  " S5      eU R,                   Vs/ s H  oDR0                  PM     nnU H1  nUR3                  U5      S:  d  M  [
        R4                  " SU-  5      e   U R6                  (       aP  U R6                  R9                  [:        5      S:w  a-  [<        R>                  " SU R6                  < S[:        < S35      eU R6                  (       aQ  U R6                  RA                  [B        5      (       a-  [<        R>                  " SU R6                  < S[B        < S35      eU R                  (       Ga  U R                   Vs/ s H)  nURE                  5       [F        :X  d  M  URH                  PM+     nnU(       a'  U RJ                  (       d  [
        RL                  " S5      eU R                  (       a  U R                  S:X  ay  U R                   Hi  nURN                  (       d  M  URN                  RQ                  S5      (       d  SURN                  ;   d  MH  [
        RR                  " SURN                  -  5      e   [U        [W        U RX                  5      [W        U RZ                  5      [W        U R\                  5      /5      S:  a  [
        R^                  " S5      egs  snf s  snf )aj  Performs non-regular expression-based validation.

The following are verified:
    - At least one URL mapping is provided in the URL mappers.
    - The number of URL mappers doesn't exceed `MAX_URL_MAPS`.
    - The major version does not contain the string `-dot-`.
    - If `api_endpoints` are defined, an `api_config` stanza must be
      defined.
    - If the `runtime` is `python27` and `threadsafe` is set, then no CGI
      handlers can be used.
    - The version name doesn't start with `BUILTIN_NAME_PREFIX`.
    - If `redirect_http_response_code` exists, it is in the list of valid
      300s.
    - Module and service aren't both set. Services were formerly known as
      modules.

Raises:
  DuplicateLibrary: If `library_name` is specified more than once.
  MissingURLMapping: If no `URLMap` object is present in the object.
  TooManyURLMappings: If there are too many `URLMap` entries.
  MissingApiConfig: If `api_endpoints` exists without an `api_config`.
  MissingThreadsafe: If `threadsafe` is not set but the runtime requires it.
  ThreadsafeWithCgiHandler: If the `runtime` is `python27`, `threadsafe` is
      set and CGI handlers are specified.
  TooManyScalingSettingsError: If more than one scaling settings block is
      present.
  RuntimeDoesNotSupportLibraries: If the libraries clause is used for a
      runtime that does not support it, such as `python25`.
Nz;You must specify a "runtime" field for non-vm applications.rP  z>Found more than %d URLMap entries in application configurationrI   rJ   
vm_runtimer   rL   z@threadsafe must be present and set to a true or false YAML valuez[http://developers.google.com/appengine/docs/python/datastore/entities#Kinds_and_IdentifierszRhttp://developers.google.com/appengine/docs/python/config/appconfig#auto_id_policyzYou have set the datastore auto_id_policy to 'legacy'. It is recommended that you select 'default' instead.
Legacy auto ids are deprecated. You can continue to allocate
legacy ids manually using the allocate_ids() API functions.
For more information see:

source_referencez>libraries entries are only supported by the "python27" runtimer   zDuplicate library entry for %sr  z	Version "z" cannot contain the string ""z" cannot start with "z/" because it is a reserved version name prefix.z]An api_endpoint handler was specified, but the required api_config stanza was not configured.z.py/z1threadsafe cannot be enabled with CGI handler: %szSThere may be only one of 'automatic_scaling', 'manual_scaling', or 'basic_scaling'.)0r  rL  r  rY   IsVmr   MissingRuntimeErrorrd   r  MAX_URL_MAPSTooManyURLMappingsr*  rJ   getrL   rp   MissingThreadsaferr   DATASTORE_ID_POLICY_LEGACYr  r  r  re   RuntimeDoesNotSupportLibrariesr   countDuplicateLibraryrV   findALTERNATE_HOSTNAME_SEPARATORr   r  r  BUILTIN_NAME_PREFIXr  r  r8   rs   MissingApiConfigr*   endswithThreadsafeWithCgiHandlersumr  rF   rG   rH   TooManyScalingSettingsError)
r   vm_runtime_python27datastore_auto_ids_urlappcfg_auto_ids_urlr6  library_nameslibrary_namehandlerapi_endpointsr  s
            r   r   AppInfoExternal.CheckInitialized	  s9   < 
/413||DIIKK..
GI I		 dl}}T]]+l:--
J
 
 	 	;	}	% 
:			
:					l	+z	9	= 
	' 
<			
<						-	;  			#':,,
LN N 88!AFoo(
 ##
 &**
 -@@
 CGGH 	o&&4+=+=""#566,



 
 !3
46 ~~!T\\Z%?;;LN 	N 48>>B>||>mB',|,q0//.=? ? (
 ||))*FG2M&&ll8:; ; ||//0CDD&&/3||/BDE E }}}26-- L-w!0026JJ #w{{-m L	t--45 	5 
T\\Z7 }}Gnnn'.."9"9%"@"@"%"7 99C    % D''($$%##$& ')*+ 66 ! !+? C Ls   6T'TTc           	         U R                   (       d  / $ [        S U R                    5       5      n/ nU R                    HX  n[        R                  UR                  UR
                  4/ 5       H%  u  pEXA;  d  M  UR                  [        UUS95        M'     MZ     U R                   U-    Vs/ s H  n[        S0 UR                  5       D6PM     sn$ s  snf )zReturns a list of all `Library` instances active for this configuration.

Returns:
  The list of active `Library` instances for this configuration. This
  includes directly-specified libraries as well as any required
  dependencies.
c              3   8   #    U  H  oR                   v   M     g 7fr2  r3  r4  s     r   r7  2AppInfoExternal.GetAllLibraries.<locals>.<genexpr>	
  s     CNN   rW  r   )	re   r  REQUIRED_LIBRARIESrX  r   rV   r1  rV  r@  )r   ri  required_librariesr6  required_namerequired_versions         r   GetAllLibrariesAppInfoExternal.GetAllLibraries	  s     >>iCDNNCCM>>-?-C-C<<
)2./
)--

#
#G4D%F G./ "  >>,>>@> 'gnn&'>@ @ @s   +#Cc                    U R                  5       n[        S U 5       5      n[         HU  nUR                  (       d  M  UR                  U;  d  M(  UR                  [        UR                  UR                  S95        MW     U$ )aj  Returns a list of normalized `Library` instances for this configuration.

Returns:
  The list of active `Library` instances for this configuration. This
  includes directly-specified libraries, their required dependencies, and
  any libraries enabled by default. Any libraries with `latest` as their
  version will be replaced with the latest available version.
c              3   8   #    U  H  oR                   v   M     g 7fr2  r3  r4  s     r   r7  9AppInfoExternal.GetNormalizedLibraries.<locals>.<genexpr> 
  s     B	WLL	rq  rW  )rv  r  _SUPPORTED_LIBRARIESr   r   r1  rV  )r   re   enabled_librariesr6  s       r   GetNormalizedLibraries&AppInfoExternal.GetNormalizedLibraries
  ss     $$&IB	BB'		 	 	 W\\9J%Jgll)0)@)@B 	C ( r   c                 |   Uc  gU R                   c  [        R                  eXl        SnU R                    H.  nUR                  U:w  a  M  U(       a  [        R
                  eUnM0     Uc  [        R                  eUR                  c  g[        [        UR                  S9nU R                  R                  SU5        g)a8  Applies settings from the indicated backend to the `AppInfoExternal`.

Backend entries can contain directives that modify other parts of the
`app.yaml` file, such as the `start` directive, which adds a handler for the
start request. This method performs those modifications.

Args:
  backend_name: The name of a backend that is defined in the `backends`
      directive.

Raises:
  BackendNotFound: If the indicated backend was not listed in the
      `backends` directive.
  DuplicateBackend: If the backend is found more than once in the `backends`
      directive.
N)r8   r*   r   )ro   r   BackendNotFoundrV   r   DuplicateBackendstartr  _START_PATHrd   r  )r   backend_namer  backendstart_handlers        r   ApplyBackendSettings$AppInfoExternal.ApplyBackendSettings'
  s    " }}***LE==		%	--- ! }***{{{5;;?MMMM*r   c                 >   U R                   S:X  a9  [        U S5      (       a(  U R                  b  U R                  R                  S5      $ U R                   S:X  a9  [        U S5      (       a(  U R                  b  U R                  R                  S5      $ U R                   $ )zReturns the app's runtime, resolving VMs to the underlying `vm_runtime`.

Returns:
  The effective runtime: The value of `beta/vm_settings.vm_runtime` if
  `runtime` is `vm`, or `runtime` otherwise.
rI   rJ   rO  rL   )rY   r*  rJ   rX  rL   r   s    r   GetEffectiveRuntime#AppInfoExternal.GetEffectiveRuntimeR
  s     	}!=!=(!!,//!?!?*##L11<<r   c                     U R                  5       (       a6  U R                  (       d  [        5       U l        XR                  S'   SU l        gXl        g)zqSets the runtime while respecting vm runtimes rules for runtime settings.

Args:
   runtime: The runtime to use.
rO  rI   N)rT  rJ   r  rY   )r   rY   s     r   SetEffectiveRuntime#AppInfoExternal.SetEffectiveRuntimea
  s>     yy{{%< (/|$dllr   c                    U R                  5       (       a  U R                  (       d  [        5       U l        SU R                  ;  a  U R                  U R                  5        [        U S5      (       aZ  U R                  (       aH  S HA  nXR                  ;  d  M  XR                  ;   d  M%  U R                  U   U R                  U'   MC     gggg)zNormalizes VM settings.rO  rL   )rO  has_docker_imageimagemodule_yaml_pathN)rT  rJ   r  r  rY   r*  rL   )r   fields     r   r2  #AppInfoExternal.NormalizeVmSettingsr
  s     yy{{%<	T--	-  . 
	'	'D,>,>
*E ,,,:J:J1J(,(8(8(?Du%* -?	' r   c                 F    U R                   =(       d    U R                  S;   $ )N)2flexflexible)rI   r^   r   s    r   rT  AppInfoExternal.IsVm
  s     GG 2HH113r   )rY   rV   rJ   )}r   r   r   r   r   APPLICATIONr   re  APPLICATION_RE_STRINGPROJECTSERVICE	PreferredMODULEMODULE_ID_RE_STRING
DeprecatedVERSIONMODULE_VERSION_ID_RE_STRINGRUNTIMERUNTIME_RE_STRINGRUNTIME_CHANNELra  r  API_VERSIONAPI_VERSION_RE_STRINGMAINru  ENVENV_RE_STRINGENDPOINTS_API_SERVICErz  
ENTRYPOINTr*  rM  RUNTIME_CONFIGr  INSTANCE_CLASSSOURCE_LANGUAGErT  SOURCE_LANGUAGE_RE_STRINGAUTOMATIC_SCALINGr  rE  r  BASIC_SCALINGr  rF  r  rG  r  rH  r  VM_HEALTH_CHECKr  HEALTH_CHECKr  	RESOURCESr  LIVENESS_CHECKr  READINESS_CHECKr  NETWORKr   VPC_ACCESS_CONNECTORr  
VPC_ACCESSr  ZONESr  rx  r@  r  rA  rB  rC  r  	LIBRARIESrV  SERVICES_SERVICE_RE_STRINGDEFAULT_EXPIRATIONr  r<  r;  DEFAULT_SKIP_FILESNOBUILD_FILESDEFAULT_NOBUILD_FILESDERIVED_FILE_TYPErh  JAVA_PRECOMPILEDPYTHON_PRECOMPILEDrD  r  ERROR_HANDLERSr  BACKENDSr   BackendEntry
THREADSAFESERVICEACCOUNTDATASTORE_AUTO_ID_POLICYrZ  DATASTORE_ID_POLICY_DEFAULT
API_CONFIGrS  	CODE_LOCKrI  r  rJ  STANDARD_WEBSOCKETAPP_ENGINE_APISFLEXIBLE_RUNTIME_SETTINGSr  APP_ENGINE_BUNDLED_SERVICESrv  r  rv  r}  r  r  r  r2  rT  r   r  r  s   @r   rL  rL  
	  s   :] :&&'<=]
 z""#89] z##
*%%&9:] j##
:&&':;] z""#>?] z""#45] z**:??3+?@]" :&&'<=#]$ J-%]( 
:}-)]* Z001DE+]0 *%%Z(( //
s#1]: j))-8;]< j))*//#*>?=]> z**


4
5?]D ,,-=>E]F j))-8G]H Z((6I]J 	*

d
#K]L :&&z2M]N Z((6O]P z**=9Q]R J''4S]T $$Y/U]V j))-8W]X z**>:Y]Z z""7+[]\ J//0BC]]^ *%%i0_]` Z  !4!4Z5H5H!IJa]b 
##J$7$7$GHc]d 
##JOOD$9:e]f 
##J$7$7$?Lg]h $$Z%8%8%ABi]l 
##


j../AB
Cm]r *--.?@s]t *%%.@Au]v Z((1FGw]x ,,


  !13EFy]B Z((6C]D j))**=*=m*LME]F 
##


k66
7G]L *%%d+M]N j))*//#*>?O]P 
 3 3


(*E!Q]Z *%%&67[]\ $$T*]]^ Z(()=>_]` :../CDa]b *--d3c]d z**40e]f  !4!45L!M!:#6#6


%$i]*~u!n@0")+V"@<3 3r   rL  c                     U (       d  gU  H<  nUR                  5         UR                  5         U(       a  M,  UR                  5         M>     g)zValidates a list of handler (`URLMap`) objects.

Args:
  handlers: A list of a handler (`URLMap`) objects.
  is_include_file: If this argument is set to `True`, the handlers that are
      added as part of the `includes` directive are validated.
N)r  r  r  )rd   is_include_filerk  s      r   ValidateHandlersr  
  s=     

g?'')	 r   c                    [         R                  " [        5      n[        R                  " U5      n[
        R                  " U5      nUR                  U 5        UR                  5       n[        U5      S:  a  [        R                  " 5       e[        U5      S:  a  [        R                  " 5       eUS   n[        UR                  5        UR                  (       a*  [         R#                  UR                  UR$                  5        UR&                  (       a'  UR(                  (       a  [        R*                  " S5      eUR(                  (       a  UR(                  Ul        SUl        UR-                  5         U$ )a  Loads a single `AppInfo` object where one and only one is expected.

This method validates that the values in the `AppInfo` match the
validators that are defined in this file, in particular,
`AppInfoExternal.ATTRIBUTES`.

Args:
  app_info: A file-like object or string. If the argument is a string, the
      argument is parsed as a configuration file. If the argument is a
      file-like object, the data is read, then parsed.

Returns:
  An instance of `AppInfoExternal` as loaded from a YAML file.

Raises:
  ValueError: If a specified service is not valid.
  EmptyConfigurationFile: If there are no documents in YAML file.
  MultipleConfigurationFile: If more than one document exists in the YAML
      file.
  DuplicateBackend: If a backend is found more than once in the `backends`
      directive.
  yaml_errors.EventError: If the `app.yaml` file fails validation.
  appinfo_errors.MultipleProjectNames: If the `app.yaml` file has both an
      `application` directive and a `project` directive.
r   r   z5Specify one of "application: name" or "project: name"N)r   ObjectBuilderrL  r	   BuilderHandlerr
   EventListenerParse
GetResultsr  r   EmptyConfigurationFileMultipleConfigurationFiler  rd   rb   r  r  rY   rB   rC   MultipleProjectNamesr2  )app_infobuilderrk  listener	app_infosr3  s         r   LoadSingleAppInfor  
  s   4 %%o6'''0'((1(
..  ")^a

/
/
11^a

2
2
44aL'7##$G,,goo> W__

-
-?A A!//GGO		.r   c                   <    \ rS rSrSr\\\\\	\
R                  0rSrg)AppInfoSummaryi
  zThis class contains only basic summary information about an app.

This class is used to pass back information about the newly created app to
users after a new version has been created.
r   N)r   r   r   r   r   r  r  MAJOR_VERSIONr  MINOR_VERSIONr   	TYPE_LONGrv  r   r   r   r   r  r  
  s'     (0Z))*r   r  c                 V   [         R                  " [        5      n[        R                  " U5      n[
        R                  " U5      nUR                  U 5        UR                  5       n[        U5      S:  a  [        R                  " 5       e[        U5      S:  a  [        R                  " 5       eUS   nUR                  (       a3  UR                   H#  nUR                  5         UR                  5         M%     UR                   (       a  ["        R%                  UR                   5        U$ )a  Loads a single `AppInclude` object where one and only one is expected.

Args:
  app_include: A file-like object or string. The argument is set to a string,
      the argument is parsed as a configuration file. If the argument is set
      to a file-like object, the data is read and parsed.

Returns:
  An instance of `AppInclude` as loaded from a YAML file.

Raises:
  EmptyConfigurationFile: If there are no documents in the YAML file.
  MultipleConfigurationFile: If there is more than one document in the YAML
      file.
r   r   )r   r  r  r	   r  r
   r  r  r  r  r   r  r  rd   r  r  rb   r  r  )app_includer  rk  r  rc   includeyamls         r   LoadAppIncluder  
  s      %%j1'''0'((1(
..!(]Q

/
/
11]Q

2
2
44+''!  ( K001	r   c                     Sn[         R                  " [        U 5       HW  n[        UR	                  S5      5      n[
        R                  UR	                  S5      R                  5       S5      nXU-  -  nMY     U$ )zParses an expiration delta string.

Args:
  expiration: String that matches `_DELTA_REGEX`.

Returns:
  Time delta in seconds.
r   r   r  )r  finditer_DELTA_REGEXr  group_EXPIRATION_CONVERSIONSrX  r  )r>   deltar  amountunitss        r   ParseExpirationr    sf     %{{<4eQ F#''A(<(<(>BE	e^E 5 
,r   z\.\.|^\./|\.$|/\./|^-|^_ah/|^/z//|/$z^ | $|/ | /|\r|\nc                     U (       d  g[        U 5      S:  a  SU -  $ [        R                  U 5      b  SU -  $ [        R                  U 5      b  SU -  $ [        R                  U 5      b  SU -  $ g)aO  Determines if a file name is valid.

Args:
  filename: The file name to validate. The file name must be a valid file
      name:
          - It must only contain letters, numbers, and the following special
            characters:  `@`, `_`, `+`, `/` `$`, `.`, `-`, or '~'.
          - It must be less than 256 characters.
          - It must not contain `/./`, `/../`, or `//`.
          - It must not end in `/`.
          - All spaces must be in the middle of a directory or file name.

Returns:
  An error string if the file name is invalid. `''` is returned if the file
  name is valid.
zFilename cannot be emptyi   z*Filename cannot exceed 1024 characters: %szCFilename cannot contain "." or ".." or start with "-" or "_ah/": %sz1Filename cannot have trailing / or contain //: %sz2Any spaces must be in the middle of a filename: %sr?  )r  _file_path_negative_1_research_file_path_negative_2_re_file_path_negative_3_re)filenames    r   ValidFilenamer  =  s    " 
%]T7(BB$$X.:.  $$X.:>II$$X.:?(JJ	r   )F(@  r   
__future__r   r   r   r  osr  r  rh  wsgiref.utilr  environrX  google.appengine.apir   r	   r
   r   googlecloudsdk.appengine.apir   r   "googlecloudsdk.appengine._internalr   rf  ru  _URL_ROOT_REGEXr  r  r  rs  _ALLOWED_SERVICESr]  r  r	  r  APP_ID_MAX_LENMODULE_ID_MAX_LENMODULE_VERSION_ID_MAX_LENrV  PARTITION_SEPARATORDOMAIN_SEPARATORVERSION_SEPARATORMODULE_SEPARATORDEFAULT_MODULE%PARTITION_RE_STRING_WITHOUT_SEPARATORPARTITION_RE_STRING"DOMAIN_RE_STRING_WITHOUT_SEPARATORDOMAIN_RE_STRINGDISPLAY_APP_ID_RE_STRINGr  r  r  r  r  r  r  r  r  r  r	  r  r  r_  r`  r  r  r  r  r  r  rt  r  ri  rj  rk  rm  rn  rZ  r  rp  rq  rr  rs  r  r  r:  r  rg  rl  ro  rd  r  r  r  r  r  r  r  r  r  API_ENDPOINTr  r  r  r  r  r  r  r  rE  r  rF  rG  r  rH  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r@  rA  rC  r  r  r<  r  r  r  r  r  rD  r  r  r  r  r  r  r  rI  rJ  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  rd  rg  r  r  r  r  r  r  r  r  r  r  r  rr  rt  ru  rn  ro  rw  r  r  r  r  r  r  r  r  r  r|  r  r  r  r  r  r   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r4  r   r{  r!  rY  rr  r\  r  _HTTP_SEPARATOR_CHARSr  _HTTP_TOKEN_CHARScompileescaper  r  r  r  r  _CANNED_RUNTIMESrV  rW  r`  	Validatedrb  ValidatedDictrx  r  r  r  r  r  rS  rV  rc  rk  rz  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r  r  rL  r  r  r  r  r  r  r  r  r  r   r   r   <module>r     s  $ '  %  	 	  
  ::>>%&*4-/0. 6786 7 4 9 .
 +-9<H ! 
  388$566<    
			
	               *<n)L %=+-  'A&4'5 " 89IK 9^a=OP -*24  7:Ka:OP ? 9A = ?  / " , 
 @ % 5 < H "6 3 &  # 
 J & /, % ! % &  . % ' ! /     	% 		
		
- ;  
	
' !	7 #	!#
- 


#/ 
!#	) 
' % ) !
"+ 
	+ ) #; 7 -  " ! 0 / - - 6 
 ( ' - #2 0O - %H !&K #(O %- ("C  ? !A = = 9 !B 0 9 	 	   	 	%   $ ! 
B  
3
5 , ) / + ' ' ' ' '  	 
 $#% %  ) ( ": )H & # &6 #2? /:O 7  3   ! !. )> & & #D8 D8N}%F	
!

} !,	
}" '?38
#}4 -@	

5}B LC	
C}P !		
Q}` C)		
a}n 2		&i
o}@ /+	
A}P &H	
Q}^ E!"G,
_}n 09	
o}|  K		
}}J .=%&0
K}Z .=		
[}h !9		
i}v 99		
w}D ,		
E}V ,<& %x0
W}h (B	
i}v 93		&i
w}F #B		
G}T ,L	'&i
U}d 2O"G
e}v 0L	8%J
w}F *4	( 
G}V 512"H-
W}f ,O	
g}t --!$I	
u}H O	'
I}Z (!	 !
[}j ?	
k} ~ " "G1E"G G  ,,D.0HI35MN0123-../45 $ *  ""9: f..s347LL Hryy9J1K'LLM " #  0    ). %  !4*&& 2L9j.. L9^[![ [!|z++ :'' :J(( BZ)) BJ{ "j"" "JZ)) (:'' (@!N*.. !NH3z++ 3lJ(( :'' 
J,, 
j22 L)) LD?: ?8/:33 /8G,)$
6*&& 
6	6J(( 	6
6Z)) 
6K Z!! 
$$ j"" ,-- 	
 4 4 	
$$  I6%% I6\H3j** H3V*$6rZ)) "#L0 ::&GH  ::h/  ::&:; r   