Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5,526 changes: 5,484 additions & 42 deletions .fern/replay.lock

Large diffs are not rendered by default.

945 changes: 934 additions & 11 deletions reference.md

Large diffs are not rendered by default.

1,828 changes: 1,825 additions & 3 deletions src/auth0/management/__init__.py

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions src/auth0/management/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from .log_streams.client import AsyncLogStreamsClient, LogStreamsClient
from .logs.client import AsyncLogsClient, LogsClient
from .network_acls.client import AsyncNetworkAclsClient, NetworkAclsClient
from .organization_templates.client import AsyncOrganizationTemplatesClient, OrganizationTemplatesClient
from .organizations.client import AsyncOrganizationsClient, OrganizationsClient
from .prompts.client import AsyncPromptsClient, PromptsClient
from .rate_limit_policies.client import AsyncRateLimitPoliciesClient, RateLimitPoliciesClient
Expand Down Expand Up @@ -175,6 +176,7 @@ def __init__(
self._log_streams: typing.Optional[LogStreamsClient] = None
self._logs: typing.Optional[LogsClient] = None
self._network_acls: typing.Optional[NetworkAclsClient] = None
self._organization_templates: typing.Optional[OrganizationTemplatesClient] = None
self._organizations: typing.Optional[OrganizationsClient] = None
self._prompts: typing.Optional[PromptsClient] = None
self._rate_limit_policies: typing.Optional[RateLimitPoliciesClient] = None
Expand Down Expand Up @@ -369,6 +371,14 @@ def network_acls(self):
self._network_acls = NetworkAclsClient(client_wrapper=self._client_wrapper)
return self._network_acls

@property
def organization_templates(self):
if self._organization_templates is None:
from .organization_templates.client import OrganizationTemplatesClient # noqa: E402

self._organization_templates = OrganizationTemplatesClient(client_wrapper=self._client_wrapper)
return self._organization_templates

@property
def organizations(self):
if self._organizations is None:
Expand Down Expand Up @@ -708,6 +718,7 @@ def __init__(
self._log_streams: typing.Optional[AsyncLogStreamsClient] = None
self._logs: typing.Optional[AsyncLogsClient] = None
self._network_acls: typing.Optional[AsyncNetworkAclsClient] = None
self._organization_templates: typing.Optional[AsyncOrganizationTemplatesClient] = None
self._organizations: typing.Optional[AsyncOrganizationsClient] = None
self._prompts: typing.Optional[AsyncPromptsClient] = None
self._rate_limit_policies: typing.Optional[AsyncRateLimitPoliciesClient] = None
Expand Down Expand Up @@ -902,6 +913,14 @@ def network_acls(self):
self._network_acls = AsyncNetworkAclsClient(client_wrapper=self._client_wrapper)
return self._network_acls

@property
def organization_templates(self):
if self._organization_templates is None:
from .organization_templates.client import AsyncOrganizationTemplatesClient # noqa: E402

self._organization_templates = AsyncOrganizationTemplatesClient(client_wrapper=self._client_wrapper)
return self._organization_templates

@property
def organizations(self):
if self._organizations is None:
Expand Down
45 changes: 45 additions & 0 deletions src/auth0/management/connections/raw_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from ..errors.not_found_error import NotFoundError
from ..errors.too_many_requests_error import TooManyRequestsError
from ..errors.unauthorized_error import UnauthorizedError
from ..errors.unprocessable_entity_error import UnprocessableEntityError
from ..types.connection_authentication_purpose import ConnectionAuthenticationPurpose
from ..types.connection_connected_accounts_purpose import ConnectionConnectedAccountsPurpose
from ..types.connection_for_list import ConnectionForList
Expand Down Expand Up @@ -350,6 +351,17 @@ def create(
),
),
)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
typing.Any,
parse_obj_as(
type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
)
if _response.status_code == 429:
raise TooManyRequestsError(
headers=dict(_response.headers),
Expand Down Expand Up @@ -723,6 +735,17 @@ def update(
),
),
)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
typing.Any,
parse_obj_as(
type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
)
if _response.status_code == 429:
raise TooManyRequestsError(
headers=dict(_response.headers),
Expand Down Expand Up @@ -1144,6 +1167,17 @@ async def create(
),
),
)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
typing.Any,
parse_obj_as(
type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
)
if _response.status_code == 429:
raise TooManyRequestsError(
headers=dict(_response.headers),
Expand Down Expand Up @@ -1519,6 +1553,17 @@ async def update(
),
),
)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
typing.Any,
parse_obj_as(
type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
)
if _response.status_code == 429:
raise TooManyRequestsError(
headers=dict(_response.headers),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from ...core.request_options import RequestOptions
from ...core.serialization import convert_and_respect_annotation_metadata
from ...errors.bad_request_error import BadRequestError
from ...errors.conflict_error import ConflictError
from ...errors.forbidden_error import ForbiddenError
from ...errors.not_found_error import NotFoundError
from ...errors.too_many_requests_error import TooManyRequestsError
Expand Down Expand Up @@ -274,6 +275,17 @@ def create(
),
),
)
if _response.status_code == 409:
raise ConflictError(
headers=dict(_response.headers),
body=typing.cast(
typing.Any,
parse_obj_as(
type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
Expand Down Expand Up @@ -734,6 +746,17 @@ async def create(
),
),
)
if _response.status_code == 409:
raise ConflictError(
headers=dict(_response.headers),
body=typing.cast(
typing.Any,
parse_obj_as(
type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
Expand Down
11 changes: 0 additions & 11 deletions src/auth0/management/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,7 @@ def __init__(
self._logging = logging

def get_headers(self) -> typing.Dict[str, str]:
py_version = platform.python_version()
version = sys.modules["auth0"].__version__

auth0_client = dumps({
"name": "auth0-python",
"version": version,
"env": {"python": py_version}
}).encode("utf-8")

headers: typing.Dict[str, str] = {
"User-Agent": f"Python/{py_version}",
"Auth0-Client": base64.b64encode(auth0_client).decode(),
**(self.get_custom_headers() or {}),
}
headers["Authorization"] = f"Bearer {self._get_token()}"
Expand Down
3 changes: 3 additions & 0 deletions src/auth0/management/errors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from .service_unavailable_error import ServiceUnavailableError
from .too_many_requests_error import TooManyRequestsError
from .unauthorized_error import UnauthorizedError
from .unprocessable_entity_error import UnprocessableEntityError
_dynamic_imports: typing.Dict[str, str] = {
"BadRequestError": ".bad_request_error",
"ConflictError": ".conflict_error",
Expand All @@ -31,6 +32,7 @@
"ServiceUnavailableError": ".service_unavailable_error",
"TooManyRequestsError": ".too_many_requests_error",
"UnauthorizedError": ".unauthorized_error",
"UnprocessableEntityError": ".unprocessable_entity_error",
}


Expand Down Expand Up @@ -68,4 +70,5 @@ def __dir__():
"ServiceUnavailableError",
"TooManyRequestsError",
"UnauthorizedError",
"UnprocessableEntityError",
]
10 changes: 10 additions & 0 deletions src/auth0/management/errors/unprocessable_entity_error.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file was auto-generated by Fern from our API Definition.

import typing

from ..core.api_error import ApiError


class UnprocessableEntityError(ApiError):
def __init__(self, body: typing.Any, headers: typing.Optional[typing.Dict[str, str]] = None):
super().__init__(status_code=422, headers=headers, body=body)
68 changes: 68 additions & 0 deletions src/auth0/management/keys/network_acls/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,36 @@ def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = Non
_response = self._raw_client.get(id, request_options=request_options)
return _response.data

def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
"""
Delete a key used to verify HTTP Message Signatures on Network ACL rules

Parameters
----------
id : str
ID of the Network ACL Key to delete.

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

Returns
-------
None

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

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


class AsyncNetworkAclsClient:
def __init__(self, *, client_wrapper: AsyncClientWrapper):
Expand Down Expand Up @@ -274,3 +304,41 @@ async def main() -> None:
"""
_response = await self._raw_client.get(id, request_options=request_options)
return _response.data

async def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
"""
Delete a key used to verify HTTP Message Signatures on Network ACL rules

Parameters
----------
id : str
ID of the Network ACL Key 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.keys.network_acls.delete(
id="id",
)


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