# This file was auto-generated by Fern from our API Definition.

from __future__ import annotations

import typing

from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.pagination import AsyncPager, SyncPager
from ..core.request_options import RequestOptions
from ..types.client import Client
from ..types.client_addons import ClientAddons
from ..types.client_app_type_enum import ClientAppTypeEnum
from ..types.client_async_approval_notifications_channels_api_patch_configuration import (
    ClientAsyncApprovalNotificationsChannelsApiPatchConfiguration,
)
from ..types.client_async_approval_notifications_channels_api_post_configuration import (
    ClientAsyncApprovalNotificationsChannelsApiPostConfiguration,
)
from ..types.client_authentication_method import ClientAuthenticationMethod
from ..types.client_compliance_level_enum import ClientComplianceLevelEnum
from ..types.client_create_authentication_method import ClientCreateAuthenticationMethod
from ..types.client_default_organization import ClientDefaultOrganization
from ..types.client_encryption_key import ClientEncryptionKey
from ..types.client_jwt_configuration import ClientJwtConfiguration
from ..types.client_metadata import ClientMetadata
from ..types.client_mobile import ClientMobile
from ..types.client_my_organization_patch_configuration import ClientMyOrganizationPatchConfiguration
from ..types.client_my_organization_post_configuration import ClientMyOrganizationPostConfiguration
from ..types.client_oidc_backchannel_logout_settings import ClientOidcBackchannelLogoutSettings
from ..types.client_organization_discovery_enum import ClientOrganizationDiscoveryEnum
from ..types.client_organization_require_behavior_enum import ClientOrganizationRequireBehaviorEnum
from ..types.client_organization_require_behavior_patch_enum import ClientOrganizationRequireBehaviorPatchEnum
from ..types.client_organization_usage_enum import ClientOrganizationUsageEnum
from ..types.client_organization_usage_patch_enum import ClientOrganizationUsagePatchEnum
from ..types.client_redirection_policy_enum import ClientRedirectionPolicyEnum
from ..types.client_refresh_token_configuration import ClientRefreshTokenConfiguration
from ..types.client_session_transfer_configuration import ClientSessionTransferConfiguration
from ..types.client_signed_request_object_with_credential_id import ClientSignedRequestObjectWithCredentialId
from ..types.client_signed_request_object_with_public_key import ClientSignedRequestObjectWithPublicKey
from ..types.client_third_party_security_mode_enum import ClientThirdPartySecurityModeEnum
from ..types.client_token_endpoint_auth_method_enum import ClientTokenEndpointAuthMethodEnum
from ..types.client_token_endpoint_auth_method_or_null_enum import ClientTokenEndpointAuthMethodOrNullEnum
from ..types.client_token_exchange_configuration import ClientTokenExchangeConfiguration
from ..types.client_token_exchange_configuration_or_null import ClientTokenExchangeConfigurationOrNull
from ..types.client_token_vault_privileged_access_with_credential_id import (
    ClientTokenVaultPrivilegedAccessWithCredentialId,
)
from ..types.client_token_vault_privileged_access_with_public_key import ClientTokenVaultPrivilegedAccessWithPublicKey
from ..types.create_client_response_content import CreateClientResponseContent
from ..types.create_identity_assertion_authorization_grant import CreateIdentityAssertionAuthorizationGrant
from ..types.create_token_quota import CreateTokenQuota
from ..types.express_configuration import ExpressConfiguration
from ..types.express_configuration_or_null import ExpressConfigurationOrNull
from ..types.fed_cm_login import FedCmLogin
from ..types.fed_cm_login_patch import FedCmLoginPatch
from ..types.get_client_response_content import GetClientResponseContent
from ..types.list_clients_offset_paginated_response_content import ListClientsOffsetPaginatedResponseContent
from ..types.native_social_login import NativeSocialLogin
from ..types.native_social_login_patch import NativeSocialLoginPatch
from ..types.preview_cimd_metadata_response_content import PreviewCimdMetadataResponseContent
from ..types.register_cimd_client_response_content import RegisterCimdClientResponseContent
from ..types.rotate_client_secret_response_content import RotateClientSecretResponseContent
from ..types.update_client_response_content import UpdateClientResponseContent
from ..types.update_identity_assertion_authorization_grant import UpdateIdentityAssertionAuthorizationGrant
from ..types.update_token_quota import UpdateTokenQuota
from .raw_client import AsyncRawClientsClient, RawClientsClient

if typing.TYPE_CHECKING:
    from .connections.client import AsyncConnectionsClient, ConnectionsClient
    from .credentials.client import AsyncCredentialsClient, CredentialsClient
# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)


class ClientsClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawClientsClient(client_wrapper=client_wrapper)
        self._client_wrapper = client_wrapper
        self._credentials: typing.Optional[CredentialsClient] = None
        self._connections: typing.Optional[ConnectionsClient] = None

    @property
    def with_raw_response(self) -> RawClientsClient:
        """
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawClientsClient
        """
        return self._raw_client

    def list(
        self,
        *,
        fields: typing.Optional[str] = None,
        include_fields: typing.Optional[bool] = None,
        page: typing.Optional[int] = 0,
        per_page: typing.Optional[int] = 50,
        include_totals: typing.Optional[bool] = True,
        is_global: typing.Optional[bool] = None,
        is_first_party: typing.Optional[bool] = None,
        app_type: typing.Optional[str] = None,
        external_client_id: typing.Optional[str] = None,
        q: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> SyncPager[Client, ListClientsOffsetPaginatedResponseContent]:
        """
        Retrieve clients (applications and SSO integrations) matching provided filters. A list of fields to include or exclude may also be specified.
        For more information, read [Applications in Auth0](https://www.auth0.com/docs/get-started/applications) and [Single Sign-On](https://www.auth0.com/docs/authenticate/single-sign-on).

        - The following can be retrieved with any scope:
            `client_id`, `app_type`, `name`, and `description`.
        - The following properties can only be retrieved with the `read:clients` or
            `read:client_keys` scope:
            `callbacks`, `oidc_logout`, `allowed_origins`,
            `web_origins`, `tenant`, `global`, `config_route`,
            `callback_url_template`, `jwt_configuration`,
            `jwt_configuration.lifetime_in_seconds`, `jwt_configuration.secret_encoded`,
            `jwt_configuration.scopes`, `jwt_configuration.alg`, `api_type`,
            `logo_uri`, `allowed_clients`, `owners`, `custom_login_page`,
            `custom_login_page_off`, `sso`, `addons`, `form_template`,
            `custom_login_page_codeview`, `resource_servers`, `client_metadata`,
            `mobile`, `mobile.android`, `mobile.ios`, `allowed_logout_urls`,
            `token_endpoint_auth_method`, `is_first_party`, `oidc_conformant`,
            `is_token_endpoint_ip_header_trusted`, `initiate_login_uri`, `grant_types`,
            `refresh_token`, `refresh_token.rotation_type`, `refresh_token.expiration_type`,
            `refresh_token.leeway`, `refresh_token.token_lifetime`, `refresh_token.policies`, `organization_usage`,
            `organization_require_behavior`.
        - The following properties can only be retrieved with the
            `read:client_keys` or `read:client_credentials` scope:
            `encryption_key`, `encryption_key.pub`, `encryption_key.cert`,
            `client_secret`, `client_authentication_methods` and `signing_key`.

        Parameters
        ----------
        fields : typing.Optional[str]
            Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

        include_fields : typing.Optional[bool]
            Whether specified fields are to be included (true) or excluded (false).

        page : typing.Optional[int]
            Page index of the results to return. First page is 0.

        per_page : typing.Optional[int]
            Number of results per page. Default value is 50, maximum value is 100

        include_totals : typing.Optional[bool]
            Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

        is_global : typing.Optional[bool]
            Optional filter on the global client parameter.

        is_first_party : typing.Optional[bool]
            Optional filter on whether or not a client is a first-party client.

        app_type : typing.Optional[str]
            Optional filter by a comma-separated list of application types.

        external_client_id : typing.Optional[str]
            Optional filter by the <a href="https://drafts.oauth.net/draft-ietf-oauth-client-id-metadata-document/draft-ietf-oauth-client-id-metadata-document.html">Client ID Metadata Document</a> URI for CIMD-registered clients.

        q : typing.Optional[str]
            Advanced Query in <a href="https://lucene.apache.org/core/2_9_4/queryparsersyntax.html">Lucene</a> syntax.<br /><b>Permitted Queries</b>:<br /><ul><li><i>client_grant.organization_id:{organization_id}</i></li><li><i>client_grant.allow_any_organization:true</i></li></ul><b>Additional Restrictions</b>:<br /><ul><li>Cannot be used in combination with other filters</li><li>Requires use of the <i>from</i> and <i>take</i> paging parameters (checkpoint paginatinon)</li><li>Reduced rate limits apply. See <a href="https://auth0.com/docs/troubleshoot/customer-support/operational-policies/rate-limit-policy/rate-limit-configurations/enterprise-public">Rate Limit Configurations</a></li></ul><i><b>Note</b>: Recent updates may not be immediately reflected in query results</i>

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        SyncPager[Client, ListClientsOffsetPaginatedResponseContent]
            Clients successfully retrieved.

        Examples
        --------
        from auth0 import Auth0

        client = Auth0(
            token="YOUR_TOKEN",
        )
        response = client.clients.list(
            fields="fields",
            include_fields=True,
            page=1,
            per_page=1,
            include_totals=True,
            is_global=True,
            is_first_party=True,
            app_type="app_type",
            external_client_id="external_client_id",
            q="q",
        )
        for item in response:
            yield item
        # alternatively, you can paginate page-by-page
        for page in response.iter_pages():
            yield page
        """
        return self._raw_client.list(
            fields=fields,
            include_fields=include_fields,
            page=page,
            per_page=per_page,
            include_totals=include_totals,
            is_global=is_global,
            is_first_party=is_first_party,
            app_type=app_type,
            external_client_id=external_client_id,
            q=q,
            request_options=request_options,
        )

    def create(
        self,
        *,
        name: str,
        description: typing.Optional[str] = OMIT,
        logo_uri: typing.Optional[str] = OMIT,
        callbacks: typing.Optional[typing.Sequence[str]] = OMIT,
        oidc_logout: typing.Optional[ClientOidcBackchannelLogoutSettings] = OMIT,
        oidc_backchannel_logout: typing.Optional[ClientOidcBackchannelLogoutSettings] = OMIT,
        session_transfer: typing.Optional[ClientSessionTransferConfiguration] = OMIT,
        allowed_origins: typing.Optional[typing.Sequence[str]] = OMIT,
        web_origins: typing.Optional[typing.Sequence[str]] = OMIT,
        client_aliases: typing.Optional[typing.Sequence[str]] = OMIT,
        allowed_clients: typing.Optional[typing.Sequence[str]] = OMIT,
        allowed_logout_urls: typing.Optional[typing.Sequence[str]] = OMIT,
        grant_types: typing.Optional[typing.Sequence[str]] = OMIT,
        token_endpoint_auth_method: typing.Optional[ClientTokenEndpointAuthMethodEnum] = OMIT,
        is_token_endpoint_ip_header_trusted: typing.Optional[bool] = OMIT,
        app_type: typing.Optional[ClientAppTypeEnum] = OMIT,
        is_first_party: typing.Optional[bool] = OMIT,
        oidc_conformant: typing.Optional[bool] = OMIT,
        jwt_configuration: typing.Optional[ClientJwtConfiguration] = OMIT,
        encryption_key: typing.Optional[ClientEncryptionKey] = OMIT,
        sso: typing.Optional[bool] = OMIT,
        cross_origin_authentication: typing.Optional[bool] = OMIT,
        cross_origin_loc: typing.Optional[str] = OMIT,
        sso_disabled: typing.Optional[bool] = OMIT,
        custom_login_page_on: typing.Optional[bool] = OMIT,
        custom_login_page: typing.Optional[str] = OMIT,
        custom_login_page_preview: typing.Optional[str] = OMIT,
        form_template: typing.Optional[str] = OMIT,
        addons: typing.Optional[ClientAddons] = OMIT,
        client_metadata: typing.Optional[ClientMetadata] = OMIT,
        mobile: typing.Optional[ClientMobile] = OMIT,
        initiate_login_uri: typing.Optional[str] = OMIT,
        native_social_login: typing.Optional[NativeSocialLogin] = OMIT,
        fedcm_login: typing.Optional[FedCmLogin] = OMIT,
        refresh_token: typing.Optional[ClientRefreshTokenConfiguration] = OMIT,
        default_organization: typing.Optional[ClientDefaultOrganization] = OMIT,
        organization_usage: typing.Optional[ClientOrganizationUsageEnum] = OMIT,
        organization_require_behavior: typing.Optional[ClientOrganizationRequireBehaviorEnum] = OMIT,
        organization_discovery_methods: typing.Optional[typing.Sequence[ClientOrganizationDiscoveryEnum]] = OMIT,
        client_authentication_methods: typing.Optional[ClientCreateAuthenticationMethod] = OMIT,
        require_pushed_authorization_requests: typing.Optional[bool] = OMIT,
        require_proof_of_possession: typing.Optional[bool] = OMIT,
        signed_request_object: typing.Optional[ClientSignedRequestObjectWithPublicKey] = OMIT,
        token_vault_privileged_access: typing.Optional[ClientTokenVaultPrivilegedAccessWithPublicKey] = OMIT,
        compliance_level: typing.Optional[ClientComplianceLevelEnum] = OMIT,
        skip_non_verifiable_callback_uri_confirmation_prompt: typing.Optional[bool] = OMIT,
        token_exchange: typing.Optional[ClientTokenExchangeConfiguration] = OMIT,
        par_request_expiry: typing.Optional[int] = OMIT,
        token_quota: typing.Optional[CreateTokenQuota] = OMIT,
        resource_server_identifier: typing.Optional[str] = OMIT,
        identity_assertion_authorization_grant: typing.Optional[CreateIdentityAssertionAuthorizationGrant] = OMIT,
        third_party_security_mode: typing.Optional[ClientThirdPartySecurityModeEnum] = OMIT,
        redirection_policy: typing.Optional[ClientRedirectionPolicyEnum] = OMIT,
        express_configuration: typing.Optional[ExpressConfiguration] = OMIT,
        my_organization_configuration: typing.Optional[ClientMyOrganizationPostConfiguration] = OMIT,
        async_approval_notification_channels: typing.Optional[
            ClientAsyncApprovalNotificationsChannelsApiPostConfiguration
        ] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CreateClientResponseContent:
        """
        Create a new client (application or SSO integration). For more information, read [Create Applications](https://www.auth0.com/docs/get-started/auth0-overview/create-applications)
        [API Endpoints for Single Sign-On](https://www.auth0.com/docs/authenticate/single-sign-on/api-endpoints-for-single-sign-on).

        Notes:
        - We recommend leaving the `client_secret` parameter unspecified to allow the generation of a safe secret.
        - The `client_authentication_methods` and `token_endpoint_auth_method` properties are mutually exclusive. Use
        `client_authentication_methods` to configure the client with Private Key JWT authentication method. Otherwise, use `token_endpoint_auth_method`
        to configure the client with client secret (basic or post) or with no authentication method (none).
        - When using `client_authentication_methods` to configure the client with Private Key JWT authentication method, specify fully defined credentials.
        These credentials will be automatically enabled for Private Key JWT authentication on the client.
        - To configure `client_authentication_methods`, the `create:client_credentials` scope is required.
        - To configure `client_authentication_methods`, the property `jwt_configuration.alg` must be set to RS256.

        SSO Integrations created via this endpoint will accept login requests and share user profile information.

        Parameters
        ----------
        name : str
            Name of this client (min length: 1 character, does not allow `<` or `>`).

        description : typing.Optional[str]
            Free text description of this client (max length: 140 characters).

        logo_uri : typing.Optional[str]
            URL of the logo to display for this client. Recommended size is 150x150 pixels.

        callbacks : typing.Optional[typing.Sequence[str]]
            Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication.

        oidc_logout : typing.Optional[ClientOidcBackchannelLogoutSettings]

        oidc_backchannel_logout : typing.Optional[ClientOidcBackchannelLogoutSettings]
            Configuration for OIDC backchannel logout (deprecated, in favor of oidc_logout)

        session_transfer : typing.Optional[ClientSessionTransferConfiguration]

        allowed_origins : typing.Optional[typing.Sequence[str]]
            Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs.

        web_origins : typing.Optional[typing.Sequence[str]]
            Comma-separated list of allowed origins for use with <a href='https://auth0.com/docs/cross-origin-authentication'>Cross-Origin Authentication</a>, <a href='https://auth0.com/docs/flows/concepts/device-auth'>Device Flow</a>, and <a href='https://auth0.com/docs/protocols/oauth2#how-response-mode-works'>web message response mode</a>.

        client_aliases : typing.Optional[typing.Sequence[str]]
            List of audiences/realms for SAML protocol. Used by the wsfed addon.

        allowed_clients : typing.Optional[typing.Sequence[str]]
            List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed.

        allowed_logout_urls : typing.Optional[typing.Sequence[str]]
            Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains.

        grant_types : typing.Optional[typing.Sequence[str]]
            List of grant types supported for this application. Can include `authorization_code`, `implicit`, `refresh_token`, `client_credentials`, `password`, `http://auth0.com/oauth/grant-type/password-realm`, `http://auth0.com/oauth/grant-type/mfa-oob`, `http://auth0.com/oauth/grant-type/mfa-otp`, `http://auth0.com/oauth/grant-type/mfa-recovery-code`, `urn:openid:params:grant-type:ciba`, `urn:ietf:params:oauth:grant-type:device_code`, and `urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token`.

        token_endpoint_auth_method : typing.Optional[ClientTokenEndpointAuthMethodEnum]

        is_token_endpoint_ip_header_trusted : typing.Optional[bool]
            If true, trust that the IP specified in the `auth0-forwarded-for` header is the end-user's IP for brute-force-protection on token endpoint.

        app_type : typing.Optional[ClientAppTypeEnum]

        is_first_party : typing.Optional[bool]
            Whether this client a first party client or not

        oidc_conformant : typing.Optional[bool]
            Whether this client conforms to <a href='https://auth0.com/docs/api-auth/tutorials/adoption'>strict OIDC specifications</a> (true) or uses legacy features (false).

        jwt_configuration : typing.Optional[ClientJwtConfiguration]

        encryption_key : typing.Optional[ClientEncryptionKey]

        sso : typing.Optional[bool]
            Applies only to SSO clients and determines whether Auth0 will handle Single Sign On (true) or whether the Identity Provider will (false).

        cross_origin_authentication : typing.Optional[bool]
            Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false).

        cross_origin_loc : typing.Optional[str]
            URL of the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page.

        sso_disabled : typing.Optional[bool]
            <code>true</code> to disable Single Sign On, <code>false</code> otherwise (default: <code>false</code>)

        custom_login_page_on : typing.Optional[bool]
            <code>true</code> if the custom login page is to be used, <code>false</code> otherwise. Defaults to <code>true</code>

        custom_login_page : typing.Optional[str]
            The content (HTML, CSS, JS) of the custom login page.

        custom_login_page_preview : typing.Optional[str]
            The content (HTML, CSS, JS) of the custom login page. (Used on Previews)

        form_template : typing.Optional[str]
            HTML form template to be used for WS-Federation.

        addons : typing.Optional[ClientAddons]

        client_metadata : typing.Optional[ClientMetadata]

        mobile : typing.Optional[ClientMobile]

        initiate_login_uri : typing.Optional[str]
            Initiate login uri, must be https

        native_social_login : typing.Optional[NativeSocialLogin]

        fedcm_login : typing.Optional[FedCmLogin]

        refresh_token : typing.Optional[ClientRefreshTokenConfiguration]

        default_organization : typing.Optional[ClientDefaultOrganization]

        organization_usage : typing.Optional[ClientOrganizationUsageEnum]

        organization_require_behavior : typing.Optional[ClientOrganizationRequireBehaviorEnum]

        organization_discovery_methods : typing.Optional[typing.Sequence[ClientOrganizationDiscoveryEnum]]
            Defines the available methods for organization discovery during the `pre_login_prompt`. Users can discover their organization either by `email`, `organization_name` or both.

        client_authentication_methods : typing.Optional[ClientCreateAuthenticationMethod]

        require_pushed_authorization_requests : typing.Optional[bool]
            Makes the use of Pushed Authorization Requests mandatory for this client

        require_proof_of_possession : typing.Optional[bool]
            Makes the use of Proof-of-Possession mandatory for this client

        signed_request_object : typing.Optional[ClientSignedRequestObjectWithPublicKey]

        token_vault_privileged_access : typing.Optional[ClientTokenVaultPrivilegedAccessWithPublicKey]

        compliance_level : typing.Optional[ClientComplianceLevelEnum]

        skip_non_verifiable_callback_uri_confirmation_prompt : typing.Optional[bool]
            Controls whether a confirmation prompt is shown during login flows when the redirect URI uses non-verifiable callback URIs (for example, a custom URI schema such as `myapp://`, or `localhost`).
            If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps.
            See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information.

        token_exchange : typing.Optional[ClientTokenExchangeConfiguration]

        par_request_expiry : typing.Optional[int]
            Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

        token_quota : typing.Optional[CreateTokenQuota]

        resource_server_identifier : typing.Optional[str]
            The identifier of the resource server that this client is linked to.

        identity_assertion_authorization_grant : typing.Optional[CreateIdentityAssertionAuthorizationGrant]

        third_party_security_mode : typing.Optional[ClientThirdPartySecurityModeEnum]

        redirection_policy : typing.Optional[ClientRedirectionPolicyEnum]

        express_configuration : typing.Optional[ExpressConfiguration]

        my_organization_configuration : typing.Optional[ClientMyOrganizationPostConfiguration]

        async_approval_notification_channels : typing.Optional[ClientAsyncApprovalNotificationsChannelsApiPostConfiguration]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        CreateClientResponseContent
            Client successfully created.

        Examples
        --------
        from auth0 import Auth0

        client = Auth0(
            token="YOUR_TOKEN",
        )
        client.clients.create(
            name="name",
        )
        """
        _response = self._raw_client.create(
            name=name,
            description=description,
            logo_uri=logo_uri,
            callbacks=callbacks,
            oidc_logout=oidc_logout,
            oidc_backchannel_logout=oidc_backchannel_logout,
            session_transfer=session_transfer,
            allowed_origins=allowed_origins,
            web_origins=web_origins,
            client_aliases=client_aliases,
            allowed_clients=allowed_clients,
            allowed_logout_urls=allowed_logout_urls,
            grant_types=grant_types,
            token_endpoint_auth_method=token_endpoint_auth_method,
            is_token_endpoint_ip_header_trusted=is_token_endpoint_ip_header_trusted,
            app_type=app_type,
            is_first_party=is_first_party,
            oidc_conformant=oidc_conformant,
            jwt_configuration=jwt_configuration,
            encryption_key=encryption_key,
            sso=sso,
            cross_origin_authentication=cross_origin_authentication,
            cross_origin_loc=cross_origin_loc,
            sso_disabled=sso_disabled,
            custom_login_page_on=custom_login_page_on,
            custom_login_page=custom_login_page,
            custom_login_page_preview=custom_login_page_preview,
            form_template=form_template,
            addons=addons,
            client_metadata=client_metadata,
            mobile=mobile,
            initiate_login_uri=initiate_login_uri,
            native_social_login=native_social_login,
            fedcm_login=fedcm_login,
            refresh_token=refresh_token,
            default_organization=default_organization,
            organization_usage=organization_usage,
            organization_require_behavior=organization_require_behavior,
            organization_discovery_methods=organization_discovery_methods,
            client_authentication_methods=client_authentication_methods,
            require_pushed_authorization_requests=require_pushed_authorization_requests,
            require_proof_of_possession=require_proof_of_possession,
            signed_request_object=signed_request_object,
            token_vault_privileged_access=token_vault_privileged_access,
            compliance_level=compliance_level,
            skip_non_verifiable_callback_uri_confirmation_prompt=skip_non_verifiable_callback_uri_confirmation_prompt,
            token_exchange=token_exchange,
            par_request_expiry=par_request_expiry,
            token_quota=token_quota,
            resource_server_identifier=resource_server_identifier,
            identity_assertion_authorization_grant=identity_assertion_authorization_grant,
            third_party_security_mode=third_party_security_mode,
            redirection_policy=redirection_policy,
            express_configuration=express_configuration,
            my_organization_configuration=my_organization_configuration,
            async_approval_notification_channels=async_approval_notification_channels,
            request_options=request_options,
        )
        return _response.data

    def preview_cimd_metadata(
        self, *, external_client_id: str, request_options: typing.Optional[RequestOptions] = None
    ) -> PreviewCimdMetadataResponseContent:
        """

              Fetches and validates a Client ID Metadata Document without creating a client.
              Returns the raw metadata and how it would be mapped to Auth0 client fields.
              This endpoint is useful for testing metadata URIs before creating CIMD clients.


        Parameters
        ----------
        external_client_id : str
            URL to the Client ID Metadata Document

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        PreviewCimdMetadataResponseContent
            Metadata successfully fetched and validated, or retrieval error returned with errors array.

        Examples
        --------
        from auth0 import Auth0

        client = Auth0(
            token="YOUR_TOKEN",
        )
        client.clients.preview_cimd_metadata(
            external_client_id="external_client_id",
        )
        """
        _response = self._raw_client.preview_cimd_metadata(
            external_client_id=external_client_id, request_options=request_options
        )
        return _response.data

    def register_cimd_client(
        self, *, external_client_id: str, request_options: typing.Optional[RequestOptions] = None
    ) -> RegisterCimdClientResponseContent:
        """
        Idempotent registration for Client ID Metadata Document (CIMD) clients.
        Uses external_client_id as the unique identifier for upsert operations.

        **Create:** Returns 201 when a new client is created (requires `create:clients` scope).
        **Update:** Returns 200 when an existing client is updated (requires `update:clients` scope).

        This endpoint automatically:
        - Fetches and validates the metadata document
        - Maps CIMD fields to Auth0 client configuration
        - Creates/rotates credentials from the JWKS
        - Enforces CIMD security policies (HTTPS-only, no shared secrets)

        Parameters
        ----------
        external_client_id : str
            URL to the Client ID Metadata Document. Acts as the unique identifier for upsert operations.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        RegisterCimdClientResponseContent
            CIMD client successfully updated (idempotent).

        Examples
        --------
        from auth0 import Auth0

        client = Auth0(
            token="YOUR_TOKEN",
        )
        client.clients.register_cimd_client(
            external_client_id="external_client_id",
        )
        """
        _response = self._raw_client.register_cimd_client(
            external_client_id=external_client_id, request_options=request_options
        )
        return _response.data

    def get(
        self,
        id: str,
        *,
        fields: typing.Optional[str] = None,
        include_fields: typing.Optional[bool] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> GetClientResponseContent:
        """
        Retrieve client details by ID. Clients are SSO connections or Applications linked with your Auth0 tenant. A list of fields to include or exclude may also be specified.
        For more information, read [Applications in Auth0](https://www.auth0.com/docs/get-started/applications) and [Single Sign-On](https://www.auth0.com/docs/authenticate/single-sign-on).

        - The following properties can be retrieved with any of the scopes:
            `client_id`, `app_type`, `name`, and `description`.
        - The following properties can only be retrieved with the `read:clients` or
            `read:client_keys` scopes:
            `callbacks`, `oidc_logout`, `allowed_origins`,
            `web_origins`, `tenant`, `global`, `config_route`,
            `callback_url_template`, `jwt_configuration`,
            `jwt_configuration.lifetime_in_seconds`, `jwt_configuration.secret_encoded`,
            `jwt_configuration.scopes`, `jwt_configuration.alg`, `api_type`,
            `logo_uri`, `allowed_clients`, `owners`, `custom_login_page`,
            `custom_login_page_off`, `sso`, `addons`, `form_template`,
            `custom_login_page_codeview`, `resource_servers`, `client_metadata`,
            `mobile`, `mobile.android`, `mobile.ios`, `allowed_logout_urls`,
            `token_endpoint_auth_method`, `is_first_party`, `oidc_conformant`,
            `is_token_endpoint_ip_header_trusted`, `initiate_login_uri`, `grant_types`,
            `refresh_token`, `refresh_token.rotation_type`, `refresh_token.expiration_type`,
            `refresh_token.leeway`, `refresh_token.token_lifetime`, `refresh_token.policies`, `organization_usage`,
            `organization_require_behavior`.
        - The following properties can only be retrieved with the `read:client_keys` or `read:client_credentials` scopes:
            `encryption_key`, `encryption_key.pub`, `encryption_key.cert`,
            `client_secret`, `client_authentication_methods` and `signing_key`.

        Parameters
        ----------
        id : str
            ID of the client to retrieve.

        fields : typing.Optional[str]
            Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

        include_fields : typing.Optional[bool]
            Whether specified fields are to be included (true) or excluded (false).

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        GetClientResponseContent
            Client successfully retrieved.

        Examples
        --------
        from auth0 import Auth0

        client = Auth0(
            token="YOUR_TOKEN",
        )
        client.clients.get(
            id="id",
            fields="fields",
            include_fields=True,
        )
        """
        _response = self._raw_client.get(
            id, fields=fields, include_fields=include_fields, request_options=request_options
        )
        return _response.data

    def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
        """
        Delete a client and related configuration (rules, connections, etc).

        Parameters
        ----------
        id : str
            ID of the client to delete.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from auth0 import Auth0

        client = Auth0(
            token="YOUR_TOKEN",
        )
        client.clients.delete(
            id="id",
        )
        """
        _response = self._raw_client.delete(id, request_options=request_options)
        return _response.data

    def update(
        self,
        id: str,
        *,
        name: typing.Optional[str] = OMIT,
        description: typing.Optional[str] = OMIT,
        client_secret: typing.Optional[str] = OMIT,
        logo_uri: typing.Optional[str] = OMIT,
        callbacks: typing.Optional[typing.Sequence[str]] = OMIT,
        oidc_logout: typing.Optional[ClientOidcBackchannelLogoutSettings] = OMIT,
        oidc_backchannel_logout: typing.Optional[ClientOidcBackchannelLogoutSettings] = OMIT,
        session_transfer: typing.Optional[ClientSessionTransferConfiguration] = OMIT,
        allowed_origins: typing.Optional[typing.Sequence[str]] = OMIT,
        web_origins: typing.Optional[typing.Sequence[str]] = OMIT,
        grant_types: typing.Optional[typing.Sequence[str]] = OMIT,
        client_aliases: typing.Optional[typing.Sequence[str]] = OMIT,
        allowed_clients: typing.Optional[typing.Sequence[str]] = OMIT,
        allowed_logout_urls: typing.Optional[typing.Sequence[str]] = OMIT,
        jwt_configuration: typing.Optional[ClientJwtConfiguration] = OMIT,
        encryption_key: typing.Optional[ClientEncryptionKey] = OMIT,
        sso: typing.Optional[bool] = OMIT,
        cross_origin_authentication: typing.Optional[bool] = OMIT,
        cross_origin_loc: typing.Optional[str] = OMIT,
        sso_disabled: typing.Optional[bool] = OMIT,
        custom_login_page_on: typing.Optional[bool] = OMIT,
        token_endpoint_auth_method: typing.Optional[ClientTokenEndpointAuthMethodOrNullEnum] = OMIT,
        is_token_endpoint_ip_header_trusted: typing.Optional[bool] = OMIT,
        app_type: typing.Optional[ClientAppTypeEnum] = OMIT,
        is_first_party: typing.Optional[bool] = OMIT,
        oidc_conformant: typing.Optional[bool] = OMIT,
        custom_login_page: typing.Optional[str] = OMIT,
        custom_login_page_preview: typing.Optional[str] = OMIT,
        token_quota: typing.Optional[UpdateTokenQuota] = OMIT,
        identity_assertion_authorization_grant: typing.Optional[UpdateIdentityAssertionAuthorizationGrant] = OMIT,
        form_template: typing.Optional[str] = OMIT,
        addons: typing.Optional[ClientAddons] = OMIT,
        client_metadata: typing.Optional[ClientMetadata] = OMIT,
        mobile: typing.Optional[ClientMobile] = OMIT,
        initiate_login_uri: typing.Optional[str] = OMIT,
        native_social_login: typing.Optional[NativeSocialLoginPatch] = OMIT,
        fedcm_login: typing.Optional[FedCmLoginPatch] = OMIT,
        refresh_token: typing.Optional[ClientRefreshTokenConfiguration] = OMIT,
        default_organization: typing.Optional[ClientDefaultOrganization] = OMIT,
        organization_usage: typing.Optional[ClientOrganizationUsagePatchEnum] = OMIT,
        organization_require_behavior: typing.Optional[ClientOrganizationRequireBehaviorPatchEnum] = OMIT,
        organization_discovery_methods: typing.Optional[typing.Sequence[ClientOrganizationDiscoveryEnum]] = OMIT,
        client_authentication_methods: typing.Optional[ClientAuthenticationMethod] = OMIT,
        require_pushed_authorization_requests: typing.Optional[bool] = OMIT,
        require_proof_of_possession: typing.Optional[bool] = OMIT,
        signed_request_object: typing.Optional[ClientSignedRequestObjectWithCredentialId] = OMIT,
        token_vault_privileged_access: typing.Optional[ClientTokenVaultPrivilegedAccessWithCredentialId] = OMIT,
        compliance_level: typing.Optional[ClientComplianceLevelEnum] = OMIT,
        skip_non_verifiable_callback_uri_confirmation_prompt: typing.Optional[bool] = OMIT,
        token_exchange: typing.Optional[ClientTokenExchangeConfigurationOrNull] = OMIT,
        par_request_expiry: typing.Optional[int] = OMIT,
        express_configuration: typing.Optional[ExpressConfigurationOrNull] = OMIT,
        my_organization_configuration: typing.Optional[ClientMyOrganizationPatchConfiguration] = OMIT,
        async_approval_notification_channels: typing.Optional[
            ClientAsyncApprovalNotificationsChannelsApiPatchConfiguration
        ] = OMIT,
        third_party_security_mode: typing.Optional[ClientThirdPartySecurityModeEnum] = OMIT,
        redirection_policy: typing.Optional[ClientRedirectionPolicyEnum] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> UpdateClientResponseContent:
        """
        Updates a client's settings. For more information, read [Applications in Auth0](https://www.auth0.com/docs/get-started/applications) and [Single Sign-On](https://www.auth0.com/docs/authenticate/single-sign-on).

        Notes:
        - The `client_secret` and `signing_key` attributes can only be updated with the `update:client_keys` scope.
        - The `client_authentication_methods` and `token_endpoint_auth_method` properties are mutually exclusive. Use `client_authentication_methods` to configure the client with Private Key JWT authentication method. Otherwise, use `token_endpoint_auth_method` to configure the client with client secret (basic or post) or with no authentication method (none).
        - When using `client_authentication_methods` to configure the client with Private Key JWT authentication method, only specify the credential IDs that were generated when creating the credentials on the client.
        - To configure `client_authentication_methods`, the `update:client_credentials` scope is required.
        - To configure `client_authentication_methods`, the property `jwt_configuration.alg` must be set to RS256.
        - To change a client's `is_first_party` property to `false`, the `organization_usage` and `organization_require_behavior` properties must be unset.

        Parameters
        ----------
        id : str
            ID of the client to update.

        name : typing.Optional[str]
            The name of the client. Must contain at least one character. Does not allow '<' or '>'.

        description : typing.Optional[str]
            Free text description of the purpose of the Client. (Max character length: <code>140</code>)

        client_secret : typing.Optional[str]
            The secret used to sign tokens for the client

        logo_uri : typing.Optional[str]
            The URL of the client logo (recommended size: 150x150)

        callbacks : typing.Optional[typing.Sequence[str]]
            A set of URLs that are valid to call back from Auth0 when authenticating users

        oidc_logout : typing.Optional[ClientOidcBackchannelLogoutSettings]

        oidc_backchannel_logout : typing.Optional[ClientOidcBackchannelLogoutSettings]
            Configuration for OIDC backchannel logout (deprecated, in favor of oidc_logout)

        session_transfer : typing.Optional[ClientSessionTransferConfiguration]

        allowed_origins : typing.Optional[typing.Sequence[str]]
            A set of URLs that represents valid origins for CORS

        web_origins : typing.Optional[typing.Sequence[str]]
            A set of URLs that represents valid web origins for use with web message response mode

        grant_types : typing.Optional[typing.Sequence[str]]
            A set of grant types that the client is authorized to use. Can include `authorization_code`, `implicit`, `refresh_token`, `client_credentials`, `password`, `http://auth0.com/oauth/grant-type/password-realm`, `http://auth0.com/oauth/grant-type/mfa-oob`, `http://auth0.com/oauth/grant-type/mfa-otp`, `http://auth0.com/oauth/grant-type/mfa-recovery-code`, `urn:openid:params:grant-type:ciba`, `urn:ietf:params:oauth:grant-type:device_code`, and `urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token`.

        client_aliases : typing.Optional[typing.Sequence[str]]
            List of audiences for SAML protocol

        allowed_clients : typing.Optional[typing.Sequence[str]]
            Ids of clients that will be allowed to perform delegation requests. Clients that will be allowed to make delegation request. By default, all your clients will be allowed. This field allows you to specify specific clients

        allowed_logout_urls : typing.Optional[typing.Sequence[str]]
            URLs that are valid to redirect to after logout from Auth0

        jwt_configuration : typing.Optional[ClientJwtConfiguration]
            An object that holds settings related to how JWTs are created

        encryption_key : typing.Optional[ClientEncryptionKey]
            The client's encryption key

        sso : typing.Optional[bool]
            <code>true</code> to use Auth0 instead of the IdP to do Single Sign On, <code>false</code> otherwise (default: <code>false</code>)

        cross_origin_authentication : typing.Optional[bool]
            <code>true</code> if this client can be used to make cross-origin authentication requests, <code>false</code> otherwise if cross origin is disabled

        cross_origin_loc : typing.Optional[str]
            URL for the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page.

        sso_disabled : typing.Optional[bool]
            <code>true</code> to disable Single Sign On, <code>false</code> otherwise (default: <code>false</code>)

        custom_login_page_on : typing.Optional[bool]
            <code>true</code> if the custom login page is to be used, <code>false</code> otherwise.

        token_endpoint_auth_method : typing.Optional[ClientTokenEndpointAuthMethodOrNullEnum]

        is_token_endpoint_ip_header_trusted : typing.Optional[bool]
            If true, trust that the IP specified in the `auth0-forwarded-for` header is the end-user's IP for brute-force-protection on token endpoint.

        app_type : typing.Optional[ClientAppTypeEnum]

        is_first_party : typing.Optional[bool]
            Whether this client a first party client or not

        oidc_conformant : typing.Optional[bool]
            Whether this client will conform to strict OIDC specifications

        custom_login_page : typing.Optional[str]
            The content (HTML, CSS, JS) of the custom login page

        custom_login_page_preview : typing.Optional[str]

        token_quota : typing.Optional[UpdateTokenQuota]

        identity_assertion_authorization_grant : typing.Optional[UpdateIdentityAssertionAuthorizationGrant]

        form_template : typing.Optional[str]
            Form template for WS-Federation protocol

        addons : typing.Optional[ClientAddons]

        client_metadata : typing.Optional[ClientMetadata]

        mobile : typing.Optional[ClientMobile]
            Configuration related to native mobile apps

        initiate_login_uri : typing.Optional[str]
            Initiate login uri, must be https

        native_social_login : typing.Optional[NativeSocialLoginPatch]

        fedcm_login : typing.Optional[FedCmLoginPatch]

        refresh_token : typing.Optional[ClientRefreshTokenConfiguration]

        default_organization : typing.Optional[ClientDefaultOrganization]

        organization_usage : typing.Optional[ClientOrganizationUsagePatchEnum]

        organization_require_behavior : typing.Optional[ClientOrganizationRequireBehaviorPatchEnum]

        organization_discovery_methods : typing.Optional[typing.Sequence[ClientOrganizationDiscoveryEnum]]
            Defines the available methods for organization discovery during the `pre_login_prompt`. Users can discover their organization either by `email`, `organization_name` or both.

        client_authentication_methods : typing.Optional[ClientAuthenticationMethod]

        require_pushed_authorization_requests : typing.Optional[bool]
            Makes the use of Pushed Authorization Requests mandatory for this client

        require_proof_of_possession : typing.Optional[bool]
            Makes the use of Proof-of-Possession mandatory for this client

        signed_request_object : typing.Optional[ClientSignedRequestObjectWithCredentialId]

        token_vault_privileged_access : typing.Optional[ClientTokenVaultPrivilegedAccessWithCredentialId]

        compliance_level : typing.Optional[ClientComplianceLevelEnum]

        skip_non_verifiable_callback_uri_confirmation_prompt : typing.Optional[bool]
            Controls whether a confirmation prompt is shown during login flows when the redirect URI uses non-verifiable callback URIs (for example, a custom URI schema such as `myapp://`, or `localhost`).
            If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps.
            See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information.

        token_exchange : typing.Optional[ClientTokenExchangeConfigurationOrNull]

        par_request_expiry : typing.Optional[int]
            Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

        express_configuration : typing.Optional[ExpressConfigurationOrNull]

        my_organization_configuration : typing.Optional[ClientMyOrganizationPatchConfiguration]

        async_approval_notification_channels : typing.Optional[ClientAsyncApprovalNotificationsChannelsApiPatchConfiguration]

        third_party_security_mode : typing.Optional[ClientThirdPartySecurityModeEnum]

        redirection_policy : typing.Optional[ClientRedirectionPolicyEnum]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        UpdateClientResponseContent
            Client successfully updated.

        Examples
        --------
        from auth0 import Auth0

        client = Auth0(
            token="YOUR_TOKEN",
        )
        client.clients.update(
            id="id",
        )
        """
        _response = self._raw_client.update(
            id,
            name=name,
            description=description,
            client_secret=client_secret,
            logo_uri=logo_uri,
            callbacks=callbacks,
            oidc_logout=oidc_logout,
            oidc_backchannel_logout=oidc_backchannel_logout,
            session_transfer=session_transfer,
            allowed_origins=allowed_origins,
            web_origins=web_origins,
            grant_types=grant_types,
            client_aliases=client_aliases,
            allowed_clients=allowed_clients,
            allowed_logout_urls=allowed_logout_urls,
            jwt_configuration=jwt_configuration,
            encryption_key=encryption_key,
            sso=sso,
            cross_origin_authentication=cross_origin_authentication,
            cross_origin_loc=cross_origin_loc,
            sso_disabled=sso_disabled,
            custom_login_page_on=custom_login_page_on,
            token_endpoint_auth_method=token_endpoint_auth_method,
            is_token_endpoint_ip_header_trusted=is_token_endpoint_ip_header_trusted,
            app_type=app_type,
            is_first_party=is_first_party,
            oidc_conformant=oidc_conformant,
            custom_login_page=custom_login_page,
            custom_login_page_preview=custom_login_page_preview,
            token_quota=token_quota,
            identity_assertion_authorization_grant=identity_assertion_authorization_grant,
            form_template=form_template,
            addons=addons,
            client_metadata=client_metadata,
            mobile=mobile,
            initiate_login_uri=initiate_login_uri,
            native_social_login=native_social_login,
            fedcm_login=fedcm_login,
            refresh_token=refresh_token,
            default_organization=default_organization,
            organization_usage=organization_usage,
            organization_require_behavior=organization_require_behavior,
            organization_discovery_methods=organization_discovery_methods,
            client_authentication_methods=client_authentication_methods,
            require_pushed_authorization_requests=require_pushed_authorization_requests,
            require_proof_of_possession=require_proof_of_possession,
            signed_request_object=signed_request_object,
            token_vault_privileged_access=token_vault_privileged_access,
            compliance_level=compliance_level,
            skip_non_verifiable_callback_uri_confirmation_prompt=skip_non_verifiable_callback_uri_confirmation_prompt,
            token_exchange=token_exchange,
            par_request_expiry=par_request_expiry,
            express_configuration=express_configuration,
            my_organization_configuration=my_organization_configuration,
            async_approval_notification_channels=async_approval_notification_channels,
            third_party_security_mode=third_party_security_mode,
            redirection_policy=redirection_policy,
            request_options=request_options,
        )
        return _response.data

    def rotate_secret(
        self, id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> RotateClientSecretResponseContent:
        """
        Rotate a client secret.

        This endpoint cannot be used with clients configured with Private Key JWT authentication method (client_authentication_methods configured with private_key_jwt). The generated secret is NOT base64 encoded.

        For more information, read [Rotate Client Secrets](https://www.auth0.com/docs/get-started/applications/rotate-client-secret).

        Parameters
        ----------
        id : str
            ID of the client that will rotate secrets.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        RotateClientSecretResponseContent
            Secret successfully rotated.

        Examples
        --------
        from auth0 import Auth0

        client = Auth0(
            token="YOUR_TOKEN",
        )
        client.clients.rotate_secret(
            id="id",
        )
        """
        _response = self._raw_client.rotate_secret(id, request_options=request_options)
        return _response.data

    @property
    def credentials(self):
        if self._credentials is None:
            from .credentials.client import CredentialsClient  # noqa: E402

            self._credentials = CredentialsClient(client_wrapper=self._client_wrapper)
        return self._credentials

    @property
    def connections(self):
        if self._connections is None:
            from .connections.client import ConnectionsClient  # noqa: E402

            self._connections = ConnectionsClient(client_wrapper=self._client_wrapper)
        return self._connections


class AsyncClientsClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawClientsClient(client_wrapper=client_wrapper)
        self._client_wrapper = client_wrapper
        self._credentials: typing.Optional[AsyncCredentialsClient] = None
        self._connections: typing.Optional[AsyncConnectionsClient] = None

    @property
    def with_raw_response(self) -> AsyncRawClientsClient:
        """
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawClientsClient
        """
        return self._raw_client

    async def list(
        self,
        *,
        fields: typing.Optional[str] = None,
        include_fields: typing.Optional[bool] = None,
        page: typing.Optional[int] = 0,
        per_page: typing.Optional[int] = 50,
        include_totals: typing.Optional[bool] = True,
        is_global: typing.Optional[bool] = None,
        is_first_party: typing.Optional[bool] = None,
        app_type: typing.Optional[str] = None,
        external_client_id: typing.Optional[str] = None,
        q: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AsyncPager[Client, ListClientsOffsetPaginatedResponseContent]:
        """
        Retrieve clients (applications and SSO integrations) matching provided filters. A list of fields to include or exclude may also be specified.
        For more information, read [Applications in Auth0](https://www.auth0.com/docs/get-started/applications) and [Single Sign-On](https://www.auth0.com/docs/authenticate/single-sign-on).

        - The following can be retrieved with any scope:
            `client_id`, `app_type`, `name`, and `description`.
        - The following properties can only be retrieved with the `read:clients` or
            `read:client_keys` scope:
            `callbacks`, `oidc_logout`, `allowed_origins`,
            `web_origins`, `tenant`, `global`, `config_route`,
            `callback_url_template`, `jwt_configuration`,
            `jwt_configuration.lifetime_in_seconds`, `jwt_configuration.secret_encoded`,
            `jwt_configuration.scopes`, `jwt_configuration.alg`, `api_type`,
            `logo_uri`, `allowed_clients`, `owners`, `custom_login_page`,
            `custom_login_page_off`, `sso`, `addons`, `form_template`,
            `custom_login_page_codeview`, `resource_servers`, `client_metadata`,
            `mobile`, `mobile.android`, `mobile.ios`, `allowed_logout_urls`,
            `token_endpoint_auth_method`, `is_first_party`, `oidc_conformant`,
            `is_token_endpoint_ip_header_trusted`, `initiate_login_uri`, `grant_types`,
            `refresh_token`, `refresh_token.rotation_type`, `refresh_token.expiration_type`,
            `refresh_token.leeway`, `refresh_token.token_lifetime`, `refresh_token.policies`, `organization_usage`,
            `organization_require_behavior`.
        - The following properties can only be retrieved with the
            `read:client_keys` or `read:client_credentials` scope:
            `encryption_key`, `encryption_key.pub`, `encryption_key.cert`,
            `client_secret`, `client_authentication_methods` and `signing_key`.

        Parameters
        ----------
        fields : typing.Optional[str]
            Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

        include_fields : typing.Optional[bool]
            Whether specified fields are to be included (true) or excluded (false).

        page : typing.Optional[int]
            Page index of the results to return. First page is 0.

        per_page : typing.Optional[int]
            Number of results per page. Default value is 50, maximum value is 100

        include_totals : typing.Optional[bool]
            Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

        is_global : typing.Optional[bool]
            Optional filter on the global client parameter.

        is_first_party : typing.Optional[bool]
            Optional filter on whether or not a client is a first-party client.

        app_type : typing.Optional[str]
            Optional filter by a comma-separated list of application types.

        external_client_id : typing.Optional[str]
            Optional filter by the <a href="https://drafts.oauth.net/draft-ietf-oauth-client-id-metadata-document/draft-ietf-oauth-client-id-metadata-document.html">Client ID Metadata Document</a> URI for CIMD-registered clients.

        q : typing.Optional[str]
            Advanced Query in <a href="https://lucene.apache.org/core/2_9_4/queryparsersyntax.html">Lucene</a> syntax.<br /><b>Permitted Queries</b>:<br /><ul><li><i>client_grant.organization_id:{organization_id}</i></li><li><i>client_grant.allow_any_organization:true</i></li></ul><b>Additional Restrictions</b>:<br /><ul><li>Cannot be used in combination with other filters</li><li>Requires use of the <i>from</i> and <i>take</i> paging parameters (checkpoint paginatinon)</li><li>Reduced rate limits apply. See <a href="https://auth0.com/docs/troubleshoot/customer-support/operational-policies/rate-limit-policy/rate-limit-configurations/enterprise-public">Rate Limit Configurations</a></li></ul><i><b>Note</b>: Recent updates may not be immediately reflected in query results</i>

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        AsyncPager[Client, ListClientsOffsetPaginatedResponseContent]
            Clients successfully retrieved.

        Examples
        --------
        import asyncio

        from auth0 import AsyncAuth0

        client = AsyncAuth0(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            response = await client.clients.list(
                fields="fields",
                include_fields=True,
                page=1,
                per_page=1,
                include_totals=True,
                is_global=True,
                is_first_party=True,
                app_type="app_type",
                external_client_id="external_client_id",
                q="q",
            )
            async for item in response:
                yield item

            # alternatively, you can paginate page-by-page
            async for page in response.iter_pages():
                yield page


        asyncio.run(main())
        """
        return await self._raw_client.list(
            fields=fields,
            include_fields=include_fields,
            page=page,
            per_page=per_page,
            include_totals=include_totals,
            is_global=is_global,
            is_first_party=is_first_party,
            app_type=app_type,
            external_client_id=external_client_id,
            q=q,
            request_options=request_options,
        )

    async def create(
        self,
        *,
        name: str,
        description: typing.Optional[str] = OMIT,
        logo_uri: typing.Optional[str] = OMIT,
        callbacks: typing.Optional[typing.Sequence[str]] = OMIT,
        oidc_logout: typing.Optional[ClientOidcBackchannelLogoutSettings] = OMIT,
        oidc_backchannel_logout: typing.Optional[ClientOidcBackchannelLogoutSettings] = OMIT,
        session_transfer: typing.Optional[ClientSessionTransferConfiguration] = OMIT,
        allowed_origins: typing.Optional[typing.Sequence[str]] = OMIT,
        web_origins: typing.Optional[typing.Sequence[str]] = OMIT,
        client_aliases: typing.Optional[typing.Sequence[str]] = OMIT,
        allowed_clients: typing.Optional[typing.Sequence[str]] = OMIT,
        allowed_logout_urls: typing.Optional[typing.Sequence[str]] = OMIT,
        grant_types: typing.Optional[typing.Sequence[str]] = OMIT,
        token_endpoint_auth_method: typing.Optional[ClientTokenEndpointAuthMethodEnum] = OMIT,
        is_token_endpoint_ip_header_trusted: typing.Optional[bool] = OMIT,
        app_type: typing.Optional[ClientAppTypeEnum] = OMIT,
        is_first_party: typing.Optional[bool] = OMIT,
        oidc_conformant: typing.Optional[bool] = OMIT,
        jwt_configuration: typing.Optional[ClientJwtConfiguration] = OMIT,
        encryption_key: typing.Optional[ClientEncryptionKey] = OMIT,
        sso: typing.Optional[bool] = OMIT,
        cross_origin_authentication: typing.Optional[bool] = OMIT,
        cross_origin_loc: typing.Optional[str] = OMIT,
        sso_disabled: typing.Optional[bool] = OMIT,
        custom_login_page_on: typing.Optional[bool] = OMIT,
        custom_login_page: typing.Optional[str] = OMIT,
        custom_login_page_preview: typing.Optional[str] = OMIT,
        form_template: typing.Optional[str] = OMIT,
        addons: typing.Optional[ClientAddons] = OMIT,
        client_metadata: typing.Optional[ClientMetadata] = OMIT,
        mobile: typing.Optional[ClientMobile] = OMIT,
        initiate_login_uri: typing.Optional[str] = OMIT,
        native_social_login: typing.Optional[NativeSocialLogin] = OMIT,
        fedcm_login: typing.Optional[FedCmLogin] = OMIT,
        refresh_token: typing.Optional[ClientRefreshTokenConfiguration] = OMIT,
        default_organization: typing.Optional[ClientDefaultOrganization] = OMIT,
        organization_usage: typing.Optional[ClientOrganizationUsageEnum] = OMIT,
        organization_require_behavior: typing.Optional[ClientOrganizationRequireBehaviorEnum] = OMIT,
        organization_discovery_methods: typing.Optional[typing.Sequence[ClientOrganizationDiscoveryEnum]] = OMIT,
        client_authentication_methods: typing.Optional[ClientCreateAuthenticationMethod] = OMIT,
        require_pushed_authorization_requests: typing.Optional[bool] = OMIT,
        require_proof_of_possession: typing.Optional[bool] = OMIT,
        signed_request_object: typing.Optional[ClientSignedRequestObjectWithPublicKey] = OMIT,
        token_vault_privileged_access: typing.Optional[ClientTokenVaultPrivilegedAccessWithPublicKey] = OMIT,
        compliance_level: typing.Optional[ClientComplianceLevelEnum] = OMIT,
        skip_non_verifiable_callback_uri_confirmation_prompt: typing.Optional[bool] = OMIT,
        token_exchange: typing.Optional[ClientTokenExchangeConfiguration] = OMIT,
        par_request_expiry: typing.Optional[int] = OMIT,
        token_quota: typing.Optional[CreateTokenQuota] = OMIT,
        resource_server_identifier: typing.Optional[str] = OMIT,
        identity_assertion_authorization_grant: typing.Optional[CreateIdentityAssertionAuthorizationGrant] = OMIT,
        third_party_security_mode: typing.Optional[ClientThirdPartySecurityModeEnum] = OMIT,
        redirection_policy: typing.Optional[ClientRedirectionPolicyEnum] = OMIT,
        express_configuration: typing.Optional[ExpressConfiguration] = OMIT,
        my_organization_configuration: typing.Optional[ClientMyOrganizationPostConfiguration] = OMIT,
        async_approval_notification_channels: typing.Optional[
            ClientAsyncApprovalNotificationsChannelsApiPostConfiguration
        ] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CreateClientResponseContent:
        """
        Create a new client (application or SSO integration). For more information, read [Create Applications](https://www.auth0.com/docs/get-started/auth0-overview/create-applications)
        [API Endpoints for Single Sign-On](https://www.auth0.com/docs/authenticate/single-sign-on/api-endpoints-for-single-sign-on).

        Notes:
        - We recommend leaving the `client_secret` parameter unspecified to allow the generation of a safe secret.
        - The `client_authentication_methods` and `token_endpoint_auth_method` properties are mutually exclusive. Use
        `client_authentication_methods` to configure the client with Private Key JWT authentication method. Otherwise, use `token_endpoint_auth_method`
        to configure the client with client secret (basic or post) or with no authentication method (none).
        - When using `client_authentication_methods` to configure the client with Private Key JWT authentication method, specify fully defined credentials.
        These credentials will be automatically enabled for Private Key JWT authentication on the client.
        - To configure `client_authentication_methods`, the `create:client_credentials` scope is required.
        - To configure `client_authentication_methods`, the property `jwt_configuration.alg` must be set to RS256.

        SSO Integrations created via this endpoint will accept login requests and share user profile information.

        Parameters
        ----------
        name : str
            Name of this client (min length: 1 character, does not allow `<` or `>`).

        description : typing.Optional[str]
            Free text description of this client (max length: 140 characters).

        logo_uri : typing.Optional[str]
            URL of the logo to display for this client. Recommended size is 150x150 pixels.

        callbacks : typing.Optional[typing.Sequence[str]]
            Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication.

        oidc_logout : typing.Optional[ClientOidcBackchannelLogoutSettings]

        oidc_backchannel_logout : typing.Optional[ClientOidcBackchannelLogoutSettings]
            Configuration for OIDC backchannel logout (deprecated, in favor of oidc_logout)

        session_transfer : typing.Optional[ClientSessionTransferConfiguration]

        allowed_origins : typing.Optional[typing.Sequence[str]]
            Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs.

        web_origins : typing.Optional[typing.Sequence[str]]
            Comma-separated list of allowed origins for use with <a href='https://auth0.com/docs/cross-origin-authentication'>Cross-Origin Authentication</a>, <a href='https://auth0.com/docs/flows/concepts/device-auth'>Device Flow</a>, and <a href='https://auth0.com/docs/protocols/oauth2#how-response-mode-works'>web message response mode</a>.

        client_aliases : typing.Optional[typing.Sequence[str]]
            List of audiences/realms for SAML protocol. Used by the wsfed addon.

        allowed_clients : typing.Optional[typing.Sequence[str]]
            List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed.

        allowed_logout_urls : typing.Optional[typing.Sequence[str]]
            Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains.

        grant_types : typing.Optional[typing.Sequence[str]]
            List of grant types supported for this application. Can include `authorization_code`, `implicit`, `refresh_token`, `client_credentials`, `password`, `http://auth0.com/oauth/grant-type/password-realm`, `http://auth0.com/oauth/grant-type/mfa-oob`, `http://auth0.com/oauth/grant-type/mfa-otp`, `http://auth0.com/oauth/grant-type/mfa-recovery-code`, `urn:openid:params:grant-type:ciba`, `urn:ietf:params:oauth:grant-type:device_code`, and `urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token`.

        token_endpoint_auth_method : typing.Optional[ClientTokenEndpointAuthMethodEnum]

        is_token_endpoint_ip_header_trusted : typing.Optional[bool]
            If true, trust that the IP specified in the `auth0-forwarded-for` header is the end-user's IP for brute-force-protection on token endpoint.

        app_type : typing.Optional[ClientAppTypeEnum]

        is_first_party : typing.Optional[bool]
            Whether this client a first party client or not

        oidc_conformant : typing.Optional[bool]
            Whether this client conforms to <a href='https://auth0.com/docs/api-auth/tutorials/adoption'>strict OIDC specifications</a> (true) or uses legacy features (false).

        jwt_configuration : typing.Optional[ClientJwtConfiguration]

        encryption_key : typing.Optional[ClientEncryptionKey]

        sso : typing.Optional[bool]
            Applies only to SSO clients and determines whether Auth0 will handle Single Sign On (true) or whether the Identity Provider will (false).

        cross_origin_authentication : typing.Optional[bool]
            Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false).

        cross_origin_loc : typing.Optional[str]
            URL of the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page.

        sso_disabled : typing.Optional[bool]
            <code>true</code> to disable Single Sign On, <code>false</code> otherwise (default: <code>false</code>)

        custom_login_page_on : typing.Optional[bool]
            <code>true</code> if the custom login page is to be used, <code>false</code> otherwise. Defaults to <code>true</code>

        custom_login_page : typing.Optional[str]
            The content (HTML, CSS, JS) of the custom login page.

        custom_login_page_preview : typing.Optional[str]
            The content (HTML, CSS, JS) of the custom login page. (Used on Previews)

        form_template : typing.Optional[str]
            HTML form template to be used for WS-Federation.

        addons : typing.Optional[ClientAddons]

        client_metadata : typing.Optional[ClientMetadata]

        mobile : typing.Optional[ClientMobile]

        initiate_login_uri : typing.Optional[str]
            Initiate login uri, must be https

        native_social_login : typing.Optional[NativeSocialLogin]

        fedcm_login : typing.Optional[FedCmLogin]

        refresh_token : typing.Optional[ClientRefreshTokenConfiguration]

        default_organization : typing.Optional[ClientDefaultOrganization]

        organization_usage : typing.Optional[ClientOrganizationUsageEnum]

        organization_require_behavior : typing.Optional[ClientOrganizationRequireBehaviorEnum]

        organization_discovery_methods : typing.Optional[typing.Sequence[ClientOrganizationDiscoveryEnum]]
            Defines the available methods for organization discovery during the `pre_login_prompt`. Users can discover their organization either by `email`, `organization_name` or both.

        client_authentication_methods : typing.Optional[ClientCreateAuthenticationMethod]

        require_pushed_authorization_requests : typing.Optional[bool]
            Makes the use of Pushed Authorization Requests mandatory for this client

        require_proof_of_possession : typing.Optional[bool]
            Makes the use of Proof-of-Possession mandatory for this client

        signed_request_object : typing.Optional[ClientSignedRequestObjectWithPublicKey]

        token_vault_privileged_access : typing.Optional[ClientTokenVaultPrivilegedAccessWithPublicKey]

        compliance_level : typing.Optional[ClientComplianceLevelEnum]

        skip_non_verifiable_callback_uri_confirmation_prompt : typing.Optional[bool]
            Controls whether a confirmation prompt is shown during login flows when the redirect URI uses non-verifiable callback URIs (for example, a custom URI schema such as `myapp://`, or `localhost`).
            If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps.
            See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information.

        token_exchange : typing.Optional[ClientTokenExchangeConfiguration]

        par_request_expiry : typing.Optional[int]
            Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

        token_quota : typing.Optional[CreateTokenQuota]

        resource_server_identifier : typing.Optional[str]
            The identifier of the resource server that this client is linked to.

        identity_assertion_authorization_grant : typing.Optional[CreateIdentityAssertionAuthorizationGrant]

        third_party_security_mode : typing.Optional[ClientThirdPartySecurityModeEnum]

        redirection_policy : typing.Optional[ClientRedirectionPolicyEnum]

        express_configuration : typing.Optional[ExpressConfiguration]

        my_organization_configuration : typing.Optional[ClientMyOrganizationPostConfiguration]

        async_approval_notification_channels : typing.Optional[ClientAsyncApprovalNotificationsChannelsApiPostConfiguration]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        CreateClientResponseContent
            Client successfully created.

        Examples
        --------
        import asyncio

        from auth0 import AsyncAuth0

        client = AsyncAuth0(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.clients.create(
                name="name",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.create(
            name=name,
            description=description,
            logo_uri=logo_uri,
            callbacks=callbacks,
            oidc_logout=oidc_logout,
            oidc_backchannel_logout=oidc_backchannel_logout,
            session_transfer=session_transfer,
            allowed_origins=allowed_origins,
            web_origins=web_origins,
            client_aliases=client_aliases,
            allowed_clients=allowed_clients,
            allowed_logout_urls=allowed_logout_urls,
            grant_types=grant_types,
            token_endpoint_auth_method=token_endpoint_auth_method,
            is_token_endpoint_ip_header_trusted=is_token_endpoint_ip_header_trusted,
            app_type=app_type,
            is_first_party=is_first_party,
            oidc_conformant=oidc_conformant,
            jwt_configuration=jwt_configuration,
            encryption_key=encryption_key,
            sso=sso,
            cross_origin_authentication=cross_origin_authentication,
            cross_origin_loc=cross_origin_loc,
            sso_disabled=sso_disabled,
            custom_login_page_on=custom_login_page_on,
            custom_login_page=custom_login_page,
            custom_login_page_preview=custom_login_page_preview,
            form_template=form_template,
            addons=addons,
            client_metadata=client_metadata,
            mobile=mobile,
            initiate_login_uri=initiate_login_uri,
            native_social_login=native_social_login,
            fedcm_login=fedcm_login,
            refresh_token=refresh_token,
            default_organization=default_organization,
            organization_usage=organization_usage,
            organization_require_behavior=organization_require_behavior,
            organization_discovery_methods=organization_discovery_methods,
            client_authentication_methods=client_authentication_methods,
            require_pushed_authorization_requests=require_pushed_authorization_requests,
            require_proof_of_possession=require_proof_of_possession,
            signed_request_object=signed_request_object,
            token_vault_privileged_access=token_vault_privileged_access,
            compliance_level=compliance_level,
            skip_non_verifiable_callback_uri_confirmation_prompt=skip_non_verifiable_callback_uri_confirmation_prompt,
            token_exchange=token_exchange,
            par_request_expiry=par_request_expiry,
            token_quota=token_quota,
            resource_server_identifier=resource_server_identifier,
            identity_assertion_authorization_grant=identity_assertion_authorization_grant,
            third_party_security_mode=third_party_security_mode,
            redirection_policy=redirection_policy,
            express_configuration=express_configuration,
            my_organization_configuration=my_organization_configuration,
            async_approval_notification_channels=async_approval_notification_channels,
            request_options=request_options,
        )
        return _response.data

    async def preview_cimd_metadata(
        self, *, external_client_id: str, request_options: typing.Optional[RequestOptions] = None
    ) -> PreviewCimdMetadataResponseContent:
        """

              Fetches and validates a Client ID Metadata Document without creating a client.
              Returns the raw metadata and how it would be mapped to Auth0 client fields.
              This endpoint is useful for testing metadata URIs before creating CIMD clients.


        Parameters
        ----------
        external_client_id : str
            URL to the Client ID Metadata Document

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        PreviewCimdMetadataResponseContent
            Metadata successfully fetched and validated, or retrieval error returned with errors array.

        Examples
        --------
        import asyncio

        from auth0 import AsyncAuth0

        client = AsyncAuth0(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.clients.preview_cimd_metadata(
                external_client_id="external_client_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.preview_cimd_metadata(
            external_client_id=external_client_id, request_options=request_options
        )
        return _response.data

    async def register_cimd_client(
        self, *, external_client_id: str, request_options: typing.Optional[RequestOptions] = None
    ) -> RegisterCimdClientResponseContent:
        """
        Idempotent registration for Client ID Metadata Document (CIMD) clients.
        Uses external_client_id as the unique identifier for upsert operations.

        **Create:** Returns 201 when a new client is created (requires `create:clients` scope).
        **Update:** Returns 200 when an existing client is updated (requires `update:clients` scope).

        This endpoint automatically:
        - Fetches and validates the metadata document
        - Maps CIMD fields to Auth0 client configuration
        - Creates/rotates credentials from the JWKS
        - Enforces CIMD security policies (HTTPS-only, no shared secrets)

        Parameters
        ----------
        external_client_id : str
            URL to the Client ID Metadata Document. Acts as the unique identifier for upsert operations.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        RegisterCimdClientResponseContent
            CIMD client successfully updated (idempotent).

        Examples
        --------
        import asyncio

        from auth0 import AsyncAuth0

        client = AsyncAuth0(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.clients.register_cimd_client(
                external_client_id="external_client_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.register_cimd_client(
            external_client_id=external_client_id, request_options=request_options
        )
        return _response.data

    async def get(
        self,
        id: str,
        *,
        fields: typing.Optional[str] = None,
        include_fields: typing.Optional[bool] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> GetClientResponseContent:
        """
        Retrieve client details by ID. Clients are SSO connections or Applications linked with your Auth0 tenant. A list of fields to include or exclude may also be specified.
        For more information, read [Applications in Auth0](https://www.auth0.com/docs/get-started/applications) and [Single Sign-On](https://www.auth0.com/docs/authenticate/single-sign-on).

        - The following properties can be retrieved with any of the scopes:
            `client_id`, `app_type`, `name`, and `description`.
        - The following properties can only be retrieved with the `read:clients` or
            `read:client_keys` scopes:
            `callbacks`, `oidc_logout`, `allowed_origins`,
            `web_origins`, `tenant`, `global`, `config_route`,
            `callback_url_template`, `jwt_configuration`,
            `jwt_configuration.lifetime_in_seconds`, `jwt_configuration.secret_encoded`,
            `jwt_configuration.scopes`, `jwt_configuration.alg`, `api_type`,
            `logo_uri`, `allowed_clients`, `owners`, `custom_login_page`,
            `custom_login_page_off`, `sso`, `addons`, `form_template`,
            `custom_login_page_codeview`, `resource_servers`, `client_metadata`,
            `mobile`, `mobile.android`, `mobile.ios`, `allowed_logout_urls`,
            `token_endpoint_auth_method`, `is_first_party`, `oidc_conformant`,
            `is_token_endpoint_ip_header_trusted`, `initiate_login_uri`, `grant_types`,
            `refresh_token`, `refresh_token.rotation_type`, `refresh_token.expiration_type`,
            `refresh_token.leeway`, `refresh_token.token_lifetime`, `refresh_token.policies`, `organization_usage`,
            `organization_require_behavior`.
        - The following properties can only be retrieved with the `read:client_keys` or `read:client_credentials` scopes:
            `encryption_key`, `encryption_key.pub`, `encryption_key.cert`,
            `client_secret`, `client_authentication_methods` and `signing_key`.

        Parameters
        ----------
        id : str
            ID of the client to retrieve.

        fields : typing.Optional[str]
            Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

        include_fields : typing.Optional[bool]
            Whether specified fields are to be included (true) or excluded (false).

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        GetClientResponseContent
            Client successfully retrieved.

        Examples
        --------
        import asyncio

        from auth0 import AsyncAuth0

        client = AsyncAuth0(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.clients.get(
                id="id",
                fields="fields",
                include_fields=True,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.get(
            id, fields=fields, include_fields=include_fields, request_options=request_options
        )
        return _response.data

    async def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
        """
        Delete a client and related configuration (rules, connections, etc).

        Parameters
        ----------
        id : str
            ID of the client to delete.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        import asyncio

        from auth0 import AsyncAuth0

        client = AsyncAuth0(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.clients.delete(
                id="id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.delete(id, request_options=request_options)
        return _response.data

    async def update(
        self,
        id: str,
        *,
        name: typing.Optional[str] = OMIT,
        description: typing.Optional[str] = OMIT,
        client_secret: typing.Optional[str] = OMIT,
        logo_uri: typing.Optional[str] = OMIT,
        callbacks: typing.Optional[typing.Sequence[str]] = OMIT,
        oidc_logout: typing.Optional[ClientOidcBackchannelLogoutSettings] = OMIT,
        oidc_backchannel_logout: typing.Optional[ClientOidcBackchannelLogoutSettings] = OMIT,
        session_transfer: typing.Optional[ClientSessionTransferConfiguration] = OMIT,
        allowed_origins: typing.Optional[typing.Sequence[str]] = OMIT,
        web_origins: typing.Optional[typing.Sequence[str]] = OMIT,
        grant_types: typing.Optional[typing.Sequence[str]] = OMIT,
        client_aliases: typing.Optional[typing.Sequence[str]] = OMIT,
        allowed_clients: typing.Optional[typing.Sequence[str]] = OMIT,
        allowed_logout_urls: typing.Optional[typing.Sequence[str]] = OMIT,
        jwt_configuration: typing.Optional[ClientJwtConfiguration] = OMIT,
        encryption_key: typing.Optional[ClientEncryptionKey] = OMIT,
        sso: typing.Optional[bool] = OMIT,
        cross_origin_authentication: typing.Optional[bool] = OMIT,
        cross_origin_loc: typing.Optional[str] = OMIT,
        sso_disabled: typing.Optional[bool] = OMIT,
        custom_login_page_on: typing.Optional[bool] = OMIT,
        token_endpoint_auth_method: typing.Optional[ClientTokenEndpointAuthMethodOrNullEnum] = OMIT,
        is_token_endpoint_ip_header_trusted: typing.Optional[bool] = OMIT,
        app_type: typing.Optional[ClientAppTypeEnum] = OMIT,
        is_first_party: typing.Optional[bool] = OMIT,
        oidc_conformant: typing.Optional[bool] = OMIT,
        custom_login_page: typing.Optional[str] = OMIT,
        custom_login_page_preview: typing.Optional[str] = OMIT,
        token_quota: typing.Optional[UpdateTokenQuota] = OMIT,
        identity_assertion_authorization_grant: typing.Optional[UpdateIdentityAssertionAuthorizationGrant] = OMIT,
        form_template: typing.Optional[str] = OMIT,
        addons: typing.Optional[ClientAddons] = OMIT,
        client_metadata: typing.Optional[ClientMetadata] = OMIT,
        mobile: typing.Optional[ClientMobile] = OMIT,
        initiate_login_uri: typing.Optional[str] = OMIT,
        native_social_login: typing.Optional[NativeSocialLoginPatch] = OMIT,
        fedcm_login: typing.Optional[FedCmLoginPatch] = OMIT,
        refresh_token: typing.Optional[ClientRefreshTokenConfiguration] = OMIT,
        default_organization: typing.Optional[ClientDefaultOrganization] = OMIT,
        organization_usage: typing.Optional[ClientOrganizationUsagePatchEnum] = OMIT,
        organization_require_behavior: typing.Optional[ClientOrganizationRequireBehaviorPatchEnum] = OMIT,
        organization_discovery_methods: typing.Optional[typing.Sequence[ClientOrganizationDiscoveryEnum]] = OMIT,
        client_authentication_methods: typing.Optional[ClientAuthenticationMethod] = OMIT,
        require_pushed_authorization_requests: typing.Optional[bool] = OMIT,
        require_proof_of_possession: typing.Optional[bool] = OMIT,
        signed_request_object: typing.Optional[ClientSignedRequestObjectWithCredentialId] = OMIT,
        token_vault_privileged_access: typing.Optional[ClientTokenVaultPrivilegedAccessWithCredentialId] = OMIT,
        compliance_level: typing.Optional[ClientComplianceLevelEnum] = OMIT,
        skip_non_verifiable_callback_uri_confirmation_prompt: typing.Optional[bool] = OMIT,
        token_exchange: typing.Optional[ClientTokenExchangeConfigurationOrNull] = OMIT,
        par_request_expiry: typing.Optional[int] = OMIT,
        express_configuration: typing.Optional[ExpressConfigurationOrNull] = OMIT,
        my_organization_configuration: typing.Optional[ClientMyOrganizationPatchConfiguration] = OMIT,
        async_approval_notification_channels: typing.Optional[
            ClientAsyncApprovalNotificationsChannelsApiPatchConfiguration
        ] = OMIT,
        third_party_security_mode: typing.Optional[ClientThirdPartySecurityModeEnum] = OMIT,
        redirection_policy: typing.Optional[ClientRedirectionPolicyEnum] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> UpdateClientResponseContent:
        """
        Updates a client's settings. For more information, read [Applications in Auth0](https://www.auth0.com/docs/get-started/applications) and [Single Sign-On](https://www.auth0.com/docs/authenticate/single-sign-on).

        Notes:
        - The `client_secret` and `signing_key` attributes can only be updated with the `update:client_keys` scope.
        - The `client_authentication_methods` and `token_endpoint_auth_method` properties are mutually exclusive. Use `client_authentication_methods` to configure the client with Private Key JWT authentication method. Otherwise, use `token_endpoint_auth_method` to configure the client with client secret (basic or post) or with no authentication method (none).
        - When using `client_authentication_methods` to configure the client with Private Key JWT authentication method, only specify the credential IDs that were generated when creating the credentials on the client.
        - To configure `client_authentication_methods`, the `update:client_credentials` scope is required.
        - To configure `client_authentication_methods`, the property `jwt_configuration.alg` must be set to RS256.
        - To change a client's `is_first_party` property to `false`, the `organization_usage` and `organization_require_behavior` properties must be unset.

        Parameters
        ----------
        id : str
            ID of the client to update.

        name : typing.Optional[str]
            The name of the client. Must contain at least one character. Does not allow '<' or '>'.

        description : typing.Optional[str]
            Free text description of the purpose of the Client. (Max character length: <code>140</code>)

        client_secret : typing.Optional[str]
            The secret used to sign tokens for the client

        logo_uri : typing.Optional[str]
            The URL of the client logo (recommended size: 150x150)

        callbacks : typing.Optional[typing.Sequence[str]]
            A set of URLs that are valid to call back from Auth0 when authenticating users

        oidc_logout : typing.Optional[ClientOidcBackchannelLogoutSettings]

        oidc_backchannel_logout : typing.Optional[ClientOidcBackchannelLogoutSettings]
            Configuration for OIDC backchannel logout (deprecated, in favor of oidc_logout)

        session_transfer : typing.Optional[ClientSessionTransferConfiguration]

        allowed_origins : typing.Optional[typing.Sequence[str]]
            A set of URLs that represents valid origins for CORS

        web_origins : typing.Optional[typing.Sequence[str]]
            A set of URLs that represents valid web origins for use with web message response mode

        grant_types : typing.Optional[typing.Sequence[str]]
            A set of grant types that the client is authorized to use. Can include `authorization_code`, `implicit`, `refresh_token`, `client_credentials`, `password`, `http://auth0.com/oauth/grant-type/password-realm`, `http://auth0.com/oauth/grant-type/mfa-oob`, `http://auth0.com/oauth/grant-type/mfa-otp`, `http://auth0.com/oauth/grant-type/mfa-recovery-code`, `urn:openid:params:grant-type:ciba`, `urn:ietf:params:oauth:grant-type:device_code`, and `urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token`.

        client_aliases : typing.Optional[typing.Sequence[str]]
            List of audiences for SAML protocol

        allowed_clients : typing.Optional[typing.Sequence[str]]
            Ids of clients that will be allowed to perform delegation requests. Clients that will be allowed to make delegation request. By default, all your clients will be allowed. This field allows you to specify specific clients

        allowed_logout_urls : typing.Optional[typing.Sequence[str]]
            URLs that are valid to redirect to after logout from Auth0

        jwt_configuration : typing.Optional[ClientJwtConfiguration]
            An object that holds settings related to how JWTs are created

        encryption_key : typing.Optional[ClientEncryptionKey]
            The client's encryption key

        sso : typing.Optional[bool]
            <code>true</code> to use Auth0 instead of the IdP to do Single Sign On, <code>false</code> otherwise (default: <code>false</code>)

        cross_origin_authentication : typing.Optional[bool]
            <code>true</code> if this client can be used to make cross-origin authentication requests, <code>false</code> otherwise if cross origin is disabled

        cross_origin_loc : typing.Optional[str]
            URL for the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page.

        sso_disabled : typing.Optional[bool]
            <code>true</code> to disable Single Sign On, <code>false</code> otherwise (default: <code>false</code>)

        custom_login_page_on : typing.Optional[bool]
            <code>true</code> if the custom login page is to be used, <code>false</code> otherwise.

        token_endpoint_auth_method : typing.Optional[ClientTokenEndpointAuthMethodOrNullEnum]

        is_token_endpoint_ip_header_trusted : typing.Optional[bool]
            If true, trust that the IP specified in the `auth0-forwarded-for` header is the end-user's IP for brute-force-protection on token endpoint.

        app_type : typing.Optional[ClientAppTypeEnum]

        is_first_party : typing.Optional[bool]
            Whether this client a first party client or not

        oidc_conformant : typing.Optional[bool]
            Whether this client will conform to strict OIDC specifications

        custom_login_page : typing.Optional[str]
            The content (HTML, CSS, JS) of the custom login page

        custom_login_page_preview : typing.Optional[str]

        token_quota : typing.Optional[UpdateTokenQuota]

        identity_assertion_authorization_grant : typing.Optional[UpdateIdentityAssertionAuthorizationGrant]

        form_template : typing.Optional[str]
            Form template for WS-Federation protocol

        addons : typing.Optional[ClientAddons]

        client_metadata : typing.Optional[ClientMetadata]

        mobile : typing.Optional[ClientMobile]
            Configuration related to native mobile apps

        initiate_login_uri : typing.Optional[str]
            Initiate login uri, must be https

        native_social_login : typing.Optional[NativeSocialLoginPatch]

        fedcm_login : typing.Optional[FedCmLoginPatch]

        refresh_token : typing.Optional[ClientRefreshTokenConfiguration]

        default_organization : typing.Optional[ClientDefaultOrganization]

        organization_usage : typing.Optional[ClientOrganizationUsagePatchEnum]

        organization_require_behavior : typing.Optional[ClientOrganizationRequireBehaviorPatchEnum]

        organization_discovery_methods : typing.Optional[typing.Sequence[ClientOrganizationDiscoveryEnum]]
            Defines the available methods for organization discovery during the `pre_login_prompt`. Users can discover their organization either by `email`, `organization_name` or both.

        client_authentication_methods : typing.Optional[ClientAuthenticationMethod]

        require_pushed_authorization_requests : typing.Optional[bool]
            Makes the use of Pushed Authorization Requests mandatory for this client

        require_proof_of_possession : typing.Optional[bool]
            Makes the use of Proof-of-Possession mandatory for this client

        signed_request_object : typing.Optional[ClientSignedRequestObjectWithCredentialId]

        token_vault_privileged_access : typing.Optional[ClientTokenVaultPrivilegedAccessWithCredentialId]

        compliance_level : typing.Optional[ClientComplianceLevelEnum]

        skip_non_verifiable_callback_uri_confirmation_prompt : typing.Optional[bool]
            Controls whether a confirmation prompt is shown during login flows when the redirect URI uses non-verifiable callback URIs (for example, a custom URI schema such as `myapp://`, or `localhost`).
            If set to true, a confirmation prompt will not be shown. We recommend that this is set to false for improved protection from malicious apps.
            See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information.

        token_exchange : typing.Optional[ClientTokenExchangeConfigurationOrNull]

        par_request_expiry : typing.Optional[int]
            Specifies how long, in seconds, a Pushed Authorization Request URI remains valid

        express_configuration : typing.Optional[ExpressConfigurationOrNull]

        my_organization_configuration : typing.Optional[ClientMyOrganizationPatchConfiguration]

        async_approval_notification_channels : typing.Optional[ClientAsyncApprovalNotificationsChannelsApiPatchConfiguration]

        third_party_security_mode : typing.Optional[ClientThirdPartySecurityModeEnum]

        redirection_policy : typing.Optional[ClientRedirectionPolicyEnum]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        UpdateClientResponseContent
            Client successfully updated.

        Examples
        --------
        import asyncio

        from auth0 import AsyncAuth0

        client = AsyncAuth0(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.clients.update(
                id="id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.update(
            id,
            name=name,
            description=description,
            client_secret=client_secret,
            logo_uri=logo_uri,
            callbacks=callbacks,
            oidc_logout=oidc_logout,
            oidc_backchannel_logout=oidc_backchannel_logout,
            session_transfer=session_transfer,
            allowed_origins=allowed_origins,
            web_origins=web_origins,
            grant_types=grant_types,
            client_aliases=client_aliases,
            allowed_clients=allowed_clients,
            allowed_logout_urls=allowed_logout_urls,
            jwt_configuration=jwt_configuration,
            encryption_key=encryption_key,
            sso=sso,
            cross_origin_authentication=cross_origin_authentication,
            cross_origin_loc=cross_origin_loc,
            sso_disabled=sso_disabled,
            custom_login_page_on=custom_login_page_on,
            token_endpoint_auth_method=token_endpoint_auth_method,
            is_token_endpoint_ip_header_trusted=is_token_endpoint_ip_header_trusted,
            app_type=app_type,
            is_first_party=is_first_party,
            oidc_conformant=oidc_conformant,
            custom_login_page=custom_login_page,
            custom_login_page_preview=custom_login_page_preview,
            token_quota=token_quota,
            identity_assertion_authorization_grant=identity_assertion_authorization_grant,
            form_template=form_template,
            addons=addons,
            client_metadata=client_metadata,
            mobile=mobile,
            initiate_login_uri=initiate_login_uri,
            native_social_login=native_social_login,
            fedcm_login=fedcm_login,
            refresh_token=refresh_token,
            default_organization=default_organization,
            organization_usage=organization_usage,
            organization_require_behavior=organization_require_behavior,
            organization_discovery_methods=organization_discovery_methods,
            client_authentication_methods=client_authentication_methods,
            require_pushed_authorization_requests=require_pushed_authorization_requests,
            require_proof_of_possession=require_proof_of_possession,
            signed_request_object=signed_request_object,
            token_vault_privileged_access=token_vault_privileged_access,
            compliance_level=compliance_level,
            skip_non_verifiable_callback_uri_confirmation_prompt=skip_non_verifiable_callback_uri_confirmation_prompt,
            token_exchange=token_exchange,
            par_request_expiry=par_request_expiry,
            express_configuration=express_configuration,
            my_organization_configuration=my_organization_configuration,
            async_approval_notification_channels=async_approval_notification_channels,
            third_party_security_mode=third_party_security_mode,
            redirection_policy=redirection_policy,
            request_options=request_options,
        )
        return _response.data

    async def rotate_secret(
        self, id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> RotateClientSecretResponseContent:
        """
        Rotate a client secret.

        This endpoint cannot be used with clients configured with Private Key JWT authentication method (client_authentication_methods configured with private_key_jwt). The generated secret is NOT base64 encoded.

        For more information, read [Rotate Client Secrets](https://www.auth0.com/docs/get-started/applications/rotate-client-secret).

        Parameters
        ----------
        id : str
            ID of the client that will rotate secrets.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        RotateClientSecretResponseContent
            Secret successfully rotated.

        Examples
        --------
        import asyncio

        from auth0 import AsyncAuth0

        client = AsyncAuth0(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.clients.rotate_secret(
                id="id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.rotate_secret(id, request_options=request_options)
        return _response.data

    @property
    def credentials(self):
        if self._credentials is None:
            from .credentials.client import AsyncCredentialsClient  # noqa: E402

            self._credentials = AsyncCredentialsClient(client_wrapper=self._client_wrapper)
        return self._credentials

    @property
    def connections(self):
        if self._connections is None:
            from .connections.client import AsyncConnectionsClient  # noqa: E402

            self._connections = AsyncConnectionsClient(client_wrapper=self._client_wrapper)
        return self._connections
