
                         P   d Z ddlmZ ddlmZ ddlmZ ddlZddlmZ ddl	m
Z
 dZd	Zd
ZededediZededediZ ej                   eee   feee   feee   fg      Z ej                   eee   fedfedfg      Z ej                   edfeee   feee   fg      Zd Zd Zd Zy)zCProvides getters and validators for the platform flag and property.    )absolute_import)division)unicode_literalsN)
exceptions)
propertiesmanagedgke
kuberneteszCloud Run (fully managed)z-Cloud Run for Anthos deployed on Google Cloudz'Cloud Run for Anthos deployed on VMwarezFully managed version of Cloud Run. Use with the `--region` flag or set the [run/region] property to specify a Cloud Run region.zCloud Run for Anthos on Google Cloud. Use with the `--cluster` and `--cluster-location` flags or set the [run/cluster] and [run/cluster_location] properties to specify a cluster in a given zone.zUse a Knative-compatible kubernetes cluster. Use with the `--kubeconfig` and `--context` flags to specify a kubeconfig file and the context for connecting.zDCloud Run for Anthos on Google Cloud. Not supported by this command.zLUse a Knative-compatible kubernetes cluster.  Not supported by this command.zBFully managed version of Cloud Run. Not supported by this command.c                  f    t         j                  j                  j                  j	                         S )zReturns the platform to run on.

  If set by the user, returns whatever value they specified without any
  validation. If not set by the user, default to managed

  )r   VALUESrunplatformGet     /lib/googlecloudsdk/command_lib/run/platforms.pyGetPlatformr   Q   s%     
					'	'	+	+	--r   c                     t               t        k7  r3t        j                  ddj	                  t               t                    |S )a<  Validate the specified platform is managed.

  This method is referenced by the declarative iam commands which only work
  against the managed platform.

  Args:
    unused_ref: ref to the service.
    unused_args: Namespace, The args namespace.
    req: The request to be made.

  Returns:
    Unmodified request
  z
--platformzThe platform [{platform}] is not supported by this operation. Specify `--platform {managed}` or run `gcloud config set run/platform {managed}`.)r   r   )r   PLATFORM_MANAGEDcalliope_exceptionsBadArgumentExceptionformat)
unused_refunused_argsreqs      r   ValidatePlatformIsManagedr   [   sH     ]&&

2
2 66<f ],< 7= 7>? ?
 
*r   c                  $    t               t        k(  S )N)r   r   r   r   r   	IsManagedr   r   s    	*	**r   )__doc__
__future__r   r   r   collectionsgooglecloudsdk.callioper   r   googlecloudsdk.corer   r   PLATFORM_GKEPLATFORM_KUBERNETESPLATFORM_SHORT_DESCRIPTIONS_PLATFORM_LONG_DESCRIPTIONSOrderedDict	PLATFORMSPLATFORMS_MANAGED_ONLYPLATFORMS_ANTHOS_ONLYr   r   r   r   r   r   <module>r,      sG   J &  '  E * "  1AB  
* 
$ 
;   $K##23CDE.|<=56IJK% 	 10023CDEKMS	2   0//IK.|<=56IJK	1  ..+r   