
                        j   S r SSKrSSKrSSK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SKJr  SS	KJr  SS
KJr  SSKJr  SSKrSrSrSrSrSrSrSrSrSrSrSr Sr!S r"\"" S\5       " S S\RF                  5      5       r$\"" S\5       " S S\RF                  5      5       r%\	RL                  " SS 5      r'\	RL                  " S!S"5      r(\
RR                  " S#S$S%S&9r*\
RR                  " S#S$S'S%S(9r+\
RR                  " S#S$S'S)S(9r,\
RR                  " S#S$S)S&9r-\
RR                  " S*\	R\                  " SSS+9S,\R^                  " \R`                  Rb                  Rd                  5      S-9r3S.r4S/r5S0r6S1r7S2r8S3r9S4r:S5S6S7S8S9S:.r;S5S6S7S8S9S:.r<S;r=\
RR                  " S<S=S>S?9r>\
RR                  " S@SA\	R~                  " \@\@SB9\	R                  SCSD9rB\
RR                  " SESF\	R                  " 5       \	R                  SGSD9rDSHrE\
RR                  " SISJ\	R~                  " \@\@SB9\	R                  SKSD9rF\
RR                  " SLS$\	R                  " 5       \	R                  SMSD9rG\
RR                  " SNS=SOS?9rHSPrI\
RR                  " SQ\'SRSSST9rJ\
RR                  " SU\(SVSWST9rK\
RR                  " SXSYSZ9rLS[rMS\rNS]rOS^rPS_R                  \5      rRS`R                  \5      rSSaR                  \5      rTSbR                  \5      rUScR                  \5      rVSdrWSerX\
RR                  " SfS=SgS?9rY\
RR                  " ShSiSj/ SkSl9rZ\
RR                  " SmSn\	R                  " 5       \	R                  SoSD9r[\
RR                  " SpSS=SqSr9r\\
RR                  " SsSS=StSr9r]\
RR                  " SuSS=SvSr9r^\
RR                  " SwSSx\	R                  " 5       SySz9r_\
RR                  " S{SS|S}9r`\
RR                  " S~SSS9ra\
RR                  " SSSZ9rb\
RR                  " SSR                  \5      SZ9rc\
RR                  " SSSS}9rd\
RR                  " S\eSS9rf\
RR                  " SSj\	R~                  " \@\@S.S9SS9rg\
RR                  " SS=SS?9rh\
RR                  " SS=SS?9ri\
RR                  " S\	R~                  " \@\@S.S9SjSS9rj\
RR                  " SS=SSR                  \5      S9rk\
RR                  " SSSSSR                  \5      S9rl\
RR                  " SSSSSR                  \5      S9rm\
RR                  " S\@\$SS9rn\
RR                  " S\@\$SS9ro\
RR                  " S\pS\%SS9rq\
RR                  " S\pS\%SR                  \5      S9rr\
RR                  " S\pS\%SR                  \\5      S9rs\
RR                  " S\pS\%SS9rt\
RR                  " S\pS\%SS9ru\
RR                  " S\	R                  " SSSS/SS9S\%SS9rw\
RR                  " S\	R                  " SSSS/SS9S\%SR                  \5      S9rx\
RR                  " S\	R                  " SSSS/SS9S\%SR                  \\5      S9ry\
RR                  " S\	R                  " SSSS/SS9\%SSS9rz\
RR                  " S\	R                  " SSSS/SS9\%SSS9r{\
RR                  " S\	R                  " SSSS/SS9\%SSS9r|\
RR                  " S\	R                  " SSSS/SS9\%SSR                  \5      S9r}\
RR                  " S\	R                  " SSSS/SS9\%SSS9r~\
RR                  " S\	R                  " SSSS/SS9\%SSS9r\
RR                  " S\eS\%SS9r\
RR                  " S\%\eSSS9r\
RR                  " S\eSSS9r\
RR                  " S\e\%SSR                  \5      S9r\
RR                  " SS\e\%SR                  \\5      S9r\
RR                  " SSSSSS9r\
RR                  " SSSSSS9r\
RR                  " SSSSSS9r\
RR                  " SSSSSS9r\
RR                  " SS\%SSr9r\
RR                  " SSSSSR                  \5      S9r\
RR                  " SSS=SR                  \5      Sr9r\
RR                  " SSS=SR                  \5      Sr9r\
RR                  " SSS\GR                  " SSSS9SR                  \\5      S9r\
RR                  " SSS\GR                  " SSSS9SR                  \\5      S9r\GR                   " SSS9/\GR"                  " \
GR$                  GR&                  S9GR(                  GR*                  \;S9r\GR                   " SSS9/\GR"                  " \
GR$                  GR.                  S9GR(                  GR*                  \;S9r\GR                   " SS\GR"                  " \
GR$                  GR2                  S9GR(                  GR*                  \<S9r\
RR                  " S\eSSS9r\
RR                  " SSS=SSr9r\
RR                  " SSS=SSr9r\
RR                  " S\@\%SS9rS r\	GR@                  " \\55      r\
RR                  " GS S\GSGS9r\
RR                  " GSS\GSGS9r\
RR                  " GSSS=GSSr9r\
RR                  " SSS=GSSr9r\
RR                  " SSS=GSSr9r\
RR                  " GS	SS=GS
Sr9r\
RR                  " GSSS=GSSr9r\
RR                  " GSS\%GSSr9rGSr\GR                   " GS\S\GR"                  " \
GR$                  GR2                  S9GRV                  GRX                  GS9r\GR                   " GS\S\GR"                  " \
GR$                  GR.                  S9GRV                  GRX                  GS9r\GR                   " GS\S\GR"                  " \
GR$                  GR&                  S9GRV                  GRX                  GS9rGS rGS rGS r\	GR@                  " \\65      r\
RR                  " GSS\GSGS9rGS r\	GR@                  " \\75      r\
RR                  " GSS\GSGS9rGS r\	GR@                  " \\85      r\
RR                  " GSS\GSGS9rGS r\	GR@                  " \\95      r\
RR                  " GSS\\%GSS9rGS  r\	GR@                  " \\:5      r\
RR                  " GS!S\\%GS"R                  \5      S9r\
RR                  " GS#SSSSGS$R                  \5      GS%9r\
RR                  " GS&SSSGS'R                  \5      S9r\
RR                  " GS(\@S\%GS)R                  \5      GS*9r\
RR                  " GS+\@\%SGS,R                  \5      GS-9r\
RR                  " GS.\@\%SGS/R                  \5      GS-9r\
RR                  " GS0\	GR                  GR                  SGS1GS29r\
RR                  " GS3\	GR                  GR                  SGS4GS29r\
RR                  " GS5SS=GS6R                  \5      Sr9r\
RR                  " GS7\@SGS8GS29rGS9rGS:r\
RR                  " GS;SS=GS<Sr9r\
RR                  " GS=SS=GS>Sr9r\
RR                  " GS?SS=GS@Sr9r\
RR                  " GSASS=GSBSr9rGSC rGSD rGSE rGSF rGSG rGSH rGSI r\	GR@                  " \\45      r\
RR                  " GSJSJ\	R~                  " \\@SB9\	R                  GSKSD9rGSL rGSM r GS`GSN jrGSO rGSP rGSQ rGSR rGSS rGST rGSU rGSV rGSW rGSX rGSY rGSZ rGS[ rGS\ rGS] rGS^ rGS_ rg(a  z3Helpers and common arguments for Composer commands.    N)util)actions)arg_parsers)base)
exceptions)parsers)	arg_utils)labels_util)
propertiesz2.2.5z2.0.313z2.0.32z2.4.0z1Cannot specify --{opt} without --{prerequisite}.
z5Cannot specify --{opt} without enabling a triggerer.
znCannot specify {opt}. Composer version {composer_version} and Airflow version {airflow_version} are required.
z3Cannot specify {opt} with Composer 2.X or greater.
z(Cannot specify {opt} with Composer 1.X.
zRCannot specify {opt}. Composer version {composer_version} or greater is required.
zJCannot specify {opt} with Composer version {composer_version} or greater.
c                    ^ ^ U U4S jnU$ )z9Creates Composer version specific ActionClass decorators.c                 B   >^ U R                   mSUUU4S jjnXl         U $ )zGDecorates ActionClass to cross-validate argument with Composer version.c                    > S n UR                   (       a9  U" UR                   5      T:w  a#  [        R                  " TR                  US95      eT" XX#U5        g ! [         a     Nf = f)Nc                 T    U R                  S5      =(       d    U R                  S5      $ )Nzcomposer-1.zcomposer-1-)
startswith)image_versions    0lib/googlecloudsdk/command_lib/composer/flags.pyIsImageVersionStringComposerV1ڥValidateComposerVersionExclusiveOptionFactory.<locals>.ValidateComposerVersionExclusiveOptionDecorator.<locals>.DecoratedCall.<locals>.IsImageVersionStringComposerV1P   s(    ((7 8((7	9    )opt)r   command_utilInvalidUserInputErrorformatAttributeError)	selfparser	namespacevalueoption_stringr   composer_v1_optionerror_messageoriginal_calls	         r   DecoratedCall}ValidateComposerVersionExclusiveOptionFactory.<locals>.ValidateComposerVersionExclusiveOptionDecorator.<locals>.DecoratedCallN   sw    9""'E##(%(:(;22""}"57 7 D)MB	   	s   A
A 
A('A(N)__call__)action_classr$   r#   r!   r"   s     @r   /ValidateComposerVersionExclusiveOptionDecoratorfValidateComposerVersionExclusiveOptionFactory.<locals>.ValidateComposerVersionExclusiveOptionDecoratorJ   s(     ))MC C" *r    )r!   r"   r)   s   `` r   -ValidateComposerVersionExclusiveOptionFactoryr,   F   s    0 
98r   Tc                       \ rS rSrSrSrg)V1ExclusiveStoreActione   zDStoreActionClass first validating if option is Composer 1 exclusive.r+   N__name__
__module____qualname____firstlineno____doc____static_attributes__r+   r   r   r.   r.   e   s     Mr   r.   Fc                       \ rS rSrSrSrg)V2ExclusiveStoreActionk   zFStoreActionClass first validating if option is Composer >=2 exclusive.r+   Nr0   r+   r   r   r8   r8   k   s     Or   r8   z*^(\d+(?:\.\d+(?:\.\d+(?:-build\.\d+)?)?)?)zmust be in the form X[.Y[.Z]].zh^composer-(\d+(?:\.\d+\.\d+(?:-[a-z]+\.\d+)?)?|latest)-airflow-(\d+(?:\.\d+(?:\.\d+(?:-build\.\d+)?)?)?)zmust be in the form 'composer-A[.B.C[-D.E]]-airflow-X[.Y[.Z]]' or 'latest' can be provided in place of the Cloud Composer version string. For example: 'composer-latest-airflow-1.10.0'.nameNAMEzThe name of an environment.)metavarhelp+)r<   nargsr=   z!The name or UUID of an operation.z
--location)default_universenon_default_universez0The Cloud Composer location (e.g., us-central1).)requiredr=   actionz}Only upper and lowercase letters, digits, and underscores are allowed. Environment variable names may not start with a digit.z"Invalid format of IPV4 CIDR block.z;Not a valid IPV4 CIDR block value for the kubernetes masterz<Not a valid IPV4 CIDR block value for the Airflow web serverz<Not a valid IPV4 CIDR block value for the Cloud SQL instancez:Not a valid IPV4 CIDR block value for the composer networkzdNot a valid IPV4 CIDR block value for the composer network. This should have a netmask length of 20.unspecifiedsmallmediumlargezextra-large)ENVIRONMENT_SIZE_UNSPECIFIEDENVIRONMENT_SIZE_SMALLENVIRONMENT_SIZE_MEDIUMENVIRONMENT_SIZE_LARGEENVIRONMENT_SIZE_EXTRA_LARGEz;Group of arguments for modifying the Airflow configuration.z--clear-airflow-configs
store_truezC    Removes all Airflow config overrides from the environment.
    )rC   r=   z--update-airflow-configsz	KEY=VALUE)key_type
value_typea?      A list of Airflow config override KEY=VALUE pairs to set. If a config
    override exists, its value is updated; otherwise, a new config override
    is created.

    KEYs should specify the configuration section and property name,
    separated by a hyphen, for example `core-print_stats_interval`. The
    section may not contain a closing square brace or period. The property
    name must be non-empty and may not contain an equals sign, semicolon,
    or period. By convention, property names are spelled with
    `snake_case.` VALUEs may contain any character.
    )r<   typerC   r=   z--remove-airflow-configsKEYz:    A list of Airflow config override keys to remove.
    z7Group of arguments for modifying environment variables.z--update-env-variablesz
NAME=VALUEa6      A list of environment variable NAME=VALUE pairs to set and provide to the
    Airflow scheduler, worker, and webserver processes. If an environment
    variable exists, its value is updated; otherwise, a new environment
    variable is created.

    NAMEs are the environment variable names and may contain upper and
    lowercase letters, digits, and underscores; they must not begin with a
    digit.

    User-specified environment variables should not be used to set Airflow
    configuration properties. Instead use the `--update-airflow-configs` flag.
    z--remove-env-variablesz    A list of environment variables to remove.

    Environment variables that have system-provided defaults cannot be unset
    with the `--remove-env-variables` or `--clear-env-variables` flags; only
    the user-supplied overrides will be removed.
    z--clear-env-variablesa      Removes all environment variables from the environment.

    Environment variables that have system-provided defaults cannot be unset
    with the `--remove-env-variables` or `--clear-env-variables` flags; only
    the user-supplied overrides will be removed.
    z@Group of arguments for performing in-place environment upgrades.z--airflow-versionAIRFLOW_VERSIONa      Upgrade the environment to a later Apache Airflow version in-place.

    Must be of the form `X[.Y[.Z]]`, where `[]` denotes optional fragments.
    Examples: `2`, `2.3`, `2.3.4`.

    The Apache Airflow version is a semantic version or an alias in the form of
    major or major.minor version numbers, resolved to the latest matching Apache
    Airflow version supported in the current Cloud Composer version. The
    resolved version is stored in the upgraded environment.
    )rP   r<   r=   z--image-versionIMAGE_VERSIONal      Upgrade the environment to a later version in-place.

    The image version encapsulates the versions of both Cloud Composer and
    Apache Airflow. Must be of the form
    `composer-A[.B.C[-D.E]]-airflow-X[.Y[.Z]]`, where `[]` denotes optional
    fragments.

    Examples: `composer-2-airflow-2`, `composer-2-airflow-2.2`,
    `composer-2.1.2-airflow-2.3.4`.

    The Cloud Composer portion of the image version is a semantic version or
    an alias in the form of major version number or `latest`, resolved to the
    current Cloud Composer version. The Apache Airflow portion of the image
    version is a semantic version or an alias in the form of major or
    major.minor version numbers, resolved to the latest matching Apache Airflow
    version supported in the given Cloud Composer version. The resolved versions
    are stored in the upgraded environment.
    z --update-pypi-packages-from-filea`      The path to a file containing a list of PyPI packages to install in
    the environment. Each line in the file should contain a package
    specification in the format of the update-pypi-package argument
    defined above. The path can be a local file path or a Google Cloud Storage
    file path (Cloud Storage file path starts with 'gs://').
    r=   z4Group of arguments for modifying environment labels.z%Arguments available for item removal.z@Group of arguments for modifying the PyPI package configuration.zGroup of arguments for setting workloads configuration in Composer 2.X or greater (--scheduler-count flag is available for Composer 1.X as well).zVGroup of arguments for setting scheduled snapshots settings in Composer {} or greater.z`Group of arguments used during update of scheduled snapshots settings in Composer {} or greater.zLGroup of arguments for setting triggerer settings in Composer {} or greater.zPGroup of arguments for setting dag processor settings in Composer {} or greater.zZGroup of arguments for setting triggerer settings during update in Composer {} or greater.zHGroup of arguments for setting master authorized networks configuration.zZGroup of arguments for setting Cloud Data Lineage integration configuration in Composer 2.z--clear-pypi-packagesz    Removes all PyPI packages from the environment.

    PyPI packages that are required by the environment's core software
    cannot be uninstalled with the `--remove-pypi-packages` or
    `--clear-pypi-packages` flags.
    z--update-pypi-packagez%PACKAGE[EXTRAS_LIST]VERSION_SPECIFIERappendaC      A PyPI package to add to the environment. If a package exists, its
    value is updated; otherwise, a new package is installed.

    The value takes the form of: `PACKAGE[EXTRAS_LIST]VERSION_SPECIFIER`,
    as one would specify in a pip requirements file.

    PACKAGE is specified as a package name, such as `numpy.` EXTRAS_LIST is
    a comma-delimited list of PEP 508 distribution extras that may be
    empty, in which case the enclosing square brackets may be omitted.
    VERSION_SPECIFIER is an optional PEP 440 version specifier. If both
    EXTRAS_LIST and VERSION_SPECIFIER are omitted, the `=` and
    everything to the right may be left empty.

    This is a repeated argument that can be specified multiple times to
    update multiple packages. If PACKAGE appears more than once, the last
    value will be used.
    )r<   rC   defaultr=   z--remove-pypi-packagesPACKAGEz    A list of PyPI package names to remove.

    PyPI packages that are required by the environment's core software
    cannot be uninstalled with the `--remove-pypi-packages` or
    `--clear-pypi-packages` flags.
    z--enable-ip-aliasz    Enable use of alias IPs (https://cloud.google.com/compute/docs/alias-ip/)
    for Pod IPs. This will require at least two secondary ranges in the
    subnetwork, one for the pod IPs and another to reserve space for the
    services range.
    )rV   rC   r=   z$--disable-master-authorized-networksz    Disable Master Authorized Networks feature
    (https://cloud.google.com/kubernetes-engine/docs/how-to/authorized-networks/)
    in the Composer Environment's GKE cluster.
    z#--enable-master-authorized-networksz    Enable Master Authorized Networks feature
    (https://cloud.google.com/kubernetes-engine/docs/how-to/authorized-networks/)
    in the Composer Environment's GKE cluster.
    z--master-authorized-networksNETWORKz
    Comma separated Master Authorized Networks specified in CIDR notation.

    Cannot be specified unless `--enable-master-authorized-networks` is also specified.
    )rV   r<   rP   r=   z--cluster-secondary-range-namea8      Secondary range to be used as the source for pod IPs. Alias ranges will be
    allocated from this secondary range. NAME must be the name of an existing
    secondary range in the cluster subnetwork.

    When used with Composer 1.x, cannot be specified unless `--enable-ip-alias`
    is also specified.
    )rV   r=   z	--networkzThe Compute Engine Network to which the environment will be connected. If a 'Custom Subnet Network' is provided, `--subnetwork` must be specified as well.rB   r=   z--subnetworkz}The Compute Engine Subnetwork (https://cloud.google.com/compute/docs/subnetworks) to which the environment will be connected.z--network-attachmentz    Cloud Composer Network Attachment, which provides connectivity with a user's VPC network,
    supported in Composer {} environments or greater.
    z--services-secondary-range-namez    Secondary range to be used for services (e.g. ClusterIPs). NAME must be the
    name of an existing secondary range in the cluster subnetwork.

    When used with Composer 1.x, cannot be specified unless `--enable-ip-alias`
    is also specified.
    z--max-pods-per-nodez    Maximum number of pods that can be assigned to a single node, can be used to
    limit the size of IP range assigned to the node in VPC native cluster setup.

    Cannot be specified unless `--enable-ip-alias` is also specified.
    )rP   r=   z--web-server-allow-ip)ip_rangedescription)speca_      Specifies a list of IPv4 or IPv6 ranges that will be allowed to access the
    Airflow web server. By default, all IPs are allowed to access the web
    server.

    This is a repeated argument that can be specified multiple times to specify
    multiple IP ranges.
    (e.g. `--web-server-allow-ip=ip_range=130.211.160.0/28,description="office network"`
    `--web-server-allow-ip=ip_range=130.211.114.0/28,description="legacy network"`)

    *ip_range*::: IPv4 or IPv6 range of addresses allowed to access the Airflow
    web server.

    *description*::: An optional description of the IP range.
    )rC   rP   r=   z--web-server-deny-allz?    Denies all incoming traffic to the Airflow web server.
    z--web-server-allow-allzB    Allows all IP addresses to access the Airflow web server.
    z--update-web-server-allow-ipaI      Specifies a list of IPv4 or IPv6 ranges that will be allowed to access the
    Airflow web server. By default, all IPs are allowed to access the web
    server.

    *ip_range*::: IPv4 or IPv6 range of addresses allowed to access the Airflow
    web server.

    *description*::: An optional description of the IP range.
    )rP   rC   r=   z--support-web-server-pluginsz\    Enable the support for web server plugins, supported in Composer {}
    or greater.
    )rC   rV   r=   z--enable-private-builds-onlystore_constz    Builds performed during operations that install Python
    packages have only private connectivity to Google services,
    supported in Composer {} or greater.
    )rC   rV   constr=   z--disable-private-builds-onlyz    Builds performed during operations that install Python
    packages have an access to the internet, supported in Composer {} or greater.
    z--cloud-sql-machine-typez    Cloud SQL machine type used by the Airflow database. The list of available
    machine types is available here: https://cloud.google.com/composer/pricing#db-machine-types.
    z--web-server-machine-typez    machine type used by the Airflow web server. The list of available machine
    types is available here: https://cloud.google.com/composer/pricing.
    z--scheduler-cpuz,    CPU allocated to Airflow scheduler.
    )rP   rV   rC   r=   z--dag-processor-cpuzf    CPU allocated to Airflow dag processor, supported in Composer {}
    environments or greater.
    z--triggerer-cpuzw    CPU allocated to Airflow triggerer. Supported in the Environments with Composer {} and Airflow {} and greater.
    z--worker-cpuz-    CPU allocated to each Airflow worker
    z--web-server-cpuz1    CPU allocated to each Airflow web server
    z--scheduler-memory128MB512GBMBGBG)lower_boundupper_boundsuggested_binary_size_scalesdefault_unitzq    Memory allocated to Airflow scheduler, ex. 600MB, 3GB, 2. If units are not provided,
    defaults to GB.
    z--dag-processor-memory1GB128GBz    Memory allocated to Airflow dag processor, ex. 1GB, 3GB, 2. If units are not provided,
    defaults to GB, supported in Composer {} environments or greater.
    z--triggerer-memoryz    Memory allocated to Airflow triggerer, ex. 512MB, 3GB, 2. If units are not provided,
    defaults to GB. Supported in the Environments with Composer {} and Airflow {} and greater.
    z--worker-memoryzn    Memory allocated to Airflow worker, ex. 600MB, 3GB, 2. If units are not provided,
    defaults to GB.
    )rP   rC   rV   r=   z--web-server-memoryzr    Memory allocated to Airflow web server, ex. 600MB, 3GB, 2. If units are not provided,
    defaults to GB.
    z--scheduler-storage5MB10GBzr    Storage allocated to Airflow scheduler, ex. 600MB, 3GB, 2. If units are not provided,
    defaults to GB.
    z--dag-processor-storage0100GBz    Storage allocated to Airflow dag processor, ex. 600MB, 3GB, 2. If units are not provided,
    defaults to GB, supported in Composer {} environments or greater.
    z--worker-storagezo    Storage allocated to Airflow worker, ex. 600MB, 3GB, 2. If units are not provided,
    defaults to GB.
    z--web-server-storagezs    Storage allocated to Airflow web server, ex. 600MB, 3GB, 2. If units are not provided,
    defaults to GB.
    z--min-workersz6    Minimum number of workers in the Environment.
    z--max-workersz6    Maximum number of workers in the Environment.
    )rC   rP   rV   r=   z--scheduler-countzZ    Number of schedulers, supported in the Environments with Airflow 2.0.1 and later.
    )rP   rV   r=   z--dag-processor-countzT    Number of dag processors, supported in Composer {} environments or greater.
    z--triggerer-countzi    Number of triggerers, supported in the Environments with Composer {} and Airflow {} and greater.
    )rV   rP   rC   r=   z--enable-high-resiliencezG    Enable high resilience, supported for Composer 2 Environments.
    )rV   r^   rC   r=   z--disable-high-resiliencezH    Disable high resilience, supported for Composer 2 Environments.
    z#--enable-logs-in-cloud-logging-onlyzR    Enable logs in cloud logging only, supported for Composer 2 Environments.
    z$--disable-logs-in-cloud-logging-onlyzS    Disable logs in cloud logging only, supported for Composer 2 Environments.
    z--cloud-sql-preferred-zonezP    Select cloud sql preferred zone, supported for Composer 2 Environments.
    z--disable-vpc-connectivityzn    Disable connectivity with a user's VPC network,
    supported in Composer {} environments or greater.
    z--enable-private-environmentzw    Disable internet connection from any Composer component,
    supported in Composer {} environments or greater.
    z--disable-private-environmentzv    Enable internet connection from any Composer component,
    supported in Composer {} environments or greater.
    z--enable-triggererz7This flag is deprecated. Use --triggerer-count instead.)rC   warnzn    Enable use of a triggerer, supported in the Environments with Composer {} and Airflow {} and greater.
    z--disable-triggererz9This flag is deprecated. Use --triggerer-count 0 instead.zh    Disable a triggerer, supported in the Environments with Composer {} and Airflow {} and greater.
    z--environment-sizezRSize of the environment. Unspecified means that the default option will be chosen.)release_track)arg_namehelp_strhidden_choicesmessage_enumcustom_mappings)rp   rq   rs   rt   z!--airflow-database-retention-daysz    The number of days for the Airflow database retention period.
      If set to 0, the Airflow database retention mechanism will be disabled.
    z'--enable-cloud-data-lineage-integrationzV    Enable Cloud Data Lineage integration, supported for Composer 2 Environments.
    z(--disable-cloud-data-lineage-integrationzW    Disable Cloud Data Lineage integration, supported for Composer 2 Environments.
    z--storage-bucketz    Name of an exisiting Cloud Storage bucket to be used by the environment.
    Supported only for Composer 2.4.X and above.
    c                 2    [         R                  " U 5      SL$ )zValidates that IPV4 CIDR block arg has valid format.

Intended to be used as an argparse validator.

Args:
  ipv4_cidr_block: str, the IPV4 CIDR block string to validate

Returns:
  bool, True if and only if the IPV4 CIDR block is valid
N)	ipaddressIPv4Network)ipv4_cidr_blocks    r   _IsValidIpv4CidrBlockry     s     
			/t	;;r   z--cluster-ipv4-cidrz    IP address range for the pods in this cluster in CIDR notation
    (e.g. 10.0.0.0/14).

    When used with Composer 1.x, cannot be specified unless `--enable-ip-alias`
    is also specified.
    )rV   rP   r=   z--services-ipv4-cidra      IP range for the services IPs.

    Can be specified as a netmask size (e.g. '/20') or as in CIDR notion
    (e.g. '10.100.0.0/20'). If given as a netmask size, the IP range will
    be chosen automatically from the available space in the network.

    If unspecified, the services CIDR range will be chosen with a default
    mask size.

    When used with Composer 1.x, cannot be specified unless `--enable-ip-alias`
    is also specified.
    z--enable-ip-masq-agenta      When enabled, the IP Masquarade Agent
    (https://cloud.google.com/composer/docs/enable-ip-masquerade-agent)
    is deployed to your environment's cluster.
    It performs many-to-one IP address translations to hide a pod's IP address
    behind the cluster node's IP address. This is done when sending traffic to
    destinations outside the cluster's pod CIDR range.

    When used with Composer 1.x, cannot be specified unless `--enable-ip-alias`
    is also specified.
    am      Disables internet connection from any Composer component.

    When used with Composer 2, the environment cluster is created with
    no public IP addresses on the cluster nodes. If not specified,
    cluster nodes will be assigned public IP addresses.

    When used with Composer 1.x, cannot be specified unless `--enable-ip-alias`
    is also specified.
    z    Enables internet connection for Composer components.

    When used with Composer 2, this means the environment cluster is
    created with public IP addresses on the cluster nodes.

    z--enable-private-endpointaj      Environment cluster is managed using the private IP address of the master
    API endpoint. Therefore access to the master endpoint must be from
    internal IP addresses.

    If not specified, the master API endpoint will be accessible by its public
    IP address.

    Cannot be specified unless `--enable-private-environment` is also
    specified.
    z"--enable-privately-used-public-ipsa      When enabled GKE pods and services may use public(non-RFC1918) IP ranges
    privately. The ranges are specified by '--cluster-ipv4-cidr' and
    `--services-ipv4-cidr` flags.

    Cannot be specified unless `--enable-private-environment` is also
    specified.
    z--connection-subnetworka      Subnetwork from which an IP address for internal communications will be
    reserved. Needs to belong to the Compute network to which the environment is
    connected. Can be the same subnetwork as the one to which the environment is
    connected.

    Can be specified for Composer 2.X or greater. Cannot be specified
    unless `--enable-private-environment` is also specified.
    a^      Mode of internal communication within the Composer environment. Must be one
    of `VPC_PEERING` or `PRIVATE_SERVICE_CONNECT`.

    Can be specified for Composer 2.X or greater. Cannot be specified
    unless `--enable-private-environment` is also specified. Cannot be set to
    `VPC_PEERING` if `--connection-subnetwork` is also specified.
    z--connection-type)rq   rB   rs   c                 v    [         R                  " U 5      nUc  gSUR                  R                  5       S-
  -
  $ )zReturns the size of IPV4 CIDR block mask in bits.

Args:
  ipv4_cidr_block: str, the IPV4 CIDR block string to check.

Returns:
  int, the size of the block mask if ipv4_cidr_block is a valid CIDR block
  string, otherwise None.
N       )rv   rw   num_addresses
bit_length)rx   networks     r   _GetIpv4CidrMaskSizer     s;     !!/2'_	w$$//1A5	66r   c                 \    [        U 5      nU(       d  g[        U 5      nX:*  =(       a    XB:*  $ )a  Validates that IPV4 CIDR block arg for the cluster master is a valid value.

Args:
  ipv4_cidr_block: str, the IPV4 CIDR block string to validate.
  min_mask_size: int, minimum allowed netmask size for CIDR block.
  max_mask_size: int, maximum allowed netmask size for CIDR block.

Returns:
  bool, True if and only if the IPV4 CIDR block is valid and has the mask
  size between min_mask_size and max_mask_size.
F)ry   r   )rx   min_mask_sizemax_mask_sizeis_valid	mask_sizes        r   '_IsValidMasterIpv4CidrBlockWithMaskSizer     s/     #?3(	"?3)		#	B	(BBr   c                     [        U SS5      $ )N      r   cidrs    r   <lambda>r         8r2Fr   z--master-ipv4-cidrz    IPv4 CIDR range to use for the cluster master network. This should have a
    size of the netmask between 23 and 28.

    Cannot be specified unless `--enable-private-environment` is also
    specified.
    c                     [        U SS5      $ N      r   r   s    r   r   r     r   r   z--web-server-ipv4-cidrz    IPv4 CIDR range to use for the Airflow web server network. This should have
    a size of the netmask between 24 and 29.

    Cannot be specified unless `--enable-private-environment` is also
    specified.
    c                     [        U SS5      $ )Nr   r   r   r   s    r   r   r     s    8q"Er   z--cloud-sql-ipv4-cidrz    IPv4 CIDR range to use for the Cloud SQL network. This should have a size
    of the netmask not greater than 24.

    Cannot be specified unless `--enable-private-environment` is also
    specified.
    c                     [        U SS5      $ r   r   r   s    r   r   r     r   r   z--composer-network-ipv4-cidrz    IPv4 CIDR range to use for the Composer network. This must have
    a size of the netmask between 24 and 29.

    Can be specified for Composer 2.X or greater. Cannot be specified
    unless `--enable-private-environment` is also specified.
    c                     [        U SS5      $ )N   r   r   s    r   r   r     r   r   z#--composer-internal-ipv4-cidr-blockz    The IP range in CIDR notation to use internally by Cloud Composer.
    This should have a netmask length of 20.
    Can be specified for Composer {} or greater.
    z$--enable-scheduled-snapshot-creationz      When specified, snapshots of the environment will be created according to a schedule.
      Can be specified for Composer {} or greater.
    )rV   r^   rC   rB   r=   z%--disable-scheduled-snapshot-creationzd      Disables automated snapshots creation.
      Can be specified for Composer {} or greater.
    z--snapshot-creation-schedulez      Cron expression specifying when snapshots of the environment should be created.
      Can be specified for Composer {} or greater.
    )rP   rB   rC   r=   z--snapshot-locationz      The Cloud Storage location for storing automatically created snapshots.
      Can be specified for Composer {} or greater.
    )rP   rC   rB   r=   z--snapshot-schedule-timezonez      Timezone that sets the context to interpret snapshot_creation_schedule.
      Can be specified for Composer {} or greater.
    z--maintenance-window-starta      Start time of the mantenance window in the form of the full date. Only the
    time of the day is used as a reference for a starting time of the window
    with a provided recurrence.
    See $ gcloud topic datetimes for information on time formats.
    )rP   rB   r=   z--maintenance-window-enda      End time of the mantenance window in the form of the full date. Only the
    time of the day is used as a reference for an ending time of the window
    with a provided recurrence. Specified date must take place after the one
    specified as a start date, the difference between will be used as a length
    of a single maintenance window.
    See $ gcloud topic datetimes for information on time formats.
    z--clear-maintenance-windowza    Clears the maintenance window settings.
    Can be specified for Composer {} or greater.
    z--maintenance-window-recurrencez    An RFC 5545 RRULE, specifying how the maintenance window will recur. The
    minimum requirement for the length of the maintenance window is 12 hours a
    week. Only FREQ=DAILY and FREQ=WEEKLY rules are supported.
    z<Group of arguments for setting the maintenance window value.zJGroup of arguments for setting the maintenance window value during update.z!--skip-pypi-packages-installationz^    When specified, skips the installation of custom PyPI packages from
    the snapshot.
    z$--skip-environment-variables-settingzO    When specified, skips setting environment variables from the snapshot.
    z --skip-airflow-overrides-settingzK    When specified, skips setting Airflow overrides from the snapshot.
    z--skip-gcs-data-copyingz\    When specified, skips copying dags, plugins and data folders from
    the snapshot.
    c                     U R                   R                  R                  5       nU(       a  UR                  5       $ S H;  n[	        XR                  SS5      S5      (       d  M&  [        R                  " SS5      e   g)zValidates the KMS key name.

Args:
  args: list of all the arguments

Returns:
  string, a fully qualified KMS resource name

Raises:
  exceptions.InvalidArgumentException: key name not fully specified
)zkms-keyzkms-keyringzkms-locationzkms-project-_Nz	--kms-keyz#Encryption key not fully specified.)CONCEPTSkms_keyParseRelativeNamegetattrreplacer   InvalidArgumentException)argskms_refkeywords      r   GetAndValidateKmsEncryptionKeyr     sj     MM!!'')'!!Jgt__S#.55//
<> > Kr   c                 l    [         R                  " SSSR                  U5      S9R                  U 5        g)a"  Adds a --source flag for a storage import command to a parser.

Args:
  parser: argparse.ArgumentParser, the parser to which to add the flag
  folder: str, the top-level folder in the bucket into which the import
    command will write. Should not contain any slashes. For example, 'dags'.
--sourceTz      Path to a local directory/file or Cloud Storage bucket/object to be
      imported into the {}/ subdirectory in the environment's Cloud Storage
      bucket. Cloud Storage paths must begin with 'gs://'.
      rY   Nr   Argumentr   AddToParserr   folders     r   AddImportSourceFlagr     s2     --
 &. &+f-r   c                 n    [         R                  " SSSSR                  U5      S9R                  U 5        g)a'  Adds a --destination flag for a storage import command to a parser.

Args:
  parser: argparse.ArgumentParser, the parser to which to add the flag
  folder: str, the top-level folder in the bucket into which the import
    command will write. Should not contain any slashes. For example, 'dags'.
--destinationDESTINATIONFaV        An optional subdirectory under the {}/ directory in the environment's
      Cloud Storage bucket into which to import files. May contain forward
      slashes to delimit multiple levels of subdirectory nesting, but should not
      contain leading or trailing slashes. If the DESTINATION does not exist, it
      will be created.
      r<   rB   r=   Nr   r   s     r   AddImportDestinationFlagr     s5     --
 &.
 &+f-r   c                 j    [         R                  " SSR                  U5      S9R                  U 5        g)a!  Adds a --source flag for a storage export command to a parser.

Args:
  parser: argparse.ArgumentParser, the parser to which to add the flag
  folder: str, the top-level folder in the bucket from which the export
    command will read. Should not contain any slashes. For example, 'dags'.
r   z      An optional relative path to a file or directory to be exported from the
      {}/ subdirectory in the environment's Cloud Storage bucket.
      rT   Nr   r   s     r   AddExportSourceFlagr     s/     --
 &.
 &+f-r   c                 P    [         R                  " SSSSS9R                  U 5        g)zAdds a --destination flag for a storage export command to a parser.

Args:
  parser: argparse.ArgumentParser, the parser to which to add the flag
r   r   Tzz      The path to an existing local directory or a Cloud Storage
      bucket/directory into which to export files.
      r   N)r   r   r   )r   s    r   AddExportDestinationFlagr     s*     --
	 ;vr   c                 h    [         R                  " SSSR                  US9S9R                  U 5        g )Ntarget?z      A relative path to a file or subdirectory to delete within the
      {folder} Cloud Storage subdirectory. If not specified, the entire contents
      of the {folder} subdirectory will be deleted.
      )r   )r?   r=   r   r   s     r   AddDeleteTargetPositionalr     s3    --
 &&
! "-V!4r   c                 4    [         R                  " SU 5      SL$ )zValidates that a user-provided arg is a valid environment variable name.

Intended to be used as an argparse validator.

Args:
  name: str, the environment variable name to validate

Returns:
  bool, True if and only if the name is valid
z^[a-zA-Z_][a-zA-Z0-9_]*$N)rematch)r:   s    r   _IsValidEnvVarNamer     s     
,d	34	??r   z--env-variablesan  A comma-delimited list of environment variable `NAME=VALUE` pairs to provide to the Airflow scheduler, worker, and webserver processes. NAME may contain upper and lowercase letters, digits, and underscores, but they may not begin with a digit. To include commas as part of a `VALUE`, see `{top_command} topic escaping` for information about overriding the delimiter.c                 `    [        U 5      nSU::  a  US::  a  U$ [        R                  " S5      e)aD  Validates that a user-provided arg is a valid user port.

Intended to be used as an argparse validator.

Args:
  val: str, a string specifying a TCP port number to be validated

Returns:
  int, the provided port number

Raises:
  ArgumentTypeError: if the provided port is not an integer outside the
      system port range
i   i  z$PORT must be in range [1024, 65535].)intargparseArgumentTypeError)valports     r   IsValidUserPortr   6  s1     
S$	T\demK""#IJJr   c                 X    SnU(       a!  X-  (       a  [         R                  " U S5      egg)a`  Validates that a disk size is a multiple of some number of GB.

Args:
  parameter_name: parameter_name, the name of the parameter, formatted as it
    would be in help text (e.g., `--disk-size` or 'DISK_SIZE')
  disk_size: int, the disk size in bytes, or None for default value

Raises:
  exceptions.InvalidArgumentException: the disk size was invalid
i?z"Must be an integer quantity of GB.N)r   r   )parameter_name	disk_sizegb_masks      r   ValidateDiskSizer   K  s1     '9&

-
-<> > 'Yr   c                     U R                  US9nUR                  [        S9nUR                  U5        UR                  U5        UR                  U5        g)a  Adds flags related to a partial update of arg represented by a dictionary.

Args:
  update_type_group: argument group, the group to which flags should be added.
  clear_flag: flag, the flag to clear dictionary.
  remove_flag: flag, the flag to remove values from dictionary.
  update_flag: flag, the flag to add or update values in dictionary.
  group_help_text: (optional) str, the help info to apply to the created
    argument group. If not provided, then no help text will be applied to
    group.
rT   N)add_argument_groupadd_mutually_exclusive_group&GENERAL_REMOVAL_FLAG_GROUP_DESCRIPTIONr   )update_type_group
clear_flagremove_flagupdate_flaggroup_help_textgroupremove_groups          r   !_AddPartialDictUpdateFlagsToGroupr   \  sY      
.
.O
.
D%331 4 3,&,'% r   c                 L    U R                  SS[        R                  " SS9SS9  g)z~Adds flag related to setting node count.

Args:
  update_type_group: argument group, the group to which flag should be added.
z--node-count
NODE_COUNT   )rd   z>The new number of nodes running the environment. Must be >= 3.)r<   rP   r=   N)add_argumentr   
BoundedIntr   s    r   AddNodeCountUpdateFlagToGroupr   t  s/       !!a0K	 ! Mr   c                 X   U R                  SS9n[        R                  U5        [        R                  U5        [        R                  U5        [
        R                  U5        [        R                  U5        [        R                  U5        U(       a  [        R                  U5        gg)a_  Adds flags related to IP aliasing to parser.

IP alias flags are related to similar flags found within GKE SDK:
  /third_party/py/googlecloudsdk/command_lib/container/flags.py

Args:
  update_type_group: argument group, the group to which flag should be added.
  support_max_pods_per_node: bool, if specifying maximum number of pods is
    supported.
zIP Alias (VPC-native)rT   N)		add_groupENABLE_IP_ALIAS_FLAGr   CLUSTER_IPV4_CIDR_FLAGSERVICES_IPV4_CIDR_FLAG!CLUSTER_SECONDARY_RANGE_NAME_FLAG"SERVICES_SECONDARY_RANGE_NAME_FLAGENABLE_IP_MASQ_AGENT_FLAGMAX_PODS_PER_NODE)r   support_max_pods_per_noder   s      r   AddIpAliasEnvironmentFlagsr     s     
%
%+B
%
C%""5)$$U+%%e,#//6$007''.!!%( r   c                    U R                  SS9n[        R                  U5        [        R                  U5        [        R                  U5        [
        R                  U5        [        R                  U5        [        R                  U5        [        R                  U5        [        R                  U5        U[        R                  R                  :X  a   [        R                  R                  U5        O{U[        R                  R                  :X  a   [         R                  R                  U5        O=U[        R                  R"                  :X  a  [$        R                  R                  U5        [&        R                  U5        g)aN  Adds flags related to private clusters to parser.

Private cluster flags are related to similar flags found within GKE SDK:
  /third_party/py/googlecloudsdk/command_lib/container/flags.py

Args:
  update_type_group: argument group, the group to which flag should be added.
  release_track: which release track messages should we use.
zPrivate ClustersrT   N)r   ENABLE_PRIVATE_ENVIRONMENT_FLAGr    DISABLE_PRIVATE_ENVIRONMENT_FLAGENABLE_PRIVATE_ENDPOINT_FLAGMASTER_IPV4_CIDR_FLAGWEB_SERVER_IPV4_CIDR_FLAGCLOUD_SQL_IPV4_CIDR_FLAGCOMPOSER_NETWORK_IPV4_CIDR_FLAGCONNECTION_SUBNETWORK_FLAGr   ReleaseTrackGACONNECTION_TYPE_FLAG_GA
choice_argBETACONNECTION_TYPE_FLAG_BETAALPHACONNECTION_TYPE_FLAG_ALPHA%ENABLE_PRIVATELY_USED_PUBLIC_IPS_FLAG)r   ro   r   s      r   AddPrivateIpEnvironmentFlagsr     s    
%
%+=
%
>%!--e4"..u5**51##E*''.&&u-!--e4((/d''***&&2259))...((44U;))///))55e<'33E:r   c                     U R                  [        5      n[        R                  U5        [	        U[
        [        [        5        g)zAdds flag related to setting Pypi updates.

Args:
  update_type_group: argument group, the group to which flag should be added.
N)r   $PYPI_PACKAGES_FLAG_GROUP_DESCRIPTIONUPDATE_PYPI_FROM_FILE_FLAGr   r   CLEAR_PYPI_PACKAGES_FLAGREMOVE_PYPI_PACKAGES_FLAGUPDATE_PYPI_PACKAGE_FLAG)r   r   s     r   AddPypiUpdateFlagsToGroupr    s8     
8
8*,%((/#E+C$=$<>r   c                 B    [        U [        [        [        [        5        g)zAdds flags related to updating environent variables.

Args:
  update_type_group: argument group, the group to which flags should be added.
N)r   CLEAR_ENV_VARIABLES_FLAGREMOVE_ENV_VARIABLES_FLAGUPDATE_ENV_VARIABLES_FLAG$ENV_VARIABLES_FLAG_GROUP_DESCRIPTIONr   s    r    AddEnvVariableUpdateFlagsToGroupr    s     $$57O$=$=$HJr   c                 B    [        U [        [        [        [        5        g)zAdds flags related to updating Airflow configurations.

Args:
  update_type_group: argument group, the group to which flags should be added.
N)r   CLEAR_AIRFLOW_CONFIGS_FLAGREMOVE_AIRFLOW_CONFIGS_FLAGUPDATE_AIRFLOW_CONFIGS_FLAG&AIRFLOW_CONFIGS_FLAG_GROUP_DESCRIPTIONr   s    r   "AddAirflowConfigUpdateFlagsToGroupr    s     $$5$>$?$?$J	Lr   c                     U R                  [        SS9nU[        R                  R                  :w  a  [
        R                  U5        [        R                  U5        g)zAdds flag group to perform in-place env upgrades.

Args:
  update_type_group: argument group, the group to which flags should be added.
  release_track: gcloud version to add flags to.
TmutexN)r   ENV_UPGRADE_GROUP_DESCRIPTIONr   r   r   UPDATE_AIRFLOW_VERSION_FLAGr   UPDATE_IMAGE_VERSION_FLAG)r   ro   upgrade_groups      r   AddEnvUpgradeFlagsToGroupr    sN     $66#4 7 1-d''***++M:''6r   c                 Z    U R                  [        5      n[        R                  " U5        g)zAdds flags related to updating environment labels.

Args:
  update_type_group: argument group, the group to which flags should be added.
N)r   LABELS_FLAG_GROUP_DESCRIPTIONr
   AddUpdateLabelsFlags)r   labels_update_groups     r   AddLabelsUpdateFlagsToGroupr    s'     *<<#%""#67r   c                 (   U R                  [        SS9n[        R                  U5        UR                  [        5      n[
        R                  U5        [        R                  U5        [        R                  U5        [        R                  U5        g)zAdds flags related to scheduled snapshot.

Args:
  update_type_group: argument group, the group to which flags should be added.
Tr  N)	r   ,SCHEDULED_SNAPSHOTS_UPDATE_GROUP_DESCRIPTION#DISABLE_SCHEDULED_SNAPSHOT_CREATIONr   %SCHEDULED_SNAPSHOTS_GROUP_DESCRIPTION"ENABLE_SCHEDULED_SNAPSHOT_CREATIONSNAPSHOT_LOCATIONSNAPSHOT_CREATION_SCHEDULESNAPSHOT_SCHEDULE_TIMEZONE)r   update_group scheduled_snapshots_params_groups      r    AddScheduledSnapshotFlagsToGroupr%    s     #552$ 6 @,%11,?%1%D%D+&-"$00&( @A(()IJ(()IJr   c                    U[         R                  R                  :X  a   [        R                  R                  U 5        O{U[         R                  R                  :X  a   [        R                  R                  U 5        O=U[         R                  R                  :X  a  [        R                  R                  U 5        U R                  [        5      n[        R                  U5        [        R                  U5        [        R                  U5        [        R                  U5        [         R                  U5        ["        R                  U5        [$        R                  U5        [&        R                  U5        [(        R                  U5        [*        R                  U5        [,        R                  U5        UR                  [.        SS9nUR                  [0        5      n[2        R                  U5        [4        R                  U5        [6        R                  U5        [8        R                  U5        [:        R                  U5        UR                  [<        5      n[>        R                  U5        [@        R                  U5        [B        R                  U5        [D        R                  U5        [F        R                  U5        g)zAdds flags related to updating autoscaling.

Args:
  update_type_group: argument group, the group to which flags should be added.
  release_track: gcloud version to add flags to.
Tr  N)$r   r   r   ENVIRONMENT_SIZE_GAr   r   r   ENVIRONMENT_SIZE_BETAr   ENVIRONMENT_SIZE_ALPHAr   "AUTOSCALING_FLAG_GROUP_DESCRIPTIONSCHEDULER_CPU
WORKER_CPUWEB_SERVER_CPUSCHEDULER_MEMORYWORKER_MEMORYWEB_SERVER_MEMORYSCHEDULER_STORAGEWORKER_STORAGEWEB_SERVER_STORAGEMIN_WORKERSMAX_WORKERS+TRIGGERER_PARAMETERS_FLAG_GROUP_DESCRIPTION#TRIGGERER_ENABLED_GROUP_DESCRIPTIONTRIGGERER_CPUTRIGGERER_COUNTTRIGGERER_MEMORYENABLE_TRIGGERERDISABLE_TRIGGERER/DAG_PROCESSOR_PARAMETERS_FLAG_GROUP_DESCRIPTIONDAG_PROCESSOR_CPUDAG_PROCESSOR_COUNTDAG_PROCESSOR_MEMORYDAG_PROCESSOR_STORAGENUM_SCHEDULERS)r   ro   r#  triggerer_params_grouptriggerer_enabled_groupdag_processor_params_groups         r    AddAutoscalingUpdateFlagsToGrouprF    s    d''***""../@A))...$$001BC))///%%112CD"55(*,L)&\*|,L)--\*  .,',''::1 ; ?2EE)+34566767 67+>>5   :;!!"<=""#=>##$>? \*r   c                     U R                  [        5      n[        R                  U5        [        R                  U5        [
        R                  U5        g)zAdds flag group for master authorized networks.

Args:
  update_type_group: argument group, the group to which flags should be added.
N)r   ,MASTER_AUTHORIZED_NETWORKS_GROUP_DESCRIPTIONMASTER_AUTHORIZED_NETWORKS_FLAGr   &ENABLE_MASTER_AUTHORIZED_NETWORKS_FLAG'DISABLE_MASTER_AUTHORIZED_NETWORKS_FLAG)r   r#  s     r   -AddMasterAuthorizedNetworksUpdateFlagsToGrouprL  9  sA     #5524,!--l;(44\B)55lCr   c                     U R                  [        5      n[        R                  U5        [        R                  U5        [
        R                  U5        g)z~Adds flag group for maintenance window.

Args:
  create_type_group: argument group, the group to which flags should be added.
N)r   )MAINTENANCE_WINDOW_FLAG_GROUP_DESCRIPTIONMAINTENANCE_WINDOW_START_FLAGr   MAINTENANCE_WINDOW_END_FLAG"MAINTENANCE_WINDOW_RECURRENCE_FLAG)create_type_groupr   s     r   AddMaintenanceWindowFlagsGrouprS  F  s?     
%
%&O
P%++E2))%0$007r   c                     U R                  [        SS9n[        R                  U5        UR	                  [
        5      n[        R                  U5        [        R                  U5        [        R                  U5        g)zAdds flag group for maintenance window used for an update operation.

Args:
  update_type_group: argument group, the group to which flags should be added.
Tr  N)	r   0MAINTENANCE_WINDOW_FLAG_UPDATE_GROUP_DESCRIPTIONCLEAR_MAINTENANCE_WINDOW_FLAGr   r   rN  rO  rP  rQ  )r   r#  r   s      r   $AddMaintenanceWindowFlagsUpdateGrouprW  R  sj     #556d 6 D,  ++L9

 
 !J
K%++E2))%0$007r   c                     U R                  [        5      nUR                  SS9n[        R                  U5        [        R                  U5        g)zAdds flag group for Cloud Data Lineage integration.

Args:
  update_type_group: argument group, the group to which flags should be added.
Tr  N)r   0CLOUD_DATA_LINEAGE_INTEGRATION_GROUP_DESCRIPTION*ENABLE_CLOUD_DATA_LINEAGE_INTEGRATION_FLAGr   +DISABLE_CLOUD_DATA_LINEAGE_INTEGRATION_FLAG)r   r#  update_enable_disable_groups      r   0AddCloudDataLineageIntegrationUpdateFlagsToGroupr]  c  sO     #5568, !- ? ?d ? K,88!#-99!#r   c                    [         R                  U 5        U R                  SS9n[        R                  U5        [        R                  U5        U R                  SS9n[
        R                  U5        [        R                  U5        UR                  SS9n[        R                  U5        [        R                  U5        [        R                  U 5        [        R                  U 5        g)zAdds Composer 3 flags to an update group.

Args:
  update_type_group: argument group, the group to which flags should be added.
Tr  z Virtual Private Cloud networkingrT   N)SUPPORT_WEB_SERVER_PLUGINSr   r   ENABLE_PRIVATE_BUILDS_ONLYDISABLE_PRIVATE_BUILDS_ONLYNETWORK_ATTACHMENTDISABLE_VPC_CONNECTIVITYr   NETWORK_FLAGSUBNETWORK_FLAG&ENABLE_PRIVATE_ENVIRONMENT_UPDATE_FLAG'DISABLE_PRIVATE_ENVIRONMENT_UPDATE_FLAG)r   private_builds_only_groupvpc_connectivity_groupnetwork_subnetwork_groups       r   AddComposer3FlagsToGrouprk  s  s     (():;/BB C  (()BC))*CD,?? @    !78&&'=>3==- >  3467(445FG)556GHr   c                     U (       a  U $ [         R                  " SS9nU(       a  [         R                  " U5      /$ [        R                  " X5      e)a  Provides a list containing composer/location if `location_refs` is empty.

This intended to be used as a fallthrough for a plural Location resource arg.
The built-in fallthrough for plural resource args doesn't play well with
properties, as it will iterate over each character in the string and parse
it as the resource type. This function will parse the entire property and
return a singleton list if `location_refs` is empty.

Args:
  location_refs: [core.resources.Resource], a possibly empty list of location
    resource references
  flag_name: str, if `location_refs` is empty, and the composer/location
    property is also missing, an error message will be reported that will
    advise the user to set this flag name
  failure_msg: str, an error message to accompany the advisory described in
    the docs for `flag_name`.

Returns:
  [core.resources.Resource]: a non-empty list of location resourc references.
  If `location_refs` was non-empty, it will be the same list, otherwise it
  will be a singleton list containing the value of the [composer/location]
  property.

Raises:
  exceptions.RequiredArgumentException: both the user-provided locations
      and property fallback were empty
F)rB   )r   GetLocationParseLocationr   RequiredArgumentException)location_refs	flag_namefailure_msgfallthrough_locations       r   FallthroughToLocationPropertyrt    sG    8  ,,e<!!"6788

.
.y
FFr   c                     U  H?  n[         R                  (       a  UR                  5       n [        R                  " U5        MA     g!   [
        R                  " SR                  U5      5      e= f)zValidates list of IP ranges.

Raises exception when any of the given strings is not a valid IPv4
or IPv6 network IP range.
Args:
  ip_ranges: [string], list of IP ranges to validate
zInvalid IP range: [{}].N)sixPY2decoderv   
ip_networkr   r   r   )	ip_rangesrZ   s     r   ValidateIpRangesr{    s\     h
ww"h68$	 
6..
#
*
*8
46 6s   A'A.r&   )r5   r   rv   r   googlecloudsdk.api_lib.composerr   api_utilgooglecloudsdk.callioper   r   r   r   #googlecloudsdk.command_lib.composerr   r   $googlecloudsdk.command_lib.util.apisr	   $googlecloudsdk.command_lib.util.argsr
   googlecloudsdk.corer   rv  MIN_TRIGGERER_AIRFLOW_VERSIONMIN_TRIGGERER_COMPOSER_VERSIONMIN_COMPOSER3_VERSION(MIN_SCHEDULED_SNAPSHOTS_COMPOSER_VERSION$MIN_COMPOSER_RUN_AIRFLOW_CLI_VERSIONPREREQUISITE_OPTION_ERROR_MSG!ENABLED_TRIGGERER_IS_REQUIRED_MSG.INVALID_OPTION_FOR_MIN_IMAGE_VERSION_ERROR_MSG _INVALID_OPTION_FOR_V2_ERROR_MSG _INVALID_OPTION_FOR_V1_ERROR_MSGCOMPOSER3_IS_REQUIRED_MSGCOMPOSER3_IS_NOT_SUPPORTED_MSGr,   _StoreActionr.   r8   RegexpValidator_AIRFLOW_VERSION_TYPE_IMAGE_VERSION_TYPEr   ENVIRONMENT_NAME_ARGMULTI_ENVIRONMENT_NAME_ARGMULTI_OPERATION_NAME_ARGOPERATION_NAME_ARGArgRequiredInUniverseStorePropertyVALUEScomposerlocationLOCATION_FLAG_ENV_VAR_NAME_ERROR_INVALID_IPV4_CIDR_BLOCK_ERROR)_INVALID_GKE_MASTER_IPV4_CIDR_BLOCK_ERROR)_INVALID_WEB_SERVER_IPV4_CIDR_BLOCK_ERROR(_INVALID_CLOUD_SQL_IPV4_CIDR_BLOCK_ERROR/_INVALID_COMPOSER_NETWORK_IPV4_CIDR_BLOCK_ERROR0_INVALID_COMPOSER_INTERNAL_IPV4_CIDR_BLOCK_ERROR_ENVIRONMENT_SIZE_MAPPING_ENVIRONMENT_SIZE_MAPPING_ALPHAr  r	  ArgDictstrUpdateActionr  ArgListr
  r  r  r  r  r  r  r  r   r  r   r   r*  r   r  r  r6  r=  r7  rH  rY  r   r   r   r   rK  rJ  rI  r   rd  re  rb  r   r   r   WEB_SERVER_ALLOW_IPWEB_SERVER_DENY_ALLWEB_SERVER_ALLOW_ALLUPDATE_WEB_SERVER_ALLOW_IPr_  r`  ra  CLOUD_SQL_MACHINE_TYPEWEB_SERVER_MACHINE_TYPEfloatr+  r>  r8  r,  r-  
BinarySizer.  r@  r:  r/  r0  r1  rA  r2  r3  r4  r5  rB  r?  r9  ENABLE_HIGH_RESILIENCEDISABLE_HIGH_RESILIENCE!ENABLE_LOGS_IN_CLOUD_LOGGING_ONLY"DISABLE_LOGS_IN_CLOUD_LOGGING_ONLYCLOUD_SQL_PREFERRED_ZONErc  rf  rg  DeprecationActionr;  r<  ChoiceEnumMapperGetMessagesModuler   r   EnvironmentConfigEnvironmentSizeValueValuesEnumr'  r   r(  r   r)  AIRFLOW_DATABASE_RETENTION_DAYSrZ  r[  STORAGE_BUCKET_FLAGry   CustomFunctionValidator IPV4_CIDR_BLOCK_FORMAT_VALIDATORr   r   r   r   r   r   r   r   CONNECTION_TYPE_FLAG_HELPNetworkingConfigConnectionTypeValueValuesEnumr   r   r   r   r    _IS_VALID_MASTER_IPV4_CIDR_BLOCK'MASTER_IPV4_CIDR_BLOCK_FORMAT_VALIDATORr   $_IS_VALID_WEB_SERVER_IPV4_CIDR_BLOCK+WEB_SERVER_IPV4_CIDR_BLOCK_FORMAT_VALIDATORr   #_IS_VALID_CLOUD_SQL_IPV4_CIDR_BLOCK*CLOUD_SQL_IPV4_CIDR_BLOCK_FORMAT_VALIDATORr   *_IS_VALID_COMPOSER_NETWORK_IPV4_CIDR_BLOCK1COMPOSER_NETWORK_IPV4_CIDR_BLOCK_FORMAT_VALIDATORr   3_IS_VALID_COMPOSER_INTERNAL_NETWORK_IPV4_CIDR_BLOCK:COMPOSER_INTERNAL_NETWORK_IPV4_CIDR_BLOCK_FORMAT_VALIDATOR COMPOSER_INTERNAL_IPV4_CIDR_FLAGr  r  r!  r   r"  Datetimer   rO  rP  rV  rQ  rN  rU  SKIP_PYPI_PACKAGES_INSTALLATION"SKIP_ENVIRONMENT_VARIABLES_SETTINGSKIP_AIRFLOW_OVERRIDES_SETTINGSKIP_COPYING_GCS_DATAr   r   r   r   r   r   r   ENV_VAR_NAME_FORMAT_VALIDATORCREATE_ENV_VARS_FLAGr   r   r   r   r   r   r  r  r  r  r  r%  rF  rL  rS  rW  r]  rk  rt  r{  r+   r   r   <module>r     s   :   	 < + / ( . 7 D : < * 
 ' !)  +3 ('. $! % !2 .$  $   " 
9> /t/OQMX22 MQM /u/OQOX22 OQO $331$ 
 "11o?@  }}
F!>@  "]]
F#,IK   ==
F#,OQ  ]]
F!DF  ..T 
<  !2!2!;!;!D!DE=  #G A * C * C ) A 0$ 1
 %2%'%$1  %2%'%$1#  B ' "]]
	  #mm			cc	:##
	 $ #mm				##
	  > % !MM			cc	:##
	 & !MM				##
	   ==
		  G  #mm	

		   !MM	
		 0 "]]&
	  ;  *Q & G % #fEF &
%v&NO -
&78 ,
&./ 0!!'(F!G $
 O -# 1  ==
		   ==3
	 0 !MM				##
	  }}
			  +/--*
	+	 ' *.)
	*	 & #'--"				
	#	  %)MM$

%	 ! }}	4	 --	) ]]
 	$%  &*]]%
	&	 " MM	
	  mm			# 

	 . mm
	  }}
	  "]]"			# 
 	
	 $ "]]"
 	$%  "]]"

 	$%
  #mm#

 	$%	  	!
		  --	!
		  	!
	 MM	!
 	$%	  	!
-/LMO ]]	!
	
 	!
	 ==			&*D\	

 !
	  }}			&*D\	
 !
 	$%   ==			&*D\	

 !
 	-/LMO  			&*D\	

 "
	 MM			&*D\	

 "
	  MM			&*D\	

 "
	  			&*D\	
 "
 	$%   			&*D\	

 "
	 ]]			&*D\	

 "
	  mm	!
	 mm!	
	 	
		 mm	!
$%  --	!
-/LM 

  --

  %)MM)

% ! &*]]*

& "  == !
	   == 

 	$%	  *."
 	$%* & +/--#
 	$%+ ' ==
$$./

-/LMO  MM
$$01

-/LMO   00!	 "?++''**66-  "22!	 "?++'',,66-  #33!	 ++''--663
  #'--'	
	#	  .2]]-
	.	 * /3mm.
	/	 + mm	!
	 < $/#F#F9$;   	)
	
	  --	)
		 $ !MM

		   #'--"	
	#   $(==#
	$    $}}

	 	   )-(
	)	 % "]]!
		   '77&++''--//?/?""$  &66&++'',,..>.>""$  $44&++$:K:K:N:NO335 7"C, G ! +6*M*M$&O+Q ' 	0
	
	  G % /:.Q.Q(-// + !MM	4
	
	  F $ .9-P-P',.. *  ==	3
	
	  G + 5@4W4W.355 1 #'--"	:!
#	  G 4 '';8 ; $(==)	C!
 	$%	$'   &*]]*

 	78	&: " '+mm+

 	78': # "]]"	!
 	78:  MM	!
 	78:  "]]"	!
 	78:  !% 				#	#
		!	  #mm				#	#
		  !% 
 	$%!'  &*]]%	
	&	 " C * Q 1 #'--'
	#	  &*]]*
	&	 " "&&
	"	  
		 >*.$.*.  5@ !, C C+!- }}			.3
@##
AB K*>* 7;	!0
M).;8>	J
L78K(.+b
D	88"# I:#GL6r   