ó
    €Ï/  ã                   ó¦   • 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S	KJr  SS
KrS rS r " S S\	R"                  5      rg
)z4Command to create service account identity bindings.é    )Úabsolute_import)Údivision)Úunicode_literals)Úutil)Úarg_parsers)Úbase)Úiam_util)ÚlogNc           	      ó   • U (       d  g [         R                  " U 5       VVs/ s H(  u  p#UR                  R                  R	                  X#S9PM*     nnnUR                  UR                  R                  US9S9$ s  snnf )N)ÚkeyÚvalue)ÚadditionalProperties)Ú
attributes)ÚsixÚ	iteritemsÚAttributeTranslatorCELÚAttributesValueÚAdditionalProperty)Úcel_mapÚmessagesr   r   Úattribute_translator_celss        Ú<lib/surface/iam/service_accounts/identity_bindings/create.pyÚ_EncodeAttributeTranslatorCELr      s‘   € Þ	Øô 36·-²-ÀÔ2Hôâ2H¡J Cð ×%Ñ%×5Ñ5×HÑHØð Ió  Ù2Hð ñ ð 
×	(Ñ	(Ø×0Ñ0×@Ñ@Ø8ð Að :ð 
)ð 
;ð ;ùó	s   ¢/A:c           
      ó  • UR                  U R                  [        U R                  U5      UR	                  U R
                  U R                  U R                  S9S9nUR                  U[        R                  " U R                  5      S9$ )zC_CreateRequest creates CreateServiceAccountIdentityBindingRequests.)ÚaudienceÚmaxTokenLifetimeSecondsÚurl)ÚacceptanceFilterÚcelÚoidc)Ú*createServiceAccountIdentityBindingRequestÚname)Ú*CreateServiceAccountIdentityBindingRequestÚacceptance_filterr   Úattribute_translator_celÚIDPReferenceOIDCÚoidc_audienceÚoidc_max_token_lifetimeÚoidc_issuer_urlÚ7IamProjectsServiceAccountsIdentityBindingsCreateRequestr	   ÚEmailToAccountResourceNameÚservice_account)Úargsr   Úreqs      r   Ú_CreateRequestr/   *   s•   € à×;Ñ;Ø×-Ñ-Ü
'¨×(EÑ(EØ(0ó2à×$Ñ$Ø×%Ñ%Ø"&×">Ñ">Ø×"Ñ"ð %ð ð	 	<ð 		€#ð 
×	IÑ	IØ14Ü×.Ò.¨t×/CÑ/CÓDð 
Jð 
Fð Fó    c                   ó.   • \ rS rSrSr\S 5       rS rSrg)ÚCreateé<   z*Create a service account identity binding.c           	      ó†  • U R                  SS[        R                  " 5       SS9  U R                  SS SS9  U R                  S[        R                  " S	S
90 S[        R
                  SS9  U R                  SS9nUR                  SSSS9  UR                  SS SS9  UR                  SS [        R                  " S	5      SS9  g )Nz--service-accountTz<The service account for which to create an identity binding.)ÚrequiredÚtypeÚhelpz--acceptance-filteraö          A CEL expression that is evaluated to determine whether a credential
        should be accepted. To accept any credential, specify
        `--acceptance-filter=true`.

        This field supports a subset of the CEL functionality to select fields
        and evaluate boolean expressions based on the input (no functions or
        arithmetics). See
        link:https://github.com/google/cel-spec[the CEL specification] for more
        details.

        The values for input claims are available using
        ``inclaim.attribute_name'' or ``inclaim["attribute_name"]''.
        The values for output attributes calculated by the translator are
        available using ``outclaim.attribute_name'' or
        ``outclaim["attribute_name"]''.
        )Údefaultr7   z--attribute-translator-celé   )Ú
min_lengthzOUT_ATTR=IN_ATTRa|          Specifies a list of output attribute names and the corresponding input
        attribute to use for that output attribute. Each defined output
        attribute is populated with the value of the specified input attribute.
        Each entry specifies the desired output attribute and a CEL field
        selector expression for the corresponding input to read.
        This field supports a subset of the CEL functionality to select fields
        from the input (no boolean expressions, functions or arithmetics).

        Output attributes must match `(google.sub|[a-z_][a-z0-9_]*)`.

        The output attribute google.sub is interpreted to be the "identity" of
        the requesting user.

        For example, to copy the inbound attribute "sub" into the output
        "google.sub" add the translation google.sub -> inclaim.sub (or
        google.sub -> inclaim["sub"]). For example:

        ``--attribute-translator-cel="google.sub=inclaim.sub"''

        See link:https://github.com/google/cel-spec[the CEL specification] for
        more details.

        If the input does not exist the output attribute will be null.
        )r6   r8   ÚmetavarÚactionr7   zOIDC Identity Provider)r7   z--oidc-issuer-urlzThe OpenID Provider Issuer URL.)r5   r7   z--oidc-audiencezJThe acceptable audience. Default is the numeric ID of the service account.z--oidc-max-token-lifetimezJThe maximum lifetime for tokens, in seconds. The default is 3600 (1 hour).)r8   r6   r7   )Úadd_argumentr	   ÚGetIamAccountFormatValidatorr   ÚArgDictÚStoreOnceActionÚ	add_groupÚ
BoundedInt)ÚparserÚ
oidc_groups     r   ÚArgsÚCreate.Args?   s  € à
×ÑØØÜ×2Ò2Ó4ØKð	 ñ Mð
 ×ÑØØðð ñ ð( ×ÑØ$Ü× Ò ¨AÑ.ØØ"Ü×*Ñ*ðð ñ ð> ×!Ñ!Ð'?Ð!Ð@€JØ×ÑØØØ.ð ñ 0ð ×ÑØØð<ð ñ =ð
 ×ÑØ#ØÜ×#Ò# AÓ&ð(ð	 ò )r0   c                 ó¾   • [         R                  " 5       u  p#[        X5      nUR                  R	                  U5      n[
        R                  " UR                  SS9  U$ )Nz service account identity binding)Úkind)r   ÚGetClientAndMessagesr/   Ú)projects_serviceAccounts_identityBindingsr2   r
   ÚCreatedResourcer"   )Úselfr-   Úclientr   r.   Úresults         r   ÚRunÚ
Create.RunŠ   sM   € Ü×0Ò0Ó2Ñ€FÜ
˜Ó
(€CØ×=Ñ=×DÑDÀSÓI€Fä×Ò˜Ÿ™Ð*LÒMØ€Mr0   © N)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__ÚstaticmethodrE   rO   Ú__static_attributes__rQ   r0   r   r2   r2   <   s   † Ù2àñH)ó ðH)õTr0   r2   )rV   Ú
__future__r   r   r   Úgooglecloudsdk.api_lib.iamr   Úgooglecloudsdk.callioper   r   Úgooglecloudsdk.command_lib.iamr	   Úgooglecloudsdk.corer
   r   r   r/   ÚCreateCommandr2   rQ   r0   r   Ú<module>r_      sD   ðñ ;å &Ý Ý 'å +Ý /Ý (Ý 3Ý #ã 
ò	;òFô$TˆT×Ñõ Tr0   