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
  •  
  •  
  •  
4,474 changes: 2,649 additions & 1,825 deletions reference.md

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions src/auth0/management/_default_clients.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This file was auto-generated by Fern from our API Definition.

import typing

import httpx

SDK_DEFAULT_TIMEOUT = 60

try:
import httpx_aiohttp # type: ignore[import-not-found]
except ImportError:

class DefaultAioHttpClient(httpx.AsyncClient): # type: ignore
def __init__(self, **kwargs: typing.Any) -> None:
raise RuntimeError(
"To use the aiohttp client, install the aiohttp extra: pip install auth0-python[aiohttp]"
)

else:

class DefaultAioHttpClient(httpx_aiohttp.HttpxAiohttpClient): # type: ignore
def __init__(self, **kwargs: typing.Any) -> None:
kwargs.setdefault("timeout", SDK_DEFAULT_TIMEOUT)
kwargs.setdefault("follow_redirects", True)
super().__init__(**kwargs)


class DefaultAsyncHttpxClient(httpx.AsyncClient):
def __init__(self, **kwargs: typing.Any) -> None:
kwargs.setdefault("timeout", SDK_DEFAULT_TIMEOUT)
kwargs.setdefault("follow_redirects", True)
super().__init__(**kwargs)
16 changes: 13 additions & 3 deletions src/auth0/management/actions/executions/raw_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from ...core.api_error import ApiError
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ...core.http_response import AsyncHttpResponse, HttpResponse
from ...core.jsonable_encoder import jsonable_encoder
from ...core.jsonable_encoder import encode_path_param
from ...core.parse_error import ParsingError
from ...core.pydantic_utilities import parse_obj_as
from ...core.request_options import RequestOptions
from ...errors.bad_request_error import BadRequestError
Expand All @@ -15,6 +16,7 @@
from ...errors.too_many_requests_error import TooManyRequestsError
from ...errors.unauthorized_error import UnauthorizedError
from ...types.get_action_execution_response_content import GetActionExecutionResponseContent
from pydantic import ValidationError


class RawExecutionsClient:
Expand All @@ -41,7 +43,7 @@ def get(
The execution was retrieved.
"""
_response = self._client_wrapper.httpx_client.request(
f"actions/executions/{jsonable_encoder(id)}",
f"actions/executions/{encode_path_param(id)}",
method="GET",
request_options=request_options,
)
Expand Down Expand Up @@ -113,6 +115,10 @@ def get(
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
except ValidationError as e:
raise ParsingError(
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)


Expand Down Expand Up @@ -140,7 +146,7 @@ async def get(
The execution was retrieved.
"""
_response = await self._client_wrapper.httpx_client.request(
f"actions/executions/{jsonable_encoder(id)}",
f"actions/executions/{encode_path_param(id)}",
method="GET",
request_options=request_options,
)
Expand Down Expand Up @@ -212,4 +218,8 @@ async def get(
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
except ValidationError as e:
raise ParsingError(
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
80 changes: 69 additions & 11 deletions src/auth0/management/actions/modules/raw_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
from ...core.api_error import ApiError
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ...core.http_response import AsyncHttpResponse, HttpResponse
from ...core.jsonable_encoder import jsonable_encoder
from ...core.jsonable_encoder import encode_path_param
from ...core.pagination import AsyncPager, SyncPager
from ...core.parse_error import ParsingError
from ...core.pydantic_utilities import parse_obj_as
from ...core.request_options import RequestOptions
from ...core.serialization import convert_and_respect_annotation_metadata
Expand All @@ -28,6 +29,7 @@
from ...types.get_action_modules_response_content import GetActionModulesResponseContent
from ...types.rollback_action_module_response_content import RollbackActionModuleResponseContent
from ...types.update_action_module_response_content import UpdateActionModuleResponseContent
from pydantic import ValidationError

# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)
Expand Down Expand Up @@ -138,6 +140,10 @@ def list(
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
except ValidationError as e:
raise ParsingError(
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

def create(
Expand Down Expand Up @@ -271,6 +277,10 @@ def create(
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
except ValidationError as e:
raise ParsingError(
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

def get(
Expand All @@ -293,7 +303,7 @@ def get(
The action module was retrieved.
"""
_response = self._client_wrapper.httpx_client.request(
f"actions/modules/{jsonable_encoder(id)}",
f"actions/modules/{encode_path_param(id)}",
method="GET",
request_options=request_options,
)
Expand Down Expand Up @@ -365,6 +375,10 @@ def get(
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
except ValidationError as e:
raise ParsingError(
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]:
Expand All @@ -384,7 +398,7 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] =
HttpResponse[None]
"""
_response = self._client_wrapper.httpx_client.request(
f"actions/modules/{jsonable_encoder(id)}",
f"actions/modules/{encode_path_param(id)}",
method="DELETE",
request_options=request_options,
)
Expand Down Expand Up @@ -460,6 +474,10 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] =
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
except ValidationError as e:
raise ParsingError(
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

def update(
Expand Down Expand Up @@ -497,7 +515,7 @@ def update(
The action module was updated.
"""
_response = self._client_wrapper.httpx_client.request(
f"actions/modules/{jsonable_encoder(id)}",
f"actions/modules/{encode_path_param(id)}",
method="PATCH",
json={
"code": code,
Expand Down Expand Up @@ -593,6 +611,10 @@ def update(
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
except ValidationError as e:
raise ParsingError(
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

def list_actions(
Expand Down Expand Up @@ -628,7 +650,7 @@ def list_actions(
page = page if page is not None else 0

_response = self._client_wrapper.httpx_client.request(
f"actions/modules/{jsonable_encoder(id)}/actions",
f"actions/modules/{encode_path_param(id)}/actions",
method="GET",
params={
"page": page,
Expand Down Expand Up @@ -712,6 +734,10 @@ def list_actions(
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
except ValidationError as e:
raise ParsingError(
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

def rollback(
Expand All @@ -737,7 +763,7 @@ def rollback(
The rollback was successful.
"""
_response = self._client_wrapper.httpx_client.request(
f"actions/modules/{jsonable_encoder(id)}/rollback",
f"actions/modules/{encode_path_param(id)}/rollback",
method="POST",
json={
"module_version_id": module_version_id,
Expand Down Expand Up @@ -827,6 +853,10 @@ def rollback(
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
except ValidationError as e:
raise ParsingError(
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)


Expand Down Expand Up @@ -938,6 +968,10 @@ async def _get_next():
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
except ValidationError as e:
raise ParsingError(
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

async def create(
Expand Down Expand Up @@ -1071,6 +1105,10 @@ async def create(
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
except ValidationError as e:
raise ParsingError(
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

async def get(
Expand All @@ -1093,7 +1131,7 @@ async def get(
The action module was retrieved.
"""
_response = await self._client_wrapper.httpx_client.request(
f"actions/modules/{jsonable_encoder(id)}",
f"actions/modules/{encode_path_param(id)}",
method="GET",
request_options=request_options,
)
Expand Down Expand Up @@ -1165,6 +1203,10 @@ async def get(
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
except ValidationError as e:
raise ParsingError(
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

async def delete(
Expand All @@ -1186,7 +1228,7 @@ async def delete(
AsyncHttpResponse[None]
"""
_response = await self._client_wrapper.httpx_client.request(
f"actions/modules/{jsonable_encoder(id)}",
f"actions/modules/{encode_path_param(id)}",
method="DELETE",
request_options=request_options,
)
Expand Down Expand Up @@ -1262,6 +1304,10 @@ async def delete(
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
except ValidationError as e:
raise ParsingError(
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

async def update(
Expand Down Expand Up @@ -1299,7 +1345,7 @@ async def update(
The action module was updated.
"""
_response = await self._client_wrapper.httpx_client.request(
f"actions/modules/{jsonable_encoder(id)}",
f"actions/modules/{encode_path_param(id)}",
method="PATCH",
json={
"code": code,
Expand Down Expand Up @@ -1395,6 +1441,10 @@ async def update(
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
except ValidationError as e:
raise ParsingError(
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

async def list_actions(
Expand Down Expand Up @@ -1430,7 +1480,7 @@ async def list_actions(
page = page if page is not None else 0

_response = await self._client_wrapper.httpx_client.request(
f"actions/modules/{jsonable_encoder(id)}/actions",
f"actions/modules/{encode_path_param(id)}/actions",
method="GET",
params={
"page": page,
Expand Down Expand Up @@ -1517,6 +1567,10 @@ async def _get_next():
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
except ValidationError as e:
raise ParsingError(
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

async def rollback(
Expand All @@ -1542,7 +1596,7 @@ async def rollback(
The rollback was successful.
"""
_response = await self._client_wrapper.httpx_client.request(
f"actions/modules/{jsonable_encoder(id)}/rollback",
f"actions/modules/{encode_path_param(id)}/rollback",
method="POST",
json={
"module_version_id": module_version_id,
Expand Down Expand Up @@ -1632,4 +1686,8 @@ async def rollback(
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
except ValidationError as e:
raise ParsingError(
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
Loading
Loading