
                         p   S r SSKJr  SSKJr  SSKJ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 rS rS rS rS rS r SNS jr SNS jrSNS jrS r SOS jrSPS jrSQS jrSQS jrSQS jrS r S r!S r"SQS jr#SQS  jr$SQS! jr%S" r&SQS# jr'SQS$ jr(SQS% jr)S& r*SQS' jr+SQS( jr,SQS) jr-SQS* jr.SQS+ jr/S, r0S- r1S. r2S/ r3S0 r4S1 r5SQS2 jr6S3 r7S4 r8SQS5 jr9S6 r:S7 r;S8 r<S9 r=S: r>S; r?S< r@S= rAS> rBS? rCS@ rDSA rESB rFSC rGSD rHSE rISF rJSRSG jrKSQSH jrLSI rMSJ rNSK rOSL rPSM rQg)Sz.Flags for Workstation Config related commands.    )absolute_import)division)unicode_literalsN)actions)arg_parsers)base)concepts)deps)concept_parsers)
propertiesc                 B    [         R                  R                  U 5        g)zAdds --async flag.N)r   
ASYNC_FLAGAddToParser)parsers    4lib/googlecloudsdk/command_lib/workstations/flags.pyAddAsyncFlagr       s    //f%    c                 *    SnU R                  SSUS9  g)zPAdds a --allow-unauthenticated-cors-preflight-requests flag to the given parser.      By default, the workstations service makes sure that all requests to the
    workstation are authenticated. CORS preflight requests do
    not include cookies or custom headers, and so are considered
    unauthenticated and blocked by the workstations service. Enabling this
    option allows these unauthenticated CORS preflight requests through to
    the workstation, where it becomes the responsibility of the destination
    server in the workstation to validate the request
  /--allow-unauthenticated-cors-preflight-requests
store_trueactionhelpNadd_argumentr   	help_texts     r   0AddAllowUnauthenticatedCorsPreflightRequestsFlagr   %   s'    ) 	7  r   c                 p    SnU R                  5       nUR                  SSUS9  SnUR                  SSUS9  g)zSAdds a --disallow-unauthenticated-cors-preflight-requests flag to the given parser.r   r   r   r   J  If set, requires that all requests to the workstation are authenticated.z2--disallow-unauthenticated-cors-preflight-requestsNadd_mutually_exclusive_groupr   r   r   groups      r   9AddDisallowUnauthenticatedCorsPreflightRequestsToggleFlagr&   7   sY    ) 
-
-
/%7  N):  r   c                 *    SnU R                  SSUS9  g)z@Adds a --disable-localhost-replacement flag to the given parser.e      By default, the workstations service replaces references to localhost,
    127.0.0.1, and 0.0.0.0 with the workstation's hostname in http responses
    from the workstation so that applications under development run properly
    on the workstation. This may intefere with some applications, and so
    this option allows that behavior to be disabled.
  --disable-localhost-replacementr   r   Nr   r   s     r   "AddDisableLocalhostReplacementFlagr*   S   s'    ) 	'  r   c                 p    SnU R                  5       nUR                  SSUS9  SnUR                  SSUS9  g)z?Adds a --enable-localhost-replacement flag to the given parser.r(   r)   r   r   r!   z--enable-localhost-replacementNr"   r$   s      r   (AddDisableLocalhostReplacementToggleFlagr,   c   sY    ) 
-
-
/%'  N)&  r   c           	          SnU R                  SS[        R                  " [        [        S.SS/S9[        R                  " 5       US9  g	)
z0Adds a --allowed-ports flag to the given parser.a<    A Single or Range of ports externally accessible in the workstation.
  If not specified defaults to ports 22, 80 and ports 1024-65535.

  To specify a single port, both first and last should be same.

  Example:

    $ {command} --allowed-ports=first=9000,last=9090
    $ {command} --allowed-ports=first=80,last=80z--allowed-portsALLOWED_PORTS)firstlastr/   r0   specrequired_keysmetavartyper   r   N)r   r   	ArgObjectintFlattenActionr   s     r   AddAllowedPortsFlagr:   }   sX    	4) 	   !&) &&(  r   c                 &   / nU (       aG  UR                  [        R                  " [        R                  R
                  R                  5      5        U(       a%  UR                  [        R                  " S SS95        [        R                  " SUSS9$ )a   Create a location attribute in resource argument.

Args:
  location_fallthrough: If set, enables fallthroughs for the location
    attribute.
  global_fallthrough: If set, enables global fallthroughs for the location
    attribute.

Returns:
  Location resource argument parameter config
c                      gN- r?   r   r   <lambda>*LocationsAttributeConfig.<locals>.<lambda>   s    r   zdefault is all regionshintregionzThe region for the {resource}.namefallthroughsr   )
appendr
   PropertyFallthroughr   VALUESworkstationsrD   Fallthroughr	    ResourceParameterAttributeConfig)location_fallthroughglobal_fallthroughrG   s      r   LocationsAttributeConfigrP      s|     ,  !2!2!?!?!F!FG +CD 
	2	20
 r   c                 &   / nU (       aG  UR                  [        R                  " [        R                  R
                  R                  5      5        U(       a%  UR                  [        R                  " S SS95        [        R                  " SUSS9$ )a  Create a cluster attribute in resource argument.

Args:
  cluster_fallthrough: If set, enables fallthroughs for the cluster attribute.
  global_fallthrough: If set, enables global fallthroughs for the cluster
    attribute.

Returns:
  Cluster resource argument parameter config
c                      gr=   r?   r?   r   r   r@   )ClustersAttributeConfig.<locals>.<lambda>       Cr   zdefault is all clustersrB   clusterzThe cluster for the {resource}.rE   )
rH   r
   rI   r   rJ   rK   rU   rL   r	   rM   )cluster_fallthroughrO   rG   s      r   ClustersAttributeConfigrW      s     ,  !2!2!?!?!G!GH *	
 
	2	21
 r   c                 &   / nU (       aG  UR                  [        R                  " [        R                  R
                  R                  5      5        U(       a%  UR                  [        R                  " S SS95        [        R                  " SUSS9$ )aA  Create a config attribute in resource argument.

Args:
  config_fallthrough: If set, enables fallthroughs for the config attribute
    using the value set in workstations/config.
  global_fallthrough: If set, enables global fallthroughs for the config
    attribute.

Returns:
  Config resource argument parameter config
c                      gr=   r?   r?   r   r   r@   (ConfigsAttributeConfig.<locals>.<lambda>   rT   r   zdefault is all configsrB   configzThe config for the {resource}.rE   )
rH   r
   rI   r   rJ   rK   r[   rL   r	   rM   )config_fallthroughrO   rG   s      r   ConfigsAttributeConfigr]      s     ,  !2!2!?!?!F!FG )	
 
	2	20
 r   c                  ,    [         R                  " SSS9$ )zpCreate a workstation attribute in resource argument.

Returns:
  Workstation resource argument parameter config
workstationzThe workstation.)rF   r   )r	   rM   r?   r   r   WorkstationsAttributeConfigr`      s     
	2	2"
 r   c                     [         R                  " SSU[        US9[        SUS9[	        SUS9[         R
                  SS9n[        R                  R                  U(       a  S	OSUS
SS9R                  U 5        g)z"Create a config resource argument.zFworkstations.projects.locations.workstationClusters.workstationConfigsr[   )rO   T)rV   rO   )rN   rO   F)resource_nameapi_versionworkstationConfigsIdworkstationClustersIdlocationsId
projectsIddisable_auto_completersz--configz(The group of arguments defining a configrequiredN)
r	   ResourceSpecr]   rW   rP    DEFAULT_PROJECT_ATTRIBUTE_CONFIGr   ConceptParserForResourcer   )r   rc   flag_anchorrO   r2   s        r   AddConfigResourceArgrp     s     
		N1/ 4"7I +#8J ::#
$  ++jX
0	 , 
 Kr   c                     [         R                  " SSU[        5       [        SS9[	        SS9[        SS9[         R                  S9n[        R                  R                  SUSSS	9R                  U 5        g
)z'Create a workstation resource argument.zSworkstations.projects.locations.workstationClusters.workstationConfigs.workstationsr_   T)r\   )rV   )rN   )rb   rc   workstationsIdrd   re   rf   rg   z-The group of arguments defining a workstationri   N)r	   rk   r`   r]   rW   rP   rl   r   rm   rn   r   )r   rc   r2   s      r   AddWorkstationResourceArgrs     su    			[!021TJ3M*E::	
$ ++
5	 , 
 Kr   c                 F    SnU R                  SU(       a  SOS[        US9  g)z0Adds an --idle-timeout flag to the given parser.z  How long (in seconds) to wait before automatically stopping an instance that
  hasn't received any user traffic. A value of 0 indicates that this instance
  should never time out due to idleness.
  z--idle-timeout   Ndefaultr6   r   r   r8   r   use_defaultr   s      r   AddIdleTimeoutFlagr{   1  s.    )
 	!dt	  r   c                 F    SnU R                  SU(       a  SOS[        US9  g)z3Adds an --running-timeout flag to the given parser.z  How long (in seconds) to wait before automatically stopping a workstation
  after it started. A value of 0 indicates that workstations using this config
  should never time out.
  z--running-timeoutru   Nrv   rx   ry   s      r   AddRunningTimeoutFlagr}   @  s.    )
 	!dt	  r   c                 F    SnU R                  S[        U(       a  SOSUS9  g)z/Adds a --machine-type flag to the given parser.z  Machine type determines the specifications of the Compute Engine machines
  that the workstations created under this configuration will run on.z--machine-typeze2-standard-4Nr6   rw   r   r   strry   s      r   AddMachineTypeFlagr   O  s/    I) 	!,o$	  r   c                 (    SnU R                  SUS9  g)z2Adds a --service-account flag to the given parser.a%    Email address of the service account that will be used on VM instances used to
  support this config. This service account must have permission to pull the
  specified container image. If not set, VMs will run without a service account,
  in which case the image must be publicly accessible.z--service-accountr   Nr   r   s     r   AddServiceAccountFlagr   \  s    :)
 	)	:r   c                 R    SnU R                  SS[        R                  " 5       US9  g)z9Adds a --service-account-scopes flag to the given parser.z  Scopes to grant to the service_account. Various scopes are
  automatically added based on feature usage. When specified, users of
  workstations under this configuration must have
  iam.serviceAccounts.actAs` on the service account.
  z--service-account-scopesSERVICE_ACCOUNT_SCOPESr5   r6   r   Nr   r   ArgListr   s     r   AddServiceAccountScopesr   f  s3    ) 	 & 	  r   c                 R    SnU R                  SS[        R                  " 5       US9  g)z/Adds a --network-tags flag to the given parser.z  Network tags to add to the Google Compute Engine machines backing the
  Workstations.

  Example:

    $ {command} --network-tags=tag_1,tag_2
  z--network-tagsNETWORK_TAGSr   Nr   r   s     r   AddNetworkTagsr   v  s3    ) 	 	  r   c                 F    SnU R                  SU(       a  SOS[        US9  g)z,Adds a --pool-size flag to the given parser.z=  Number of instances to pool for faster Workstation startup.z--pool-sizer   Nrv   rx   ry   s      r   AddPoolSizer     s-    A)aD	  r   c                 >    SnU R                  SSU(       a  SOSUS9  g)z>Adds a --disable-public-ip-addresses flag to the given parser.zM  Default value is false.
  If set, instances will have no public IP address.z--disable-public-ip-addressesr   FNr   rw   r   r   ry   s      r   AddDisablePublicIpAddressesr     s.    7) 	%"e	  r   c                 >    SnU R                  SSU(       a  SOSUS9  g)z:Adds a --disable-tcp-connections flag to the given parser.zS  Default value is false.
  If set, workstations don't allow plain TCP connections.--disable-tcp-connectionsr   FNr   r   ry   s      r   AddDisableTcpConnectionsr     s.    =) 	!"e	  r   c                 p    SnU R                  5       nUR                  SSUS9  SnUR                  SSUS9  g)z9Adds a --enable-tcp-connections flag to the given parser.z3  If set, workstations allow plain TCP connections.z--enable-tcp-connectionsr   r   z9  If set, workstations don't allow plain TCP connections.r   Nr"   r$   s      r   AddEnableTcpConnectionsr     sX    7) 
-
-
/%   =)!  r   c                 >    SnU R                  SSU(       a  SOSUS9  g)z5Adds --shielded-secure-boot flag to the given parser.zL  Default value is false.
  If set, instances will have Secure Boot enabled.z--shielded-secure-bootr   FNr   r   ry   s      r   AddShieldedSecureBootr     s.    6) 	"e	  r   c                 >    SnU R                  SSU(       a  SOSUS9  g)z0Adds a --shielded-vtpm flag to the given parser.zE  Default value is false.
  If set, instances will have vTPM enabled.z--shielded-vtpmr   FNr   r   ry   s      r   AddShieldedVtpmr     s.    /) 	"e	  r   c                 >    SnU R                  SSU(       a  SOSUS9  g)z@Adds a --shielded-integrity-monitoring flag to the given parser.zU  Default value is false.
  If set, instances will have integrity monitoring enabled.z--shielded-integrity-monitoringr   FNr   r   ry   s      r   AddShieldedIntegrityMonitoringr     s.    ?) 	'"e	  r   c                 2    SnU R                  S[        US9  g)z5Adds a --source-workstation flag to the given parser.a    Source workstation from which this workstations persistent directories are
  cloned on creation. When specified, the workstations service agent must have
  `compute.disks.createSnapshot` and `compute.snapshots.useReadOnly` permissions
  on the source workstation's host project.
  z--source-workstationr6   r   Nr   r   s     r   AddSourceWorkstationr     s'    ) 	  r   c                 >    SnU R                  SSU(       a  SOSUS9  g)z6Adds an --enable-audit-agent flag to the given parser.z  Whether to enable Linux `auditd` logging on the workstation. When enabled,
  a service account must also be specified that has `logging.buckets.write`
  permission on the project.z--enable-audit-agentr   FNr   r   ry   s      r   AddEnableAuditAgentr     s.     ) 	"e	  r   c                 >    SnU R                  SSU(       a  SOSUS9  g)zIAdds a --grant-workstation-admin-role-on-create flag to the given parser.z  Default value is false.
  If set, creator of a workstation will get `roles/workstations.policyAdmin`
  role along with `roles/workstations.user` role on the workstation created by
  them.z(--grant-workstation-admin-role-on-creater   FNr   r   ry   s      r   $AddGrantWorkstationAdminRoleOnCreater     s.    )
 	0"e	  r   c                 >    SnU R                  SSU(       a  SOSUS9  g)z?Adds an --enable-confidential-compute flag to the given parser.zU  Default value is false.
  If set, instances will have confidential compute enabled.z--enable-confidential-computer   FNr   r   ry   s      r   AddEnableConfidentialComputer     s.    ?) 	%"e	  r   c                 >    SnU R                  SSU(       a  SOSUS9  g)z@Adds an --enable-nested-virtualization flag to the given parser.zV  Default value is false.
  If set, instances will have nested virtualization enabled.z--enable-nested-virtualizationr   FNr   r   ry   s      r   AddEnableNestedVirtualizationr   #  s/    @) 	&"e	  r   c                 F    SnU R                  SU(       a  SOS[        US9  g)z1Adds a --boot-disk-size flag to the given parser.z  Size of the boot disk in GB.z--boot-disk-size2   Nrv   rx   ry   s      r   AddBootDiskSizer   0  s,    ")bT	  r   c                 0    SnU R                  S/ SQSUS9  g)z/Adds a --pd-disk-type flag to the given parser.#  Type of the persistent directory.--pd-disk-typepd-standardzpd-balancedzpd-ssdr   choicesrw   r   Nr   r   s     r   AddPdDiskTyper   <  s(    ')6	  r   c                     U R                  5       nSnUR                  SSUS9  SnUR                  SUS9n[        U5        [	        U5        [        U5        g)	zZAdds a --no-persistent-storage or group of persistent directory flags to the given parser.zU  If set, workstations under this configuration will not have a persistent directory.z--no-persistent-storager   r   z%  Persistent directory configuration.Fmutexr   N)r#   r   	add_groupr   AddPdDiskSizeOrSnapshotAddPdReclaimPolicy)r   top_level_mutex_groupr   pd_groups       r   AddNoPersistentStorageOrPdr   H  si     ==?Y)$$ % ))",,5y,I((#Xr   c                     SnU R                  5       nUR                  S/ SQS[        US9  SnUR                  SSUS	9  g
)zGAdds a --pd-disk-size or --pd-source-snapshot flag to the given parser.)  Size of the persistent directory in GB.--pd-disk-size
   r   d      i  i  r   r   rw   r6   r   z>  Name of the snapshot to use as the source for the home disk.--pd-source-snapshot rw   r   N)r#   r   r8   r$   s      r   r   r   \  s]    -)

-
-
/%+  B)  r   c                  8    Sn [         R                  " S/ SQSU S9$ )Nr   r   r   r   r   r   Argumentr   s    r   AddPdDiskTypeArgr   r  s&    ')	6	
 r   c                 T    Sn[         R                  " S/ SQU (       a  SOS [        US9$ )Nr   r   r   r   r   )r   r   r8   )rz   r   s     r   AddPdDiskSizeArgr   }  s-    -)	+ cd
 r   c                  2    Sn [         R                  " SSU S9$ )NzI  Name of the snapshot to use as the source for the persistent directory.r   r   r   r   r   s    r   AddPdSourceSnapshotArgr     s$    M)	
 r   c                     U R                  5       n[        5       R                  U5        SnUR                  SUS9n[	        5       R                  U5        [        U5      R                  U5        g)zYAdds a --pd-disk-size, --pd-disk-type, and --pd-source-snapshot flag to the given parser.z^  --pd-source-snapshot cannot be specified when --pd-disk-size or --pd-disk-type is specified.Fr   N)r#   r   r   r   r   r   )r   rz   persistent_directory_groupr   type_size_groups        r   AddPersistentDirectoriesr     sm      &BBD&&'ABb).88	 9 /   1;++O<r   c                 2    SnU R                  SSSS.SUS9  g)	z4Adds a --pd-reclaim-policy flag to the given parser.zB  What should happen to the disk after the Workstation is deleted.z--pd-reclaim-policyz9The persistent disk will be deleted with the Workstation.zxThe persistent disk will be remain after the workstation is deleted and the administrator must manually delete the disk.)deleteretainr   r   Nr   r   s     r   r   r     s6    F)ON   r   c                     [         [         [         [         [        R                  " 5       S.nSnU R                  S[        R                  " US9SSUS9  g)	z6Adds a --ephemeral-directory flag to the given parser.)z
mount-pathz	disk-typezsource-snapshotzsource-imagez	read-onlya    Ephemeral directory which won't persist across workstation sessions. An ephemeral directory is backed by a Compute Engine persistent disk whose mount-path, source-snapshot, source-image, and read-only are configurable.

  *mount-path*::: Location of this directory in the running workstation.

  *source-snapshot:: Name of the snapshot to use as the source for the disk. Must be empty if [source_image][] is set. Must be empty if [read_only][] is false. Updating [source_snapshot][] will update content in the ephemeral directory after the workstation is restarted.

  *source-image::: Name of the disk image to use as the source for the disk. Must be empty if [source_snapshot][] is set. Updating [source_image][] will update content in the ephemeral directory after the workstation is restarted.

  *read-only::: Whether the disk is read only. If true, the disk may be shared by multiple VMs and [source_snapshot][] must be set. Set to false when not specified and true when specified.

  Example:

    $ {command} --ephemeral-directory="mount-path=/home2,disk-type=pd-balanced,source-snapshot=projects/my-project/global/snapshots/snapshot,read-only=true"
  z--ephemeral-directoryr2   rH   zPROPERTY=VALUE)r6   r   r5   r   N)r   r   
ArgBooleanr   ArgDict)r   r2   r   s      r   AddEphemeralDirectoryr     sY     ))+
$) 	D)  r   c                     SnSnU R                  5       nUR                  SSSSSSS	S
SSSSS.U(       a  SOSUS9  UR                  S[        US9  g)z]Adds the --container-predefined-image and --container-custom-image flags to the given parser.z  Code editor on base images.z  A docker image for the workstation. This image must be accessible by the
  service account configured in this configuration (--service-account). If no
  service account is defined, this image must be public.
  z--container-predefined-imagezCode OSSzIntelliJ IDEA UltimatezPyCharm ProfessionalRiderWebStormPhpStormRubyMineGoLandCLionzBase image - no IDEzCode OSS + CUDA toolkit)codeossintellijpycharmriderwebstormphpstormrubyminegolandclionz
base-imagezcodeoss-cudar   Nr   z--container-custom-imager   )r#   r   r   )r   rz   predefined_image_help_textcustom_image_help_textr%   s        r   AddContainerImageFieldr     s     !
 
-
-
/%$.+   -3 'iD%!  &  s1G  r   c                 R    SnU R                  SS[        R                  " 5       US9  g)z4Adds a --container-command flag to the given parser.z  If set, overrides the default ENTRYPOINT specified by the image.

  Example:

    $ {command} --container-command=executable,parameter_1,parameter_2z--container-commandCONTAINER_COMMANDr   Nr   r   s     r   AddContainerCommandFieldr     s4    J) 	! 	  r   c                 R    SnU R                  SS[        R                  " 5       US9  g)z1Adds a --container-args flag to the given parser.z_  Arguments passed to the entrypoint.

  Example:

    $ {command} --container-args=arg_1,arg_2z--container-argsCONTAINER_ARGSr   Nr   r   s     r   AddContainerArgsFieldr     s3    0) 	 	  r   c           	      b    SnU R                  SS[        R                  " [        [        S9US9  g)z0Adds a --container-env flag to the given parser.zu  Environment variables passed to the container.

  Example:

    $ {command} --container-env=key1=value1,key2=value2z--container-envCONTAINER_ENVkey_type
value_typer   Nr   r   r   r   r   s     r   AddContainerEnvFieldr     s7    ;) 	<	  r   c                 (    SnU R                  SUS9  g)z8Adds a --container-working-dir flag to the given parser.z;  If set, overrides the default DIR specified by the image.z--container-working-dirr   Nr   r   s     r   AddContainerWorkingDirFieldr   '  s    ?)/i@r   c                 2    SnU R                  S[        US9  g)z8Adds a --container-run-as-user flag to the given parser.zI  If set, overrides the USER specified in the image with the given
  uid.z--container-run-as-userr   Nrx   r   s     r   AddContainerRunAsUserFieldr  .  s!    
) 	/c	Jr   c                 2    SnU R                  S[        US9  g)z1Adds a workstation-port flag to the given parser.>  The port on the workstation to which traffic should be sent.workstation_portr   Nrx   r   s     r   AddWorkstationPortFieldr  6  s     B)(sCr   c                 4    SnU R                  S[        SUS9  g)z'Adds a --port flag to the given parser.r  z--port   r   Nrx   r   s     r   AddPortFieldr  =  s!    B)hS"9Er   c                 \    SnU R                  S[        R                  R                  SUS9  g)z2Adds a --local-host-port flag to the given parser.aK    `LOCAL_HOST:LOCAL_PORT` on which gcloud should bind and listen for connections
  that should be tunneled.

  `LOCAL_PORT` may be omitted, in which case it is treated as 0 and an arbitrary
  unused local port is chosen. The colon also may be omitted in that case.

  If `LOCAL_PORT` is 0, an arbitrary unused local port is chosen.z--local-host-portzlocalhost:0r   N)r   r   HostPortParser   s     r   AddLocalHostPortFieldr  D  s7    E) 	%%	  r   c                 2    SnU R                  S[        US9  g)z*Adds a --command flag to the given parser.zs      A command to run on the workstation.

      Runs the command on the target workstation and then exits.
      z	--commandr   Nr   r   s     r   AddCommandFieldr  V  s     
)
 	k)<r   c                     SnU R                  S[        SUS9  SnU R                  S[        R                  US9  SnU R                  S	S
US9  g)z>Additional flags and positional args to be passed to *ssh(1)*.z$  The username with which to SSH.
  z--useruserr   zD  Flags and positionals passed to the underlying ssh implementation.ssh_args)nargsr   z  Additional flags to be passed to *ssh(1)*. It is recommended that flags
  be passed using an assignment operator and quotes. Example:

    $ {command} --ssh-flag="-vvv" --ssh-flag="-L 80:localhost:80"
  z
--ssh-flagrH   r   N)r   r   argparse	REMAINDERr   s     r   AddSshArgsAndUserFieldr  `  sc    ) 	hS&yIH)j(:(:K) 	l8)Dr   c                     U R                  SS9nSnUR                  S[        USS9  SnUR                  S[        US	9  g
)zKAdds the --kms-key and --kms-key-service-account flags to the given parser.zEncryption key settingsr   z}  The customer-managed encryption key to use for this config. If not specified,
  a Google-managed encryption key is used.
  z	--kms-keyTr6   r   rj   zX  The service account associated with the provided customer-managed encryption
  key.
  z--kms-key-service-accountr   N)r   r   r   r   r%   r   s      r   AddEncryptionKeyFieldsr  t  sU    


 9

:%) [sTJ) 0sKr   c           	      b    SnU R                  SS[        R                  " [        [        S9US9  g)z)Adds a --labels flag to the given parser.z  Labels that are applied to the configuration and propagated to the underlying
  Compute Engine resources.

  Example:

    $ {command} --labels=label1=value1,label2=value2z--labelsLABELSr   r   Nr   r   s     r   AddLabelsFieldr    s7    8) 	<	  r   c                     U R                  SS9nSnUR                  S[        US9  SnUR                  S[        USS	9  g
)zNAdds the --accelerator-type and --accelerator-count flags to the given parser.zAccelerator settingsr   zd  The type of accelerator resource to attach to the instance, for example,
  "nvidia-tesla-p100".
  z--accelerator-typer   z=  The number of accelerator cards exposed to the instance.
  z--accelerator-countTr  N)r   r   r   r8   r  s      r   AddAcceleratorFieldsr    sZ    


 6

7%) ))D) #I  r   c                 (   SnU R                  SS[        R                  " [        [        [        [        [        [        [
        [        R                  " [        [        R                  " 5       [        S.S9S.S/S9[        R                  " 5       US	9  g
)z/Adds a --boost-config flag to the given parser.ar    Boost Configuration(s) that workstations running with this configuration can
  boost up to. This includes id (required), machine-type, accelerator-type,
  accelerator-count, pool-size, boot-disk-size, and enable-nested-virtualization.

  Example:

    $ {command} --boost-config=id=boost1,machine-type=n1-standard-4,accelerator-type=nvidia-tesla-t4,accelerator-count=1z--boost-configBOOST_CONFIGkeyvalueszconsume-reservation-typer   )idzmachine-typezaccelerator-typezaccelerator-countz	pool-sizezboot-disk-sizezenable-nested-virtualizationzreservation-affinityr$  r1   r4   N)	r   r   r7   r   r8   boolr   ValidateConsumeReservationTyper9   r   s     r   AddBoostConfigsr'    s    |) 	  !"%#& #.2&1&;&;  + 3 3 58	'$ '* &&(3  r   c                 4    SnU R                  SS[        US9  g)z(Adds a --boost flag to the given parser.zg  Id of a boost configuration to start a workstations with.

  Example:

    $ {command} --boost=boost1z--boostBOOSTr   Nr   r   s     r   AddBoostr*    s*    ") 		  r   c                 R    SnU R                  SS[        R                  " 5       US9  g)z0Adds a --replica-zones flag to the given parser.z  Specifies the zones the VM and disk resources will be
  replicated within the region. If set, exactly two zones within the
  workstation cluster's region must be specified.

  Example:

    $ {command} --replica-zones=us-central1-a,us-central1-f
  z--replica-zonesREPLICA_ZONESr   Nr   r   s     r   AddReplicaZonesr-    s3    ) 	 	  r   c                 p    U R                  5       nSnUR                  SSUS9  SnUR                  SSUS9  g)4Adds a --disable-ssh-to-vm flag to the given parser.z>  If set, workstations disable SSH connections to the root VM.--disable-ssh-to-vmr   r   z=  If set, workstations enable SSH connections to the root VM.--enable-ssh-to-vmNr"   r  s      r   AddDisableSSHToVMr2    sX    

-
-
/%B)  
A)  r   c                 >    SnU R                  SU(       a  SOSSUS9  g)z3Adds a --enable-ssh-to-vm flag to the given parser.zW  Default value is False.
  If set, workstations enable SSH connections to the root VM.r1  FNr   )rw   r   r   r   ry   s      r   AddEnableSSHToVMr4    s/    A) 	"e	  r   c           
      h    SnU R                  S[        R                  " SSSSS9U(       a  SOSUS9  g)	r/  zX  Default value is False.
  If set, workstations disable SSH connections to the root VM.r0  zEThe {flag_name} option is deprecated; use --enable-ssh-to-vm instead.Fr   )warnremovedr   r   N)r   r   DeprecationActionry   s      r   AddDeprecatedDisableSSHToVMr9    sL    B) 	&&
  #e  r   c           	      b    SnU R                  SS[        R                  " [        [        S9US9  g)z*Adds a --vm-tags flag to the given parser.a    Resource manager tags to be bound to the instance.
  Tag keys and values have the same definition as
  https://cloud.google.com/resource-manager/docs/tags/tags-overview

  Example:

    $ {command} --vm-tags=tagKeys/key1=tagValues/value1,tagKeys/key2=tagValues/value2z	--vm-tagsVM_TAGSr   r   Nr   r   s     r   	AddVmTagsr<  '  s8    Y) 	<	  r   c                 6    SnU R                  SS[        SUS9  g)z@Adds a --max-usable-workstations-count flag to the given parser.z  Maximum number of workstations under this configuration a user can have
  `workstations.workstation.use` permission on.

  If not specified, defaults to `0`, which indicates a user can have unlimited
  number of workstations under this configuration.z--max-usable-workstations-countMAX_USABLE_WORKSTATIONS_COUNTr   )r5   r6   rw   r   Nrx   r   s     r   AddMaxUsableWorkstationsCountr?  9  s-    6) 	'-  r   c           
          SnU R                  SS[        R                  " [        [        R                  " 5       [
        S.S9US9  g)z7Adds a --reservation-affinity flag to the given parser.z  Reservation Affinity for the VM. This includes key, values, and
  consumeReservationType.

  Example:
    $ {command} --reservation-affinity=key=compute.googleapis.com/reservation-name,consumeReservationType=SPECIFIC_RESERVATION,values=my-reservation
  z--reservation-affinityRESERVATION_AFFINITYr!  r   r   N)r   r   r7   r   r   r&  r   s     r   AddReservationAffinityrB  K  sN    ) 	$  #++-*H   r   c                 2    SnU R                  S[        US9  g)z7Adds the --startup-script-uri flag to the given parser.z  Link to the startup script stored in Cloud Storage. The script is executed
  on the workstation VM after it is booted.

  Example:

    $ {command} --startup-script-uri=gs://{bucket-name}/{object-name}
  z--startup-script-urir   Nr   r   s     r   AddStartupScriptUrirD  c  s%    ) 	3Y  r   c                 P    / SQnX;  a  [         R                  " SU  SU 35      eU $ )z-Validates the consume-reservation-type value.)ANY_RESERVATIONNO_RESERVATIONSPECIFIC_RESERVATIONzInvalid choice: 'z'. Valid choices are )r  ArgumentTypeError)valueallowed_valuess     r   r&  r&  r  s=    .
  

$
$
E7"77GH  
,r   )FF)v1betaFF)rL  )T)F)R__doc__
__future__r   r   r   r  googlecloudsdk.callioper   r   r    googlecloudsdk.calliope.conceptsr	   r
   (googlecloudsdk.command_lib.util.conceptsr   googlecloudsdk.corer   r   r   r&   r*   r,   r:   rP   rW   r]   r`   rp   rs   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-  r2  r4  r9  r<  r?  rB  rD  r&  r?   r   r   <module>rS     s   5 &  '  + / ( 5 1 D *&
$8 48 49> 38@>	 IN8(
; $	

*




		(,	=$BD   AKDF$=E(L""$$N &&
*$$0r   