
    .-                     v    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 rS r	S	 r
S
 rS rSS jrSS jrg)z*Common flags for workforce pools commands.    )absolute_import)division)unicode_literals)arg_parsers)basec                 V    U R                  SSR                  US:X  a  SOSU5      SS9  g )Nz--organizationz8The parent organization of the workforce pool{0} to {1}.lists Thelprequiredadd_argumentformatparserverbs     ;lib/googlecloudsdk/command_lib/iam/workforce_pools/flags.pyAddParentFlagsr      s8    ELL#R       c                 V    U R                  SSR                  US:X  a  SOSU5      SS9  g )Nz
--locationz-The location of the workforce pool{0} to {1}.r	   r
   r   Tr   r   r   s     r   AddLocationFlagr   "   s8    :AA#R   r   c                 f    U R                  S5      (       d  gSR                  U R                  5      $ )Nlocationzlocations/globalzlocations/{})IsSpecifiedr   r   )argss    r   ParseLocationr   ,   s+    			*	%	%			t}}	--r   c                  \   [         R                  " SSSSSS9n [         R                  " SSSSS	S9n[         R                  " S
S9nUR                  U 5        UR                  [	        SS95        [         R                  " S
S9nUR                  U5        UR                  [        SS95        X#/$ )zCreates an ArgumentGroup for ExtraAttributesOAuth2Client and ExtendedAttributesOAuth2Client Attributes for the update-oidc command.z--clear-extra-attributes-configclear_extra_attributes_config
store_trueFz)Clear the extra attributes configuration.)destactionr   r   z"--clear-extended-attributes-config clear_extended_attributes_configz,Clear the extended attributes configuration.T)mutex)r   )r   ArgumentArgumentGroupAddArgument*ExtraAttributesOAuth2ClientAttributesGroup-ExtendedAttributesOAuth2ClientAttributesGroup)!clear_extra_attributes_config_arg$clear_extended_attributes_config_arg clearable_extra_attributes_group#clearable_extended_attributes_groups       r   2AddClearableExtraAndExtendedAttributesOAuth2Clientr/   2   s    &*mm'*6'# *.*-9*& &*%7%7d%C""..' #..0%@ )-(:(:)% &11* &113UC +	PPr   c                  *    [        5       [        5       /$ )zCreates an ArgumentGroup for ExtraAttributesOAuth2Client and ExtendedAttributesOAuth2Client Attributes for the create-oidc command.)r)   r*    r   r   )AddExtraAndExtendedAttributesOAuth2Clientr2   W   s     1235
 r   c                 $   [         R                  " SS[        U SSS9n[         R                  " SS[        U SS	S9n[         R                  " S
S[        U SSS9n[         R                  " SS[        R                  " / SQS/SSS9U SSS9n[         R                  " SS[        SSSS9n[         R
                  " 5       nUR                  U5        UR                  U5        UR                  U5        UR                  U5        UR                  U5        U$ )zDCreates an ArgumentGroup for ExtraAttributesOAuth2Client Attributes.z--extra-attributes-client-idextra_attributes_client_idEXTRA_ATTRIBUTES_CLIENT_IDzThe OAuth 2.0 client ID for retrieving extra attributes from the identity provider. Required to get the access token using client credentials grant flow.r"   typer   metavarr   z&--extra-attributes-client-secret-value$extra_attributes_client_secret_value$EXTRA_ATTRIBUTES_CLIENT_SECRET_VALUEzThe OAuth 2.0 client secret for retrieving extra attributes from the identity provider. Required to get the access token using client credentials grant flow.z--extra-attributes-issuer-uriextra_attributes_issuer_uriEXTRA_ATTRIBUTES_ISSUER_URIOIDC identity provider's issuer URI. Must be a valid URI using the `https` scheme. Required to get the OIDC discovery document.z--extra-attributes-typeextra_attributes_type)zazure-ad-groups-mailazure-ad-groups-idazure-ad-groups-display-namer@      )choiceshidden_choices
max_length
min_lengthEXTRA_ATTRIBUTES_TYPEKRepresents the identity provider and type of claims that should be fetched.z--extra-attributes-filterextra_attributes_filterFEXTRA_ATTRIBUTES_FILTERa  The filter used to request specific records from the IdP. By default, all of the groups that are associated with a user are fetched. For Microsoft Entra ID, you can add `$search` query parameters using [Keyword Query Language] (https://learn.microsoft.com/en-us/sharepoint/dev/general-development/keyword-query-language-kql-syntax-reference). To learn more about `$search` querying in Microsoft Entra ID, see [Use the `$search` query parameter] (https://learn.microsoft.com/en-us/graph/search-query-parameter). 

Additionally, Workforce Identity Federation automatically adds the following [`$filter` query parameters] (https://learn.microsoft.com/en-us/graph/filter-query-parameter), based on the value of `attributes_type`. Values passed to `filter` are converted to `$search` query parameters. Additional `$filter` query parameters cannot be added using this field. 

* `AZURE_AD_GROUPS_MAIL`: `mailEnabled` and `securityEnabled` filters are applied. 
* `AZURE_AD_GROUPS_ID`: `securityEnabled` filter is applied.r   r&   strr   ArgListr'   r(   )r   extra_attributes_client_id_arg(extra_attributes_client_secret_value_argextra_attributes_issuer_uri_argextra_attributes_type_argextra_attributes_filter_argcreate_extra_attributes_groups          r   r)   r)   _   s?   #'==$'*%$  .2]].14,.* %)MM%(+%! #mm"
 99	 %!( !%!$'!6 #'"4"4"6++,JK++.  ++,KL++,EF++,GH	&&r   c           
         [         R                  " SS[        U SSS9n[         R                  " SS[        U SS	S9n[         R                  " S
S[        U SSS9n[         R                  " SS[        R                  " S/SSS9U SSS9n[         R                  " SS[        SSSS9n[         R
                  " 5       nUR                  U5        UR                  U5        UR                  U5        UR                  U5        UR                  U5        U$ )zGCreates an ArgumentGroup for ExtendedAttributesOAuth2Client Attributes.z--extended-attributes-client-idextended_attributes_client_idEXTENDED_ATTRIBUTES_CLIENT_IDzThe OAuth 2.0 client ID for retrieving extended attributes from the identity provider. Required to get extended group memberships for a subset of Google Cloud products.r6   z)--extended-attributes-client-secret-value'extended_attributes_client_secret_value'EXTENDED_ATTRIBUTES_CLIENT_SECRET_VALUEzThe OAuth 2.0 client secret for retrieving extended attributes from the identity provider. Required to get extended group memberships for a subset of Google Cloud products.z --extended-attributes-issuer-uriextended_attributes_issuer_uriEXTENDED_ATTRIBUTES_ISSUER_URIr=   z--extended-attributes-typeextended_attributes_typer?   rA   )rB   rD   rE   EXTENDED_ATTRIBUTES_TYPErG   z--extended-attributes-filterextended_attributes_filterFEXTENDED_ATTRIBUTES_FILTERa  The filter used to request specific records from the IdP. By default, all of the groups that are associated with a user are fetched. For Microsoft Entra ID, you can add `$search` query parameters using [Keyword Query Language] (https://learn.microsoft.com/en-us/sharepoint/dev/general-development/keyword-query-language-kql-syntax-reference). To learn more about `$search` querying in Microsoft Entra ID, see [Use the `$search` query parameter] (https://learn.microsoft.com/en-us/graph/search-query-parameter). 

Additionally, Workforce Identity Federation automatically adds the following [`$filter` query parameters] (https://learn.microsoft.com/en-us/graph/filter-query-parameter), based on the value of `attributes_type`. Values passed to `filter` are converted to `$search` query parameters. Additional `$filter` query parameters cannot be added using this field. 

* `AZURE_AD_GROUPS_ID`: `securityEnabled` filter is applied.rJ   )r   !extended_attributes_client_id_arg+extended_attributes_client_secret_value_arg"extended_attributes_issuer_uri_argextended_attributes_type_argextended_attributes_filter_arg create_extended_attributes_groups          r   r*   r*      sE   &*mm'*-0'# 1514741- (,}}(+.($ "&"%"  ("" $(==$'*H$ 0 &*%7%7%9""..' #..1 #..( #../KL"../MN	))r   N)T)__doc__
__future__r   r   r   googlecloudsdk.callioper   r   r   r   r   r/   r2   r)   r*   r1   r   r   <module>rg      sA    1 &  ' / (."QJa'H_*r   