
                             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	  SSK
Jr  S	 rS
 rS rS rSS jrSrS rS rg)zCommon flags for iam commands.    )absolute_import)division)unicode_literals)arg_parsers)base)cred_config)common_argsc                 L    [         R                  " SSSR                  U 5      S9$ )NroleROLE_IDzID of the role to {0}. Curated roles example: roles/viewer. Custom roles example: CustomRole. For custom roles, you must also specify the `--organization` or `--project` flag.metavarhelpr   Argumentformatverbs    +lib/googlecloudsdk/command_lib/iam/flags.pyGetRoleFlagr      s)    	 $VD\
+ +    c                 L    [         R                  " SSSR                  U 5      S9$ )Nr   r   z]ID of the custom role to {0}. You must also specify the `--organization` or `--project` flag.r   r   r   s    r   GetCustomRoleFlagr   '   s'    	fTl
 r   c                 J    [         R                  " SSR                  U 5      S9$ )Nz--organizationz)Organization of the role you want to {0}.r   r   r   s    r   
GetOrgFlagr   0   s&    	6==dC
E Er   c                 L    SR                  U 5      n[        R                  " US9$ )Nz$Project of the role you want to {0}.)help_text_to_prepend)r   r	   ProjectArgument)r   	help_texts     r   GetProjectFlagr!   6   s#    4;;DA)		$	$)	DDr   c                     U R                  US9n[        U5      R                  U5        [        U5      R                  U5        g )N)required)add_mutually_exclusive_groupr   AddToParserr!   )parserr   r#   parent_groups       r   AddParentFlagsr(   ;   s;    44h4G,T|,""<0r   a  The full resource name or URI to {verb}.

See ["Resource Names"](https://cloud.google.com/apis/design/resource_names) for
details. To get a URI from most `list` commands in `gcloud`, pass the `--uri`
flag. For example:

```
$ gcloud compute instances list --project prj --uri \
https://compute.googleapis.com/compute/v1/projects/prj/zones/us-east1-c/instances/i1 \
https://compute.googleapis.com/compute/v1/projects/prj/zones/us-east1-d/instances/i2
```

c                 N    [         R                  " S[        R                  U S9S9$ )Nresourcer   r   )r   r   _RESOURCE_NAME_HELPr   r   s    r   GetResourceNameFlagr,   Q   s"    	z(;(B(B(B(M	NNr   c           
      r   U R                  SSSS9  U R                  SSSS9  U R                  SS	9nUR                  S
SSS9  UR                  S[        R                  " SSSSS9SS9  U R                  S[        R                  " 5       SSS9  U R                  SSS	9  U R                  SSS	9  U R                  SS	9nUR                  S[        R                  " SSSSS9S S9  UR                  S!S"S	9  U[
        R                  R                  :X  a'  UR                  S#[        R                  " SS$S%SS9S&S9  g'g')(z_Adds parser arguments that are common to both workload identity federation and workforce pools.z--output-filez>Location to store the generated credential configuration file.T)r   r#   z--universe-domainzUniverse domain.)r   hiddenz&Service account impersonation options.r   z--service-accountz,Email of the service account to impersonate.z(--service-account-token-lifetime-secondss60043200)default_unitlower_boundupper_boundparsed_unitaH  Lifetime duration of the service account access token in seconds. Defaults to one hour if not specified. If a lifetime greater than one hour is required, the service account must be added as an allowed value in an Organization Policy that enforces the `constraints/iam.allowServiceAccountCredentialLifetimeExtension` constraint.)typer   z--credential-source-headersz	key=valuez7Headers to use when querying the credential-source-url.)r6   r   r   z--credential-source-typez/Format of the credential source (JSON or text).z--credential-source-field-namez;Subject token field name (key) in a JSON credential source.z3Arguments for an executable type credential source.z--executable-timeout-millisms5s120szHTimeout duration, in milliseconds, to wait for the executable to finish.z--executable-output-filez:Absolute path to the file storing the executable response.z'--executable-interactive-timeout-millis30s1800szxTimeout duration, in milliseconds, to wait for the executable to finish when the command is running in interactive mode.N)add_argument	add_groupr   DurationArgDictr   
ConfigTypeWORKFORCE_POOLS)r&   config_type%service_account_impersonation_optionsexecutable_argss       r   AddCommonByoidCreateConfigFlagsrE   U   s   K  
 	 24   +1*:*:3 +; +5''449 5  (550	
 6  	# D	  F
 	 <  > 	&H  J $$@ % B/#	
1  	  G  I K**:::  1!!	
P ! Q ;r   N)T)__doc__
__future__r   r   r   googlecloudsdk.callioper   r   .googlecloudsdk.command_lib.iam.byoid_utilitiesr   $googlecloudsdk.command_lib.util.argsr	   r   r   r   r!   r(   r+   r,   rE    r   r   <module>rL      sO     % &  ' / ( F <+EE
1  OEQr   