# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.get_phone_provider_protection_response_content import GetPhoneProviderProtectionResponseContent from ...types.patch_phone_provider_protection_response_content import PatchPhoneProviderProtectionResponseContent from ...types.phone_provider_protection_backoff_strategy_enum import PhoneProviderProtectionBackoffStrategyEnum from .raw_client import AsyncRawPhoneProviderProtectionClient, RawPhoneProviderProtectionClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class PhoneProviderProtectionClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawPhoneProviderProtectionClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawPhoneProviderProtectionClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawPhoneProviderProtectionClient """ return self._raw_client def get( self, *, request_options: typing.Optional[RequestOptions] = None ) -> GetPhoneProviderProtectionResponseContent: """ Get the phone provider protection configuration for a tenant. Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetPhoneProviderProtectionResponseContent Phone provider protection configuration successfully retrieved. Examples -------- from auth0 import Auth0 client = Auth0( token="YOUR_TOKEN", ) client.attack_protection.phone_provider_protection.get() """ _response = self._raw_client.get(request_options=request_options) return _response.data def patch( self, *, type: PhoneProviderProtectionBackoffStrategyEnum, request_options: typing.Optional[RequestOptions] = None, ) -> PatchPhoneProviderProtectionResponseContent: """ Update the phone provider protection configuration for a tenant. Parameters ---------- type : PhoneProviderProtectionBackoffStrategyEnum request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- PatchPhoneProviderProtectionResponseContent Phone provider protection configuration successfully updated. Examples -------- from auth0 import Auth0 client = Auth0( token="YOUR_TOKEN", ) client.attack_protection.phone_provider_protection.patch( type="exponential", ) """ _response = self._raw_client.patch(type=type, request_options=request_options) return _response.data class AsyncPhoneProviderProtectionClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawPhoneProviderProtectionClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawPhoneProviderProtectionClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawPhoneProviderProtectionClient """ return self._raw_client async def get( self, *, request_options: typing.Optional[RequestOptions] = None ) -> GetPhoneProviderProtectionResponseContent: """ Get the phone provider protection configuration for a tenant. Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetPhoneProviderProtectionResponseContent Phone provider protection configuration successfully retrieved. Examples -------- import asyncio from auth0 import AsyncAuth0 client = AsyncAuth0( token="YOUR_TOKEN", ) async def main() -> None: await client.attack_protection.phone_provider_protection.get() asyncio.run(main()) """ _response = await self._raw_client.get(request_options=request_options) return _response.data async def patch( self, *, type: PhoneProviderProtectionBackoffStrategyEnum, request_options: typing.Optional[RequestOptions] = None, ) -> PatchPhoneProviderProtectionResponseContent: """ Update the phone provider protection configuration for a tenant. Parameters ---------- type : PhoneProviderProtectionBackoffStrategyEnum request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- PatchPhoneProviderProtectionResponseContent Phone provider protection configuration successfully updated. Examples -------- import asyncio from auth0 import AsyncAuth0 client = AsyncAuth0( token="YOUR_TOKEN", ) async def main() -> None: await client.attack_protection.phone_provider_protection.patch( type="exponential", ) asyncio.run(main()) """ _response = await self._raw_client.patch(type=type, request_options=request_options) return _response.data