
                  	           S 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  \	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.    )absolute_import)division)unicode_literals)
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%   9   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>\   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/   r0   partss      r!   ValidateZoner9   O   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   r7   )r/   r0   s     r!   r2   r2   f   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 Nr;   r/   
param_names     r!   ValidateInstancer@   t   #     



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=   Nr;   r>   s     r!   "ValidateInstanceOsPolicyAssignmentrC      rA   r#   N)__doc__
__future__r   r   r   "googlecloudsdk.command_lib.computer   compute_completersr   compute_flagsgooglecloudsdk.corer   ResourceArgumentInstancesCompleterZONE_PROPERTY_EXPLANATIONINSTANCES_ARG_FOR_OS_UPGRADEr"   r%   r9   r2   r@   rC    r#   r!   <module>rO      sp    D &  ' O E *  -==	 33("<<  ,,F.AGGr#   