
    u              	           S r SSKJr  SSKJr  SSKJr  \R                  " SS\R                  S\R                  SS	9rS
 rS rS rS rS rS rg)z=Flags and helpers for the compute os-config related commands.    )
completers)flags)
exceptionsinstanceinstance_namezcompute.instancesF)resource_namename	completerzonal_collectionzone_explanationpluralc                     U R                  S[        SR                  US9S9  U R                  SSSR                  US9S	9  g
)z2Adds flags for os-config update command to parser.PATCH_DEPLOYMENT_IDz        Name of the patch deployment to update.

        To get a list of patch deployments that are available for update, run
        the `gcloud {release_track} compute os-config patch-deployments list`
        command.)release_tracktypehelp--fileTz        The JSON or YAML file with the patch deployment to update. For
        information about the patch deployment format, see https://cloud.google.com/compute/docs/osconfig/rest/{api_version}/projects.patchDeployments.api_versionrequiredr   Nadd_argumentstrformat)parserr   r   s      9lib/googlecloudsdk/command_lib/compute/os_config/flags.pyAddPatchDeploymentsUpdateFlagsr       s]    
 FF7  	 	[ v+v&      c                 j    U R                  S[        SS9  U R                  SSSR                  US9S9  g	)
z2Adds flags for os-config create command to parser.r   z        Name of the patch deployment to create.

        This name must contain only lowercase letters, numbers, and hyphens,
        start with a letter, end with a number or a letter, be between 1-63
        characters, and unique within the project.r   r   Tz        The JSON or YAML file with the patch deployment to create. For
        information about the patch deployment format, see https://cloud.google.com/compute/docs/osconfig/rest/{api_version}/projects.patchDeployments.r   r   Nr   )r   r   s     r   AddPatchDeploymentsCreateFlagsr"   6   sO    6  	 	[ v+v&  r    c                     [        X5        U R                  S5      n U R                  S5      n[        U5      S:X  a  [	        S U 5       5      (       a  g[
        R                  " SR                  U USS95      e)	zPerforms basic syntax check on a zone; doesn't validate whether it exists.

Args:
  value: str, the zone to validate
  flag_name: str, the flag's name; included in the exception's message

Raises:
  exceptions.Error: if value is an invalid zone
zu--   c              3   @   #    U  H  oR                  5       v   M     g 7f)N)isalnum).0ps     r   	<genexpr>ValidateZone.<locals>.<genexpr>Y   s     8%QYY[[%s   NzIInvalid value `{value}` for flag {flag_name}. For valid values, see {url}z3https://cloud.google.com/compute/docs/regions-zones)value	flag_nameurl)ValidateFlagNotEmptyremoveprefixsplitlenallr   Errorr   )r,   r-   partss      r   ValidateZoner6   L   s{     u(


T
"%
++c
%Z1_8%888
$$*FC %+ %E	F Fr    c                 D    U (       d  [         R                  " SU-   5      eg)zEnsures that value is not empty.

Args:
  value: str, the value to check
  flag_name: str, the flag's name; included in the exception's message

Raises:
  exceptions.Error: if value is empty
zMissing required flag Nr   r4   )r,   r-   s     r   r/   r/   c   s#     



3i?
@@ 
r    c                 D    U (       d  [         R                  " SU-   5      eg)zPerforms syntax check on an instance value; doesn't check whether it exists.

Args:
  value: str, the instance value to check
  param_name: str, the parameter's name; included in the exception's message

Raises:
  exceptions.Error: if value is empty
Missing required parameter Nr8   r,   
param_names     r   ValidateInstancer=   q   #     



8:E
FF 
r    c                 D    U (       d  [         R                  " SU-   5      eg)a  Check if os policy assignment id is non-null/empty; doesn't check whether it exists.

Args:
  value: str, the os policy assignment id value to check
  param_name: str, the parameter's name; included in the exception's message

Raises:
  exceptions.Error: if value is empty
r:   Nr8   r;   s     r   "ValidateInstanceOsPolicyAssignmentr@      r>   r    N)__doc__"googlecloudsdk.command_lib.computer   compute_completersr   compute_flagsgooglecloudsdk.corer   ResourceArgumentInstancesCompleterZONE_PROPERTY_EXPLANATIONINSTANCES_ARG_FOR_OS_UPGRADEr   r"   r6   r/   r=   r@    r    r   <module>rK      sj    D P E *  -==	 33("<<  ,,F.AGGr    