regenerate ory-hydra-client

This commit is contained in:
TuxCoder 2023-01-13 15:52:38 +01:00
parent 1947a6f24a
commit cba6cb75e5
93 changed files with 3705 additions and 1430 deletions

View file

@ -1,12 +1,16 @@
from typing import Any, Dict, Optional, Union
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...models.accept_consent_request import AcceptConsentRequest
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from typing import Dict
from typing import cast
from ...models.completed_request import CompletedRequest
from ...models.generic_error import GenericError
from ...types import UNSET, Response
from ...models.accept_consent_request import AcceptConsentRequest
def _get_kwargs(
@ -14,21 +18,34 @@ def _get_kwargs(
_client: Client,
json_body: AcceptConsentRequest,
consent_challenge: str,
) -> Dict[str, Any]:
url = "{}/oauth2/auth/requests/consent/accept".format(_client.base_url)
url = "{}/oauth2/auth/requests/consent/accept".format(
_client.base_url)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
params: Dict[str, Any] = {}
params["consent_challenge"] = consent_challenge
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
json_json_body = json_body.to_dict()
return {
"method": "put",
"method": "put",
"url": url,
"headers": headers,
"cookies": cookies,
@ -39,17 +56,23 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[CompletedRequest, GenericError]]:
if response.status_code == 200:
if response.status_code == HTTPStatus.OK:
response_200 = CompletedRequest.from_dict(response.json())
return response_200
if response.status_code == 404:
if response.status_code == HTTPStatus.NOT_FOUND:
response_404 = GenericError.from_dict(response.json())
return response_404
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -68,6 +91,7 @@ def sync_detailed(
_client: Client,
json_body: AcceptConsentRequest,
consent_challenge: str,
) -> Response[Union[CompletedRequest, GenericError]]:
"""Accept a Consent Request
@ -105,10 +129,12 @@ def sync_detailed(
Response[Union[CompletedRequest, GenericError]]
"""
kwargs = _get_kwargs(
_client=_client,
json_body=json_body,
consent_challenge=consent_challenge,
json_body=json_body,
consent_challenge=consent_challenge,
)
response = httpx.request(
@ -118,12 +144,12 @@ def sync_detailed(
return _build_response(response=response)
def sync(
*,
_client: Client,
json_body: AcceptConsentRequest,
consent_challenge: str,
) -> Optional[Union[CompletedRequest, GenericError]]:
"""Accept a Consent Request
@ -161,18 +187,20 @@ def sync(
Response[Union[CompletedRequest, GenericError]]
"""
return sync_detailed(
_client=_client,
json_body=json_body,
consent_challenge=consent_challenge,
).parsed
json_body=json_body,
consent_challenge=consent_challenge,
).parsed
async def asyncio_detailed(
*,
_client: Client,
json_body: AcceptConsentRequest,
consent_challenge: str,
) -> Response[Union[CompletedRequest, GenericError]]:
"""Accept a Consent Request
@ -210,23 +238,27 @@ async def asyncio_detailed(
Response[Union[CompletedRequest, GenericError]]
"""
kwargs = _get_kwargs(
_client=_client,
json_body=json_body,
consent_challenge=consent_challenge,
json_body=json_body,
consent_challenge=consent_challenge,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
*,
_client: Client,
json_body: AcceptConsentRequest,
consent_challenge: str,
) -> Optional[Union[CompletedRequest, GenericError]]:
"""Accept a Consent Request
@ -264,10 +296,11 @@ async def asyncio(
Response[Union[CompletedRequest, GenericError]]
"""
return (
await asyncio_detailed(
_client=_client,
json_body=json_body,
consent_challenge=consent_challenge,
)
).parsed
return (await asyncio_detailed(
_client=_client,
json_body=json_body,
consent_challenge=consent_challenge,
)).parsed

View file

@ -1,12 +1,16 @@
from typing import Any, Dict, Optional, Union
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...models.accept_login_request import AcceptLoginRequest
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from typing import Dict
from typing import cast
from ...models.completed_request import CompletedRequest
from ...models.generic_error import GenericError
from ...types import UNSET, Response
from ...models.accept_login_request import AcceptLoginRequest
def _get_kwargs(
@ -14,21 +18,34 @@ def _get_kwargs(
_client: Client,
json_body: AcceptLoginRequest,
login_challenge: str,
) -> Dict[str, Any]:
url = "{}/oauth2/auth/requests/login/accept".format(_client.base_url)
url = "{}/oauth2/auth/requests/login/accept".format(
_client.base_url)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
params: Dict[str, Any] = {}
params["login_challenge"] = login_challenge
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
json_json_body = json_body.to_dict()
return {
"method": "put",
"method": "put",
"url": url,
"headers": headers,
"cookies": cookies,
@ -39,25 +56,35 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[CompletedRequest, GenericError]]:
if response.status_code == 200:
if response.status_code == HTTPStatus.OK:
response_200 = CompletedRequest.from_dict(response.json())
return response_200
if response.status_code == 400:
if response.status_code == HTTPStatus.BAD_REQUEST:
response_400 = GenericError.from_dict(response.json())
return response_400
if response.status_code == 401:
if response.status_code == HTTPStatus.UNAUTHORIZED:
response_401 = GenericError.from_dict(response.json())
return response_401
if response.status_code == 404:
if response.status_code == HTTPStatus.NOT_FOUND:
response_404 = GenericError.from_dict(response.json())
return response_404
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -76,6 +103,7 @@ def sync_detailed(
_client: Client,
json_body: AcceptLoginRequest,
login_challenge: str,
) -> Response[Union[CompletedRequest, GenericError]]:
"""Accept a Login Request
@ -108,10 +136,12 @@ def sync_detailed(
Response[Union[CompletedRequest, GenericError]]
"""
kwargs = _get_kwargs(
_client=_client,
json_body=json_body,
login_challenge=login_challenge,
json_body=json_body,
login_challenge=login_challenge,
)
response = httpx.request(
@ -121,12 +151,12 @@ def sync_detailed(
return _build_response(response=response)
def sync(
*,
_client: Client,
json_body: AcceptLoginRequest,
login_challenge: str,
) -> Optional[Union[CompletedRequest, GenericError]]:
"""Accept a Login Request
@ -159,18 +189,20 @@ def sync(
Response[Union[CompletedRequest, GenericError]]
"""
return sync_detailed(
_client=_client,
json_body=json_body,
login_challenge=login_challenge,
).parsed
json_body=json_body,
login_challenge=login_challenge,
).parsed
async def asyncio_detailed(
*,
_client: Client,
json_body: AcceptLoginRequest,
login_challenge: str,
) -> Response[Union[CompletedRequest, GenericError]]:
"""Accept a Login Request
@ -203,23 +235,27 @@ async def asyncio_detailed(
Response[Union[CompletedRequest, GenericError]]
"""
kwargs = _get_kwargs(
_client=_client,
json_body=json_body,
login_challenge=login_challenge,
json_body=json_body,
login_challenge=login_challenge,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
*,
_client: Client,
json_body: AcceptLoginRequest,
login_challenge: str,
) -> Optional[Union[CompletedRequest, GenericError]]:
"""Accept a Login Request
@ -252,10 +288,11 @@ async def asyncio(
Response[Union[CompletedRequest, GenericError]]
"""
return (
await asyncio_detailed(
_client=_client,
json_body=json_body,
login_challenge=login_challenge,
)
).parsed
return (await asyncio_detailed(
_client=_client,
json_body=json_body,
login_challenge=login_challenge,
)).parsed

View file

@ -1,30 +1,47 @@
from typing import Any, Dict, Optional, Union
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...models.completed_request import CompletedRequest
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ...models.generic_error import GenericError
from ...types import UNSET, Response
from typing import cast
from ...models.completed_request import CompletedRequest
from typing import Dict
def _get_kwargs(
*,
_client: Client,
logout_challenge: str,
) -> Dict[str, Any]:
url = "{}/oauth2/auth/requests/logout/accept".format(_client.base_url)
url = "{}/oauth2/auth/requests/logout/accept".format(
_client.base_url)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
params: Dict[str, Any] = {}
params["logout_challenge"] = logout_challenge
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
return {
"method": "put",
"method": "put",
"url": url,
"headers": headers,
"cookies": cookies,
@ -34,17 +51,23 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[CompletedRequest, GenericError]]:
if response.status_code == 200:
if response.status_code == HTTPStatus.OK:
response_200 = CompletedRequest.from_dict(response.json())
return response_200
if response.status_code == 404:
if response.status_code == HTTPStatus.NOT_FOUND:
response_404 = GenericError.from_dict(response.json())
return response_404
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -62,6 +85,7 @@ def sync_detailed(
*,
_client: Client,
logout_challenge: str,
) -> Response[Union[CompletedRequest, GenericError]]:
"""Accept a Logout Request
@ -78,9 +102,11 @@ def sync_detailed(
Response[Union[CompletedRequest, GenericError]]
"""
kwargs = _get_kwargs(
_client=_client,
logout_challenge=logout_challenge,
logout_challenge=logout_challenge,
)
response = httpx.request(
@ -90,11 +116,11 @@ def sync_detailed(
return _build_response(response=response)
def sync(
*,
_client: Client,
logout_challenge: str,
) -> Optional[Union[CompletedRequest, GenericError]]:
"""Accept a Logout Request
@ -111,16 +137,18 @@ def sync(
Response[Union[CompletedRequest, GenericError]]
"""
return sync_detailed(
_client=_client,
logout_challenge=logout_challenge,
).parsed
logout_challenge=logout_challenge,
).parsed
async def asyncio_detailed(
*,
_client: Client,
logout_challenge: str,
) -> Response[Union[CompletedRequest, GenericError]]:
"""Accept a Logout Request
@ -137,21 +165,25 @@ async def asyncio_detailed(
Response[Union[CompletedRequest, GenericError]]
"""
kwargs = _get_kwargs(
_client=_client,
logout_challenge=logout_challenge,
logout_challenge=logout_challenge,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
*,
_client: Client,
logout_challenge: str,
) -> Optional[Union[CompletedRequest, GenericError]]:
"""Accept a Logout Request
@ -168,9 +200,10 @@ async def asyncio(
Response[Union[CompletedRequest, GenericError]]
"""
return (
await asyncio_detailed(
_client=_client,
logout_challenge=logout_challenge,
)
).parsed
return (await asyncio_detailed(
_client=_client,
logout_challenge=logout_challenge,
)).parsed

View file

@ -1,12 +1,16 @@
from typing import Any, Dict, Optional, Union
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from typing import Dict
from typing import cast
from ...models.generic_error import GenericError
from ...models.json_web_key_set import JSONWebKeySet
from ...models.json_web_key_set_generator_request import JsonWebKeySetGeneratorRequest
from ...types import Response
def _get_kwargs(
@ -14,16 +18,28 @@ def _get_kwargs(
*,
_client: Client,
json_body: JsonWebKeySetGeneratorRequest,
) -> Dict[str, Any]:
url = "{}/keys/{set}".format(_client.base_url, set=set_)
url = "{}/keys/{set}".format(
_client.base_url,set=set_)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
json_json_body = json_body.to_dict()
return {
"method": "post",
"method": "post",
"url": url,
"headers": headers,
"cookies": cookies,
@ -33,21 +49,29 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, JSONWebKeySet]]:
if response.status_code == 201:
if response.status_code == HTTPStatus.CREATED:
response_201 = JSONWebKeySet.from_dict(response.json())
return response_201
if response.status_code == 401:
if response.status_code == HTTPStatus.UNAUTHORIZED:
response_401 = GenericError.from_dict(response.json())
return response_401
if response.status_code == 403:
if response.status_code == HTTPStatus.FORBIDDEN:
response_403 = GenericError.from_dict(response.json())
return response_403
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -66,6 +90,7 @@ def sync_detailed(
*,
_client: Client,
json_body: JsonWebKeySetGeneratorRequest,
) -> Response[Union[GenericError, JSONWebKeySet]]:
"""Generate a New JSON Web Key
@ -87,10 +112,12 @@ def sync_detailed(
Response[Union[GenericError, JSONWebKeySet]]
"""
kwargs = _get_kwargs(
set_=set_,
_client=_client,
json_body=json_body,
_client=_client,
json_body=json_body,
)
response = httpx.request(
@ -100,12 +127,12 @@ def sync_detailed(
return _build_response(response=response)
def sync(
set_: str,
*,
_client: Client,
json_body: JsonWebKeySetGeneratorRequest,
) -> Optional[Union[GenericError, JSONWebKeySet]]:
"""Generate a New JSON Web Key
@ -127,18 +154,20 @@ def sync(
Response[Union[GenericError, JSONWebKeySet]]
"""
return sync_detailed(
set_=set_,
_client=_client,
json_body=json_body,
).parsed
_client=_client,
json_body=json_body,
).parsed
async def asyncio_detailed(
set_: str,
*,
_client: Client,
json_body: JsonWebKeySetGeneratorRequest,
) -> Response[Union[GenericError, JSONWebKeySet]]:
"""Generate a New JSON Web Key
@ -160,23 +189,27 @@ async def asyncio_detailed(
Response[Union[GenericError, JSONWebKeySet]]
"""
kwargs = _get_kwargs(
set_=set_,
_client=_client,
json_body=json_body,
_client=_client,
json_body=json_body,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
set_: str,
*,
_client: Client,
json_body: JsonWebKeySetGeneratorRequest,
) -> Optional[Union[GenericError, JSONWebKeySet]]:
"""Generate a New JSON Web Key
@ -198,10 +231,11 @@ async def asyncio(
Response[Union[GenericError, JSONWebKeySet]]
"""
return (
await asyncio_detailed(
set_=set_,
_client=_client,
json_body=json_body,
)
).parsed
return (await asyncio_detailed(
set_=set_,
_client=_client,
json_body=json_body,
)).parsed

View file

@ -1,27 +1,43 @@
from typing import Any, Dict, Optional, Union
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ...models.generic_error import GenericError
from typing import cast
from ...models.o_auth_2_client import OAuth2Client
from ...types import Response
from typing import Dict
def _get_kwargs(
*,
_client: Client,
json_body: OAuth2Client,
) -> Dict[str, Any]:
url = "{}/clients".format(_client.base_url)
url = "{}/clients".format(
_client.base_url)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
json_json_body = json_body.to_dict()
return {
"method": "post",
"method": "post",
"url": url,
"headers": headers,
"cookies": cookies,
@ -31,21 +47,29 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, OAuth2Client]]:
if response.status_code == 201:
if response.status_code == HTTPStatus.CREATED:
response_201 = OAuth2Client.from_dict(response.json())
return response_201
if response.status_code == 400:
if response.status_code == HTTPStatus.BAD_REQUEST:
response_400 = GenericError.from_dict(response.json())
return response_400
if response.status_code == 409:
if response.status_code == HTTPStatus.CONFLICT:
response_409 = GenericError.from_dict(response.json())
return response_409
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -63,6 +87,7 @@ def sync_detailed(
*,
_client: Client,
json_body: OAuth2Client,
) -> Response[Union[GenericError, OAuth2Client]]:
"""Create an OAuth 2.0 Client
@ -82,9 +107,11 @@ def sync_detailed(
Response[Union[GenericError, OAuth2Client]]
"""
kwargs = _get_kwargs(
_client=_client,
json_body=json_body,
json_body=json_body,
)
response = httpx.request(
@ -94,11 +121,11 @@ def sync_detailed(
return _build_response(response=response)
def sync(
*,
_client: Client,
json_body: OAuth2Client,
) -> Optional[Union[GenericError, OAuth2Client]]:
"""Create an OAuth 2.0 Client
@ -118,16 +145,18 @@ def sync(
Response[Union[GenericError, OAuth2Client]]
"""
return sync_detailed(
_client=_client,
json_body=json_body,
).parsed
json_body=json_body,
).parsed
async def asyncio_detailed(
*,
_client: Client,
json_body: OAuth2Client,
) -> Response[Union[GenericError, OAuth2Client]]:
"""Create an OAuth 2.0 Client
@ -147,21 +176,25 @@ async def asyncio_detailed(
Response[Union[GenericError, OAuth2Client]]
"""
kwargs = _get_kwargs(
_client=_client,
json_body=json_body,
json_body=json_body,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
*,
_client: Client,
json_body: OAuth2Client,
) -> Optional[Union[GenericError, OAuth2Client]]:
"""Create an OAuth 2.0 Client
@ -181,9 +214,10 @@ async def asyncio(
Response[Union[GenericError, OAuth2Client]]
"""
return (
await asyncio_detailed(
_client=_client,
json_body=json_body,
)
).parsed
return (await asyncio_detailed(
_client=_client,
json_body=json_body,
)).parsed

View file

@ -1,10 +1,14 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ...models.generic_error import GenericError
from ...types import Response
from typing import cast
from typing import Dict
def _get_kwargs(
@ -12,14 +16,26 @@ def _get_kwargs(
kid: str,
*,
_client: Client,
) -> Dict[str, Any]:
url = "{}/keys/{set}/{kid}".format(_client.base_url, set=set_, kid=kid)
url = "{}/keys/{set}/{kid}".format(
_client.base_url,set=set_,kid=kid)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
return {
"method": "delete",
"method": "delete",
"url": url,
"headers": headers,
"cookies": cookies,
@ -28,20 +44,26 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, GenericError]]:
if response.status_code == 204:
if response.status_code == HTTPStatus.NO_CONTENT:
response_204 = cast(Any, None)
return response_204
if response.status_code == 401:
if response.status_code == HTTPStatus.UNAUTHORIZED:
response_401 = GenericError.from_dict(response.json())
return response_401
if response.status_code == 403:
if response.status_code == HTTPStatus.FORBIDDEN:
response_403 = GenericError.from_dict(response.json())
return response_403
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -60,6 +82,7 @@ def sync_detailed(
kid: str,
*,
_client: Client,
) -> Response[Union[Any, GenericError]]:
"""Delete a JSON Web Key
@ -79,10 +102,12 @@ def sync_detailed(
Response[Union[Any, GenericError]]
"""
kwargs = _get_kwargs(
set_=set_,
kid=kid,
_client=_client,
kid=kid,
_client=_client,
)
response = httpx.request(
@ -92,12 +117,12 @@ def sync_detailed(
return _build_response(response=response)
def sync(
set_: str,
kid: str,
*,
_client: Client,
) -> Optional[Union[Any, GenericError]]:
"""Delete a JSON Web Key
@ -117,18 +142,20 @@ def sync(
Response[Union[Any, GenericError]]
"""
return sync_detailed(
set_=set_,
kid=kid,
_client=_client,
).parsed
kid=kid,
_client=_client,
).parsed
async def asyncio_detailed(
set_: str,
kid: str,
*,
_client: Client,
) -> Response[Union[Any, GenericError]]:
"""Delete a JSON Web Key
@ -148,23 +175,27 @@ async def asyncio_detailed(
Response[Union[Any, GenericError]]
"""
kwargs = _get_kwargs(
set_=set_,
kid=kid,
_client=_client,
kid=kid,
_client=_client,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
set_: str,
kid: str,
*,
_client: Client,
) -> Optional[Union[Any, GenericError]]:
"""Delete a JSON Web Key
@ -184,10 +215,11 @@ async def asyncio(
Response[Union[Any, GenericError]]
"""
return (
await asyncio_detailed(
set_=set_,
kid=kid,
_client=_client,
)
).parsed
return (await asyncio_detailed(
set_=set_,
kid=kid,
_client=_client,
)).parsed

View file

@ -1,24 +1,40 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ...models.generic_error import GenericError
from ...types import Response
from typing import cast
from typing import Dict
def _get_kwargs(
set_: str,
*,
_client: Client,
) -> Dict[str, Any]:
url = "{}/keys/{set}".format(_client.base_url, set=set_)
url = "{}/keys/{set}".format(
_client.base_url,set=set_)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
return {
"method": "delete",
"method": "delete",
"url": url,
"headers": headers,
"cookies": cookies,
@ -27,20 +43,26 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, GenericError]]:
if response.status_code == 204:
if response.status_code == HTTPStatus.NO_CONTENT:
response_204 = cast(Any, None)
return response_204
if response.status_code == 401:
if response.status_code == HTTPStatus.UNAUTHORIZED:
response_401 = GenericError.from_dict(response.json())
return response_401
if response.status_code == 403:
if response.status_code == HTTPStatus.FORBIDDEN:
response_403 = GenericError.from_dict(response.json())
return response_403
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -58,6 +80,7 @@ def sync_detailed(
set_: str,
*,
_client: Client,
) -> Response[Union[Any, GenericError]]:
"""Delete a JSON Web Key Set
@ -76,9 +99,11 @@ def sync_detailed(
Response[Union[Any, GenericError]]
"""
kwargs = _get_kwargs(
set_=set_,
_client=_client,
_client=_client,
)
response = httpx.request(
@ -88,11 +113,11 @@ def sync_detailed(
return _build_response(response=response)
def sync(
set_: str,
*,
_client: Client,
) -> Optional[Union[Any, GenericError]]:
"""Delete a JSON Web Key Set
@ -111,16 +136,18 @@ def sync(
Response[Union[Any, GenericError]]
"""
return sync_detailed(
set_=set_,
_client=_client,
).parsed
_client=_client,
).parsed
async def asyncio_detailed(
set_: str,
*,
_client: Client,
) -> Response[Union[Any, GenericError]]:
"""Delete a JSON Web Key Set
@ -139,21 +166,25 @@ async def asyncio_detailed(
Response[Union[Any, GenericError]]
"""
kwargs = _get_kwargs(
set_=set_,
_client=_client,
_client=_client,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
set_: str,
*,
_client: Client,
) -> Optional[Union[Any, GenericError]]:
"""Delete a JSON Web Key Set
@ -172,9 +203,10 @@ async def asyncio(
Response[Union[Any, GenericError]]
"""
return (
await asyncio_detailed(
set_=set_,
_client=_client,
)
).parsed
return (await asyncio_detailed(
set_=set_,
_client=_client,
)).parsed

View file

@ -1,24 +1,40 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ...models.generic_error import GenericError
from ...types import Response
from typing import cast
from typing import Dict
def _get_kwargs(
id: str,
*,
_client: Client,
) -> Dict[str, Any]:
url = "{}/clients/{id}".format(_client.base_url, id=id)
url = "{}/clients/{id}".format(
_client.base_url,id=id)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
return {
"method": "delete",
"method": "delete",
"url": url,
"headers": headers,
"cookies": cookies,
@ -27,16 +43,20 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, GenericError]]:
if response.status_code == 204:
if response.status_code == HTTPStatus.NO_CONTENT:
response_204 = cast(Any, None)
return response_204
if response.status_code == 404:
if response.status_code == HTTPStatus.NOT_FOUND:
response_404 = GenericError.from_dict(response.json())
return response_404
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -54,6 +74,7 @@ def sync_detailed(
id: str,
*,
_client: Client,
) -> Response[Union[Any, GenericError]]:
"""Deletes an OAuth 2.0 Client
@ -71,9 +92,11 @@ def sync_detailed(
Response[Union[Any, GenericError]]
"""
kwargs = _get_kwargs(
id=id,
_client=_client,
_client=_client,
)
response = httpx.request(
@ -83,11 +106,11 @@ def sync_detailed(
return _build_response(response=response)
def sync(
id: str,
*,
_client: Client,
) -> Optional[Union[Any, GenericError]]:
"""Deletes an OAuth 2.0 Client
@ -105,16 +128,18 @@ def sync(
Response[Union[Any, GenericError]]
"""
return sync_detailed(
id=id,
_client=_client,
).parsed
_client=_client,
).parsed
async def asyncio_detailed(
id: str,
*,
_client: Client,
) -> Response[Union[Any, GenericError]]:
"""Deletes an OAuth 2.0 Client
@ -132,21 +157,25 @@ async def asyncio_detailed(
Response[Union[Any, GenericError]]
"""
kwargs = _get_kwargs(
id=id,
_client=_client,
_client=_client,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
id: str,
*,
_client: Client,
) -> Optional[Union[Any, GenericError]]:
"""Deletes an OAuth 2.0 Client
@ -164,9 +193,10 @@ async def asyncio(
Response[Union[Any, GenericError]]
"""
return (
await asyncio_detailed(
id=id,
_client=_client,
)
).parsed
return (await asyncio_detailed(
id=id,
_client=_client,
)).parsed

View file

@ -1,29 +1,46 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ...models.generic_error import GenericError
from ...types import UNSET, Response
from typing import cast
from typing import Dict
def _get_kwargs(
*,
_client: Client,
client_id: str,
) -> Dict[str, Any]:
url = "{}/oauth2/tokens".format(_client.base_url)
url = "{}/oauth2/tokens".format(
_client.base_url)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
params: Dict[str, Any] = {}
params["client_id"] = client_id
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
return {
"method": "delete",
"method": "delete",
"url": url,
"headers": headers,
"cookies": cookies,
@ -33,16 +50,20 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, GenericError]]:
if response.status_code == 204:
if response.status_code == HTTPStatus.NO_CONTENT:
response_204 = cast(Any, None)
return response_204
if response.status_code == 401:
if response.status_code == HTTPStatus.UNAUTHORIZED:
response_401 = GenericError.from_dict(response.json())
return response_401
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -60,6 +81,7 @@ def sync_detailed(
*,
_client: Client,
client_id: str,
) -> Response[Union[Any, GenericError]]:
"""Delete OAuth2 Access Tokens from a Client
@ -72,9 +94,11 @@ def sync_detailed(
Response[Union[Any, GenericError]]
"""
kwargs = _get_kwargs(
_client=_client,
client_id=client_id,
client_id=client_id,
)
response = httpx.request(
@ -84,11 +108,11 @@ def sync_detailed(
return _build_response(response=response)
def sync(
*,
_client: Client,
client_id: str,
) -> Optional[Union[Any, GenericError]]:
"""Delete OAuth2 Access Tokens from a Client
@ -101,16 +125,18 @@ def sync(
Response[Union[Any, GenericError]]
"""
return sync_detailed(
_client=_client,
client_id=client_id,
).parsed
client_id=client_id,
).parsed
async def asyncio_detailed(
*,
_client: Client,
client_id: str,
) -> Response[Union[Any, GenericError]]:
"""Delete OAuth2 Access Tokens from a Client
@ -123,21 +149,25 @@ async def asyncio_detailed(
Response[Union[Any, GenericError]]
"""
kwargs = _get_kwargs(
_client=_client,
client_id=client_id,
client_id=client_id,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
*,
_client: Client,
client_id: str,
) -> Optional[Union[Any, GenericError]]:
"""Delete OAuth2 Access Tokens from a Client
@ -150,9 +180,10 @@ async def asyncio(
Response[Union[Any, GenericError]]
"""
return (
await asyncio_detailed(
_client=_client,
client_id=client_id,
)
).parsed
return (await asyncio_detailed(
_client=_client,
client_id=client_id,
)).parsed

View file

@ -1,27 +1,43 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ...models.flush_inactive_o_auth_2_tokens_request import FlushInactiveOAuth2TokensRequest
from ...models.generic_error import GenericError
from ...types import Response
from typing import cast
from typing import Dict
def _get_kwargs(
*,
_client: Client,
json_body: FlushInactiveOAuth2TokensRequest,
) -> Dict[str, Any]:
url = "{}/oauth2/flush".format(_client.base_url)
url = "{}/oauth2/flush".format(
_client.base_url)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
json_json_body = json_body.to_dict()
return {
"method": "post",
"method": "post",
"url": url,
"headers": headers,
"cookies": cookies,
@ -31,16 +47,20 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, GenericError]]:
if response.status_code == 204:
if response.status_code == HTTPStatus.NO_CONTENT:
response_204 = cast(Any, None)
return response_204
if response.status_code == 401:
if response.status_code == HTTPStatus.UNAUTHORIZED:
response_401 = GenericError.from_dict(response.json())
return response_401
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -58,6 +78,7 @@ def sync_detailed(
*,
_client: Client,
json_body: FlushInactiveOAuth2TokensRequest,
) -> Response[Union[Any, GenericError]]:
"""Flush Expired OAuth2 Access Tokens
@ -74,9 +95,11 @@ def sync_detailed(
Response[Union[Any, GenericError]]
"""
kwargs = _get_kwargs(
_client=_client,
json_body=json_body,
json_body=json_body,
)
response = httpx.request(
@ -86,11 +109,11 @@ def sync_detailed(
return _build_response(response=response)
def sync(
*,
_client: Client,
json_body: FlushInactiveOAuth2TokensRequest,
) -> Optional[Union[Any, GenericError]]:
"""Flush Expired OAuth2 Access Tokens
@ -107,16 +130,18 @@ def sync(
Response[Union[Any, GenericError]]
"""
return sync_detailed(
_client=_client,
json_body=json_body,
).parsed
json_body=json_body,
).parsed
async def asyncio_detailed(
*,
_client: Client,
json_body: FlushInactiveOAuth2TokensRequest,
) -> Response[Union[Any, GenericError]]:
"""Flush Expired OAuth2 Access Tokens
@ -133,21 +158,25 @@ async def asyncio_detailed(
Response[Union[Any, GenericError]]
"""
kwargs = _get_kwargs(
_client=_client,
json_body=json_body,
json_body=json_body,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
*,
_client: Client,
json_body: FlushInactiveOAuth2TokensRequest,
) -> Optional[Union[Any, GenericError]]:
"""Flush Expired OAuth2 Access Tokens
@ -164,9 +193,10 @@ async def asyncio(
Response[Union[Any, GenericError]]
"""
return (
await asyncio_detailed(
_client=_client,
json_body=json_body,
)
).parsed
return (await asyncio_detailed(
_client=_client,
json_body=json_body,
)).parsed

View file

@ -1,30 +1,47 @@
from typing import Any, Dict, Optional, Union
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...models.consent_request import ConsentRequest
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ...models.generic_error import GenericError
from ...types import UNSET, Response
from ...models.consent_request import ConsentRequest
from typing import cast
from typing import Dict
def _get_kwargs(
*,
_client: Client,
consent_challenge: str,
) -> Dict[str, Any]:
url = "{}/oauth2/auth/requests/consent".format(_client.base_url)
url = "{}/oauth2/auth/requests/consent".format(
_client.base_url)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
params: Dict[str, Any] = {}
params["consent_challenge"] = consent_challenge
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
return {
"method": "get",
"method": "get",
"url": url,
"headers": headers,
"cookies": cookies,
@ -34,21 +51,29 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[ConsentRequest, GenericError]]:
if response.status_code == 200:
if response.status_code == HTTPStatus.OK:
response_200 = ConsentRequest.from_dict(response.json())
return response_200
if response.status_code == 404:
if response.status_code == HTTPStatus.NOT_FOUND:
response_404 = GenericError.from_dict(response.json())
return response_404
if response.status_code == 409:
if response.status_code == HTTPStatus.CONFLICT:
response_409 = GenericError.from_dict(response.json())
return response_409
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -66,6 +91,7 @@ def sync_detailed(
*,
_client: Client,
consent_challenge: str,
) -> Response[Union[ConsentRequest, GenericError]]:
"""Get Consent Request Information
@ -94,9 +120,11 @@ def sync_detailed(
Response[Union[ConsentRequest, GenericError]]
"""
kwargs = _get_kwargs(
_client=_client,
consent_challenge=consent_challenge,
consent_challenge=consent_challenge,
)
response = httpx.request(
@ -106,11 +134,11 @@ def sync_detailed(
return _build_response(response=response)
def sync(
*,
_client: Client,
consent_challenge: str,
) -> Optional[Union[ConsentRequest, GenericError]]:
"""Get Consent Request Information
@ -139,16 +167,18 @@ def sync(
Response[Union[ConsentRequest, GenericError]]
"""
return sync_detailed(
_client=_client,
consent_challenge=consent_challenge,
).parsed
consent_challenge=consent_challenge,
).parsed
async def asyncio_detailed(
*,
_client: Client,
consent_challenge: str,
) -> Response[Union[ConsentRequest, GenericError]]:
"""Get Consent Request Information
@ -177,21 +207,25 @@ async def asyncio_detailed(
Response[Union[ConsentRequest, GenericError]]
"""
kwargs = _get_kwargs(
_client=_client,
consent_challenge=consent_challenge,
consent_challenge=consent_challenge,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
*,
_client: Client,
consent_challenge: str,
) -> Optional[Union[ConsentRequest, GenericError]]:
"""Get Consent Request Information
@ -220,9 +254,10 @@ async def asyncio(
Response[Union[ConsentRequest, GenericError]]
"""
return (
await asyncio_detailed(
_client=_client,
consent_challenge=consent_challenge,
)
).parsed
return (await asyncio_detailed(
_client=_client,
consent_challenge=consent_challenge,
)).parsed

View file

@ -1,11 +1,15 @@
from typing import Any, Dict, Optional, Union
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ...models.generic_error import GenericError
from ...models.json_web_key_set import JSONWebKeySet
from ...types import Response
from typing import cast
from typing import Dict
def _get_kwargs(
@ -13,14 +17,26 @@ def _get_kwargs(
kid: str,
*,
_client: Client,
) -> Dict[str, Any]:
url = "{}/keys/{set}/{kid}".format(_client.base_url, set=set_, kid=kid)
url = "{}/keys/{set}/{kid}".format(
_client.base_url,set=set_,kid=kid)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
return {
"method": "get",
"method": "get",
"url": url,
"headers": headers,
"cookies": cookies,
@ -29,17 +45,23 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, JSONWebKeySet]]:
if response.status_code == 200:
if response.status_code == HTTPStatus.OK:
response_200 = JSONWebKeySet.from_dict(response.json())
return response_200
if response.status_code == 404:
if response.status_code == HTTPStatus.NOT_FOUND:
response_404 = GenericError.from_dict(response.json())
return response_404
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -58,6 +80,7 @@ def sync_detailed(
kid: str,
*,
_client: Client,
) -> Response[Union[GenericError, JSONWebKeySet]]:
"""Fetch a JSON Web Key
@ -71,10 +94,12 @@ def sync_detailed(
Response[Union[GenericError, JSONWebKeySet]]
"""
kwargs = _get_kwargs(
set_=set_,
kid=kid,
_client=_client,
kid=kid,
_client=_client,
)
response = httpx.request(
@ -84,12 +109,12 @@ def sync_detailed(
return _build_response(response=response)
def sync(
set_: str,
kid: str,
*,
_client: Client,
) -> Optional[Union[GenericError, JSONWebKeySet]]:
"""Fetch a JSON Web Key
@ -103,18 +128,20 @@ def sync(
Response[Union[GenericError, JSONWebKeySet]]
"""
return sync_detailed(
set_=set_,
kid=kid,
_client=_client,
).parsed
kid=kid,
_client=_client,
).parsed
async def asyncio_detailed(
set_: str,
kid: str,
*,
_client: Client,
) -> Response[Union[GenericError, JSONWebKeySet]]:
"""Fetch a JSON Web Key
@ -128,23 +155,27 @@ async def asyncio_detailed(
Response[Union[GenericError, JSONWebKeySet]]
"""
kwargs = _get_kwargs(
set_=set_,
kid=kid,
_client=_client,
kid=kid,
_client=_client,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
set_: str,
kid: str,
*,
_client: Client,
) -> Optional[Union[GenericError, JSONWebKeySet]]:
"""Fetch a JSON Web Key
@ -158,10 +189,11 @@ async def asyncio(
Response[Union[GenericError, JSONWebKeySet]]
"""
return (
await asyncio_detailed(
set_=set_,
kid=kid,
_client=_client,
)
).parsed
return (await asyncio_detailed(
set_=set_,
kid=kid,
_client=_client,
)).parsed

View file

@ -1,25 +1,41 @@
from typing import Any, Dict, Optional, Union
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ...models.generic_error import GenericError
from ...models.json_web_key_set import JSONWebKeySet
from ...types import Response
from typing import cast
from typing import Dict
def _get_kwargs(
set_: str,
*,
_client: Client,
) -> Dict[str, Any]:
url = "{}/keys/{set}".format(_client.base_url, set=set_)
url = "{}/keys/{set}".format(
_client.base_url,set=set_)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
return {
"method": "get",
"method": "get",
"url": url,
"headers": headers,
"cookies": cookies,
@ -28,21 +44,29 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, JSONWebKeySet]]:
if response.status_code == 200:
if response.status_code == HTTPStatus.OK:
response_200 = JSONWebKeySet.from_dict(response.json())
return response_200
if response.status_code == 401:
if response.status_code == HTTPStatus.UNAUTHORIZED:
response_401 = GenericError.from_dict(response.json())
return response_401
if response.status_code == 403:
if response.status_code == HTTPStatus.FORBIDDEN:
response_403 = GenericError.from_dict(response.json())
return response_403
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -60,6 +84,7 @@ def sync_detailed(
set_: str,
*,
_client: Client,
) -> Response[Union[GenericError, JSONWebKeySet]]:
"""Retrieve a JSON Web Key Set
@ -78,9 +103,11 @@ def sync_detailed(
Response[Union[GenericError, JSONWebKeySet]]
"""
kwargs = _get_kwargs(
set_=set_,
_client=_client,
_client=_client,
)
response = httpx.request(
@ -90,11 +117,11 @@ def sync_detailed(
return _build_response(response=response)
def sync(
set_: str,
*,
_client: Client,
) -> Optional[Union[GenericError, JSONWebKeySet]]:
"""Retrieve a JSON Web Key Set
@ -113,16 +140,18 @@ def sync(
Response[Union[GenericError, JSONWebKeySet]]
"""
return sync_detailed(
set_=set_,
_client=_client,
).parsed
_client=_client,
).parsed
async def asyncio_detailed(
set_: str,
*,
_client: Client,
) -> Response[Union[GenericError, JSONWebKeySet]]:
"""Retrieve a JSON Web Key Set
@ -141,21 +170,25 @@ async def asyncio_detailed(
Response[Union[GenericError, JSONWebKeySet]]
"""
kwargs = _get_kwargs(
set_=set_,
_client=_client,
_client=_client,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
set_: str,
*,
_client: Client,
) -> Optional[Union[GenericError, JSONWebKeySet]]:
"""Retrieve a JSON Web Key Set
@ -174,9 +207,10 @@ async def asyncio(
Response[Union[GenericError, JSONWebKeySet]]
"""
return (
await asyncio_detailed(
set_=set_,
_client=_client,
)
).parsed
return (await asyncio_detailed(
set_=set_,
_client=_client,
)).parsed

View file

@ -1,30 +1,47 @@
from typing import Any, Dict, Optional, Union
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...models.generic_error import GenericError
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ...models.login_request import LoginRequest
from ...types import UNSET, Response
from ...models.generic_error import GenericError
from typing import cast
from typing import Dict
def _get_kwargs(
*,
_client: Client,
login_challenge: str,
) -> Dict[str, Any]:
url = "{}/oauth2/auth/requests/login".format(_client.base_url)
url = "{}/oauth2/auth/requests/login".format(
_client.base_url)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
params: Dict[str, Any] = {}
params["login_challenge"] = login_challenge
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
return {
"method": "get",
"method": "get",
"url": url,
"headers": headers,
"cookies": cookies,
@ -34,25 +51,35 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, LoginRequest]]:
if response.status_code == 200:
if response.status_code == HTTPStatus.OK:
response_200 = LoginRequest.from_dict(response.json())
return response_200
if response.status_code == 400:
if response.status_code == HTTPStatus.BAD_REQUEST:
response_400 = GenericError.from_dict(response.json())
return response_400
if response.status_code == 404:
if response.status_code == HTTPStatus.NOT_FOUND:
response_404 = GenericError.from_dict(response.json())
return response_404
if response.status_code == 409:
if response.status_code == HTTPStatus.CONFLICT:
response_409 = GenericError.from_dict(response.json())
return response_409
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -70,6 +97,7 @@ def sync_detailed(
*,
_client: Client,
login_challenge: str,
) -> Response[Union[GenericError, LoginRequest]]:
"""Get a Login Request
@ -93,9 +121,11 @@ def sync_detailed(
Response[Union[GenericError, LoginRequest]]
"""
kwargs = _get_kwargs(
_client=_client,
login_challenge=login_challenge,
login_challenge=login_challenge,
)
response = httpx.request(
@ -105,11 +135,11 @@ def sync_detailed(
return _build_response(response=response)
def sync(
*,
_client: Client,
login_challenge: str,
) -> Optional[Union[GenericError, LoginRequest]]:
"""Get a Login Request
@ -133,16 +163,18 @@ def sync(
Response[Union[GenericError, LoginRequest]]
"""
return sync_detailed(
_client=_client,
login_challenge=login_challenge,
).parsed
login_challenge=login_challenge,
).parsed
async def asyncio_detailed(
*,
_client: Client,
login_challenge: str,
) -> Response[Union[GenericError, LoginRequest]]:
"""Get a Login Request
@ -166,21 +198,25 @@ async def asyncio_detailed(
Response[Union[GenericError, LoginRequest]]
"""
kwargs = _get_kwargs(
_client=_client,
login_challenge=login_challenge,
login_challenge=login_challenge,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
*,
_client: Client,
login_challenge: str,
) -> Optional[Union[GenericError, LoginRequest]]:
"""Get a Login Request
@ -204,9 +240,10 @@ async def asyncio(
Response[Union[GenericError, LoginRequest]]
"""
return (
await asyncio_detailed(
_client=_client,
login_challenge=login_challenge,
)
).parsed
return (await asyncio_detailed(
_client=_client,
login_challenge=login_challenge,
)).parsed

View file

@ -1,30 +1,47 @@
from typing import Any, Dict, Optional, Union
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ...models.generic_error import GenericError
from typing import cast
from ...models.logout_request import LogoutRequest
from ...types import UNSET, Response
from typing import Dict
def _get_kwargs(
*,
_client: Client,
logout_challenge: str,
) -> Dict[str, Any]:
url = "{}/oauth2/auth/requests/logout".format(_client.base_url)
url = "{}/oauth2/auth/requests/logout".format(
_client.base_url)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
params: Dict[str, Any] = {}
params["logout_challenge"] = logout_challenge
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
return {
"method": "get",
"method": "get",
"url": url,
"headers": headers,
"cookies": cookies,
@ -34,17 +51,23 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, LogoutRequest]]:
if response.status_code == 200:
if response.status_code == HTTPStatus.OK:
response_200 = LogoutRequest.from_dict(response.json())
return response_200
if response.status_code == 404:
if response.status_code == HTTPStatus.NOT_FOUND:
response_404 = GenericError.from_dict(response.json())
return response_404
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -62,6 +85,7 @@ def sync_detailed(
*,
_client: Client,
logout_challenge: str,
) -> Response[Union[GenericError, LogoutRequest]]:
"""Get a Logout Request
@ -74,9 +98,11 @@ def sync_detailed(
Response[Union[GenericError, LogoutRequest]]
"""
kwargs = _get_kwargs(
_client=_client,
logout_challenge=logout_challenge,
logout_challenge=logout_challenge,
)
response = httpx.request(
@ -86,11 +112,11 @@ def sync_detailed(
return _build_response(response=response)
def sync(
*,
_client: Client,
logout_challenge: str,
) -> Optional[Union[GenericError, LogoutRequest]]:
"""Get a Logout Request
@ -103,16 +129,18 @@ def sync(
Response[Union[GenericError, LogoutRequest]]
"""
return sync_detailed(
_client=_client,
logout_challenge=logout_challenge,
).parsed
logout_challenge=logout_challenge,
).parsed
async def asyncio_detailed(
*,
_client: Client,
logout_challenge: str,
) -> Response[Union[GenericError, LogoutRequest]]:
"""Get a Logout Request
@ -125,21 +153,25 @@ async def asyncio_detailed(
Response[Union[GenericError, LogoutRequest]]
"""
kwargs = _get_kwargs(
_client=_client,
logout_challenge=logout_challenge,
logout_challenge=logout_challenge,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
*,
_client: Client,
logout_challenge: str,
) -> Optional[Union[GenericError, LogoutRequest]]:
"""Get a Logout Request
@ -152,9 +184,10 @@ async def asyncio(
Response[Union[GenericError, LogoutRequest]]
"""
return (
await asyncio_detailed(
_client=_client,
logout_challenge=logout_challenge,
)
).parsed
return (await asyncio_detailed(
_client=_client,
logout_challenge=logout_challenge,
)).parsed

View file

@ -1,25 +1,41 @@
from typing import Any, Dict, Optional, Union
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ...models.generic_error import GenericError
from typing import cast
from ...models.o_auth_2_client import OAuth2Client
from ...types import Response
from typing import Dict
def _get_kwargs(
id: str,
*,
_client: Client,
) -> Dict[str, Any]:
url = "{}/clients/{id}".format(_client.base_url, id=id)
url = "{}/clients/{id}".format(
_client.base_url,id=id)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
return {
"method": "get",
"method": "get",
"url": url,
"headers": headers,
"cookies": cookies,
@ -28,17 +44,23 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, OAuth2Client]]:
if response.status_code == 200:
if response.status_code == HTTPStatus.OK:
response_200 = OAuth2Client.from_dict(response.json())
return response_200
if response.status_code == 401:
if response.status_code == HTTPStatus.UNAUTHORIZED:
response_401 = GenericError.from_dict(response.json())
return response_401
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -56,6 +78,7 @@ def sync_detailed(
id: str,
*,
_client: Client,
) -> Response[Union[GenericError, OAuth2Client]]:
"""Get an OAuth 2.0 Client.
@ -73,9 +96,11 @@ def sync_detailed(
Response[Union[GenericError, OAuth2Client]]
"""
kwargs = _get_kwargs(
id=id,
_client=_client,
_client=_client,
)
response = httpx.request(
@ -85,11 +110,11 @@ def sync_detailed(
return _build_response(response=response)
def sync(
id: str,
*,
_client: Client,
) -> Optional[Union[GenericError, OAuth2Client]]:
"""Get an OAuth 2.0 Client.
@ -107,16 +132,18 @@ def sync(
Response[Union[GenericError, OAuth2Client]]
"""
return sync_detailed(
id=id,
_client=_client,
).parsed
_client=_client,
).parsed
async def asyncio_detailed(
id: str,
*,
_client: Client,
) -> Response[Union[GenericError, OAuth2Client]]:
"""Get an OAuth 2.0 Client.
@ -134,21 +161,25 @@ async def asyncio_detailed(
Response[Union[GenericError, OAuth2Client]]
"""
kwargs = _get_kwargs(
id=id,
_client=_client,
_client=_client,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
id: str,
*,
_client: Client,
) -> Optional[Union[GenericError, OAuth2Client]]:
"""Get an OAuth 2.0 Client.
@ -166,9 +197,10 @@ async def asyncio(
Response[Union[GenericError, OAuth2Client]]
"""
return (
await asyncio_detailed(
id=id,
_client=_client,
)
).parsed
return (await asyncio_detailed(
id=id,
_client=_client,
)).parsed

View file

@ -1,23 +1,39 @@
from typing import Any, Dict, Optional
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ...models.version import Version
from ...types import Response
from typing import cast
from typing import Dict
def _get_kwargs(
*,
_client: Client,
) -> Dict[str, Any]:
url = "{}/version".format(_client.base_url)
url = "{}/version".format(
_client.base_url)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
return {
"method": "get",
"method": "get",
"url": url,
"headers": headers,
"cookies": cookies,
@ -26,9 +42,11 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Version]:
if response.status_code == 200:
if response.status_code == HTTPStatus.OK:
response_200 = Version.from_dict(response.json())
return response_200
return None
@ -45,6 +63,7 @@ def _build_response(*, response: httpx.Response) -> Response[Version]:
def sync_detailed(
*,
_client: Client,
) -> Response[Version]:
"""Get Service Version
@ -57,8 +76,10 @@ def sync_detailed(
Response[Version]
"""
kwargs = _get_kwargs(
_client=_client,
)
response = httpx.request(
@ -68,10 +89,10 @@ def sync_detailed(
return _build_response(response=response)
def sync(
*,
_client: Client,
) -> Optional[Version]:
"""Get Service Version
@ -84,14 +105,16 @@ def sync(
Response[Version]
"""
return sync_detailed(
_client=_client,
).parsed
).parsed
async def asyncio_detailed(
*,
_client: Client,
) -> Response[Version]:
"""Get Service Version
@ -104,19 +127,23 @@ async def asyncio_detailed(
Response[Version]
"""
kwargs = _get_kwargs(
_client=_client,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
*,
_client: Client,
) -> Optional[Version]:
"""Get Service Version
@ -129,8 +156,9 @@ async def asyncio(
Response[Version]
"""
return (
await asyncio_detailed(
_client=_client,
)
).parsed
return (await asyncio_detailed(
_client=_client,
)).parsed

View file

@ -1,24 +1,41 @@
from typing import Any, Dict, Optional, Union
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...models.generic_error import GenericError
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ...models.introspect_o_auth_2_token_data import IntrospectOAuth2TokenData
from ...models.o_auth_2_token_introspection import OAuth2TokenIntrospection
from ...types import Response
from typing import Dict
from typing import cast
from ...models.generic_error import GenericError
def _get_kwargs(
*,
_client: Client,
) -> Dict[str, Any]:
url = "{}/oauth2/introspect".format(_client.base_url)
url = "{}/oauth2/introspect".format(
_client.base_url)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
return {
"method": "post",
"method": "post",
"url": url,
"headers": headers,
"cookies": cookies,
@ -27,17 +44,23 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, OAuth2TokenIntrospection]]:
if response.status_code == 200:
if response.status_code == HTTPStatus.OK:
response_200 = OAuth2TokenIntrospection.from_dict(response.json())
return response_200
if response.status_code == 401:
if response.status_code == HTTPStatus.UNAUTHORIZED:
response_401 = GenericError.from_dict(response.json())
return response_401
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -54,6 +77,7 @@ def _build_response(*, response: httpx.Response) -> Response[Union[GenericError,
def sync_detailed(
*,
_client: Client,
) -> Response[Union[GenericError, OAuth2TokenIntrospection]]:
"""Introspect OAuth2 Tokens
@ -70,8 +94,10 @@ def sync_detailed(
Response[Union[GenericError, OAuth2TokenIntrospection]]
"""
kwargs = _get_kwargs(
_client=_client,
)
response = httpx.request(
@ -81,10 +107,10 @@ def sync_detailed(
return _build_response(response=response)
def sync(
*,
_client: Client,
) -> Optional[Union[GenericError, OAuth2TokenIntrospection]]:
"""Introspect OAuth2 Tokens
@ -101,14 +127,16 @@ def sync(
Response[Union[GenericError, OAuth2TokenIntrospection]]
"""
return sync_detailed(
_client=_client,
).parsed
).parsed
async def asyncio_detailed(
*,
_client: Client,
) -> Response[Union[GenericError, OAuth2TokenIntrospection]]:
"""Introspect OAuth2 Tokens
@ -125,19 +153,23 @@ async def asyncio_detailed(
Response[Union[GenericError, OAuth2TokenIntrospection]]
"""
kwargs = _get_kwargs(
_client=_client,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
*,
_client: Client,
) -> Optional[Union[GenericError, OAuth2TokenIntrospection]]:
"""Introspect OAuth2 Tokens
@ -154,8 +186,9 @@ async def asyncio(
Response[Union[GenericError, OAuth2TokenIntrospection]]
"""
return (
await asyncio_detailed(
_client=_client,
)
).parsed
return (await asyncio_detailed(
_client=_client,
)).parsed

View file

@ -1,24 +1,40 @@
from typing import Any, Dict, Optional, Union
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ...models.generic_error import GenericError
from ...models.health_status import HealthStatus
from ...types import Response
from typing import cast
from typing import Dict
def _get_kwargs(
*,
_client: Client,
) -> Dict[str, Any]:
url = "{}/health/alive".format(_client.base_url)
url = "{}/health/alive".format(
_client.base_url)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
return {
"method": "get",
"method": "get",
"url": url,
"headers": headers,
"cookies": cookies,
@ -27,13 +43,17 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, HealthStatus]]:
if response.status_code == 200:
if response.status_code == HTTPStatus.OK:
response_200 = HealthStatus.from_dict(response.json())
return response_200
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -50,6 +70,7 @@ def _build_response(*, response: httpx.Response) -> Response[Union[GenericError,
def sync_detailed(
*,
_client: Client,
) -> Response[Union[GenericError, HealthStatus]]:
"""Check Alive Status
@ -66,8 +87,10 @@ def sync_detailed(
Response[Union[GenericError, HealthStatus]]
"""
kwargs = _get_kwargs(
_client=_client,
)
response = httpx.request(
@ -77,10 +100,10 @@ def sync_detailed(
return _build_response(response=response)
def sync(
*,
_client: Client,
) -> Optional[Union[GenericError, HealthStatus]]:
"""Check Alive Status
@ -97,14 +120,16 @@ def sync(
Response[Union[GenericError, HealthStatus]]
"""
return sync_detailed(
_client=_client,
).parsed
).parsed
async def asyncio_detailed(
*,
_client: Client,
) -> Response[Union[GenericError, HealthStatus]]:
"""Check Alive Status
@ -121,19 +146,23 @@ async def asyncio_detailed(
Response[Union[GenericError, HealthStatus]]
"""
kwargs = _get_kwargs(
_client=_client,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
*,
_client: Client,
) -> Optional[Union[GenericError, HealthStatus]]:
"""Check Alive Status
@ -150,8 +179,9 @@ async def asyncio(
Response[Union[GenericError, HealthStatus]]
"""
return (
await asyncio_detailed(
_client=_client,
)
).parsed
return (await asyncio_detailed(
_client=_client,
)).parsed

View file

@ -1,11 +1,19 @@
from typing import Any, Dict, List, Optional, Union
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from typing import Dict
from typing import Union
from typing import cast
from ...types import UNSET, Unset
from ...models.generic_error import GenericError
from typing import cast, List
from ...models.o_auth_2_client import OAuth2Client
from ...types import UNSET, Response, Unset
from typing import Optional
def _get_kwargs(
@ -13,21 +21,35 @@ def _get_kwargs(
_client: Client,
limit: Union[Unset, None, int] = UNSET,
offset: Union[Unset, None, int] = UNSET,
) -> Dict[str, Any]:
url = "{}/clients".format(_client.base_url)
url = "{}/clients".format(
_client.base_url)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
params: Dict[str, Any] = {}
params["limit"] = limit
params["offset"] = offset
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
return {
"method": "get",
"method": "get",
"url": url,
"headers": headers,
"cookies": cookies,
@ -36,24 +58,28 @@ def _get_kwargs(
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, List[OAuth2Client]]]:
if response.status_code == 200:
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, List['OAuth2Client']]]:
if response.status_code == HTTPStatus.OK:
response_200 = []
_response_200 = response.json()
for response_200_item_data in _response_200:
for response_200_item_data in (_response_200):
response_200_item = OAuth2Client.from_dict(response_200_item_data)
response_200.append(response_200_item)
return response_200
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, List[OAuth2Client]]]:
def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, List['OAuth2Client']]]:
return Response(
status_code=response.status_code,
content=response.content,
@ -67,7 +93,8 @@ def sync_detailed(
_client: Client,
limit: Union[Unset, None, int] = UNSET,
offset: Union[Unset, None, int] = UNSET,
) -> Response[Union[GenericError, List[OAuth2Client]]]:
) -> Response[Union[GenericError, List['OAuth2Client']]]:
"""List OAuth 2.0 Clients
This endpoint lists all clients in the database, and never returns client secrets. As a default it
@ -89,13 +116,15 @@ def sync_detailed(
offset (Union[Unset, None, int]):
Returns:
Response[Union[GenericError, List[OAuth2Client]]]
Response[Union[GenericError, List['OAuth2Client']]]
"""
kwargs = _get_kwargs(
_client=_client,
limit=limit,
offset=offset,
limit=limit,
offset=offset,
)
response = httpx.request(
@ -105,13 +134,13 @@ def sync_detailed(
return _build_response(response=response)
def sync(
*,
_client: Client,
limit: Union[Unset, None, int] = UNSET,
offset: Union[Unset, None, int] = UNSET,
) -> Optional[Union[GenericError, List[OAuth2Client]]]:
) -> Optional[Union[GenericError, List['OAuth2Client']]]:
"""List OAuth 2.0 Clients
This endpoint lists all clients in the database, and never returns client secrets. As a default it
@ -133,22 +162,24 @@ def sync(
offset (Union[Unset, None, int]):
Returns:
Response[Union[GenericError, List[OAuth2Client]]]
Response[Union[GenericError, List['OAuth2Client']]]
"""
return sync_detailed(
_client=_client,
limit=limit,
offset=offset,
).parsed
limit=limit,
offset=offset,
).parsed
async def asyncio_detailed(
*,
_client: Client,
limit: Union[Unset, None, int] = UNSET,
offset: Union[Unset, None, int] = UNSET,
) -> Response[Union[GenericError, List[OAuth2Client]]]:
) -> Response[Union[GenericError, List['OAuth2Client']]]:
"""List OAuth 2.0 Clients
This endpoint lists all clients in the database, and never returns client secrets. As a default it
@ -170,27 +201,31 @@ async def asyncio_detailed(
offset (Union[Unset, None, int]):
Returns:
Response[Union[GenericError, List[OAuth2Client]]]
Response[Union[GenericError, List['OAuth2Client']]]
"""
kwargs = _get_kwargs(
_client=_client,
limit=limit,
offset=offset,
limit=limit,
offset=offset,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
*,
_client: Client,
limit: Union[Unset, None, int] = UNSET,
offset: Union[Unset, None, int] = UNSET,
) -> Optional[Union[GenericError, List[OAuth2Client]]]:
) -> Optional[Union[GenericError, List['OAuth2Client']]]:
"""List OAuth 2.0 Clients
This endpoint lists all clients in the database, and never returns client secrets. As a default it
@ -212,13 +247,14 @@ async def asyncio(
offset (Union[Unset, None, int]):
Returns:
Response[Union[GenericError, List[OAuth2Client]]]
Response[Union[GenericError, List['OAuth2Client']]]
"""
return (
await asyncio_detailed(
_client=_client,
limit=limit,
offset=offset,
)
).parsed
return (await asyncio_detailed(
_client=_client,
limit=limit,
offset=offset,
)).parsed

View file

@ -1,30 +1,48 @@
from typing import Any, Dict, List, Optional, Union
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...models.generic_error import GenericError
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from typing import Dict
from ...models.previous_consent_session import PreviousConsentSession
from ...types import UNSET, Response
from typing import cast
from ...models.generic_error import GenericError
from typing import cast, List
def _get_kwargs(
*,
_client: Client,
subject: str,
) -> Dict[str, Any]:
url = "{}/oauth2/auth/sessions/consent".format(_client.base_url)
url = "{}/oauth2/auth/sessions/consent".format(
_client.base_url)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
params: Dict[str, Any] = {}
params["subject"] = subject
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
return {
"method": "get",
"method": "get",
"url": url,
"headers": headers,
"cookies": cookies,
@ -33,28 +51,34 @@ def _get_kwargs(
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, List[PreviousConsentSession]]]:
if response.status_code == 200:
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, List['PreviousConsentSession']]]:
if response.status_code == HTTPStatus.OK:
response_200 = []
_response_200 = response.json()
for response_200_item_data in _response_200:
for response_200_item_data in (_response_200):
response_200_item = PreviousConsentSession.from_dict(response_200_item_data)
response_200.append(response_200_item)
return response_200
if response.status_code == 400:
if response.status_code == HTTPStatus.BAD_REQUEST:
response_400 = GenericError.from_dict(response.json())
return response_400
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, List[PreviousConsentSession]]]:
def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, List['PreviousConsentSession']]]:
return Response(
status_code=response.status_code,
content=response.content,
@ -67,7 +91,8 @@ def sync_detailed(
*,
_client: Client,
subject: str,
) -> Response[Union[GenericError, List[PreviousConsentSession]]]:
) -> Response[Union[GenericError, List['PreviousConsentSession']]]:
"""Lists All Consent Sessions of a Subject
This endpoint lists all subject's granted consent sessions, including client and granted scope.
@ -86,12 +111,14 @@ def sync_detailed(
subject (str):
Returns:
Response[Union[GenericError, List[PreviousConsentSession]]]
Response[Union[GenericError, List['PreviousConsentSession']]]
"""
kwargs = _get_kwargs(
_client=_client,
subject=subject,
subject=subject,
)
response = httpx.request(
@ -101,12 +128,12 @@ def sync_detailed(
return _build_response(response=response)
def sync(
*,
_client: Client,
subject: str,
) -> Optional[Union[GenericError, List[PreviousConsentSession]]]:
) -> Optional[Union[GenericError, List['PreviousConsentSession']]]:
"""Lists All Consent Sessions of a Subject
This endpoint lists all subject's granted consent sessions, including client and granted scope.
@ -125,20 +152,22 @@ def sync(
subject (str):
Returns:
Response[Union[GenericError, List[PreviousConsentSession]]]
Response[Union[GenericError, List['PreviousConsentSession']]]
"""
return sync_detailed(
_client=_client,
subject=subject,
).parsed
subject=subject,
).parsed
async def asyncio_detailed(
*,
_client: Client,
subject: str,
) -> Response[Union[GenericError, List[PreviousConsentSession]]]:
) -> Response[Union[GenericError, List['PreviousConsentSession']]]:
"""Lists All Consent Sessions of a Subject
This endpoint lists all subject's granted consent sessions, including client and granted scope.
@ -157,25 +186,29 @@ async def asyncio_detailed(
subject (str):
Returns:
Response[Union[GenericError, List[PreviousConsentSession]]]
Response[Union[GenericError, List['PreviousConsentSession']]]
"""
kwargs = _get_kwargs(
_client=_client,
subject=subject,
subject=subject,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
*,
_client: Client,
subject: str,
) -> Optional[Union[GenericError, List[PreviousConsentSession]]]:
) -> Optional[Union[GenericError, List['PreviousConsentSession']]]:
"""Lists All Consent Sessions of a Subject
This endpoint lists all subject's granted consent sessions, including client and granted scope.
@ -194,12 +227,13 @@ async def asyncio(
subject (str):
Returns:
Response[Union[GenericError, List[PreviousConsentSession]]]
Response[Union[GenericError, List['PreviousConsentSession']]]
"""
return (
await asyncio_detailed(
_client=_client,
subject=subject,
)
).parsed
return (await asyncio_detailed(
_client=_client,
subject=subject,
)).parsed

View file

@ -1,22 +1,36 @@
from typing import Any, Dict
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...types import Response
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
def _get_kwargs(
*,
_client: Client,
) -> Dict[str, Any]:
url = "{}/metrics/prometheus".format(_client.base_url)
url = "{}/metrics/prometheus".format(
_client.base_url)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
return {
"method": "get",
"method": "get",
"url": url,
"headers": headers,
"cookies": cookies,
@ -24,6 +38,8 @@ def _get_kwargs(
}
def _build_response(*, response: httpx.Response) -> Response[Any]:
return Response(
status_code=response.status_code,
@ -36,6 +52,7 @@ def _build_response(*, response: httpx.Response) -> Response[Any]:
def sync_detailed(
*,
_client: Client,
) -> Response[Any]:
"""Get Snapshot Metrics from the Hydra Service.
@ -55,8 +72,10 @@ def sync_detailed(
Response[Any]
"""
kwargs = _get_kwargs(
_client=_client,
)
response = httpx.request(
@ -70,6 +89,7 @@ def sync_detailed(
async def asyncio_detailed(
*,
_client: Client,
) -> Response[Any]:
"""Get Snapshot Metrics from the Hydra Service.
@ -89,11 +109,17 @@ async def asyncio_detailed(
Response[Any]
"""
kwargs = _get_kwargs(
_client=_client,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)

View file

@ -1,12 +1,16 @@
from typing import Any, Dict, Optional, Union
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from typing import Dict
from typing import cast
from ...models.reject_request import RejectRequest
from ...models.completed_request import CompletedRequest
from ...models.generic_error import GenericError
from ...models.reject_request import RejectRequest
from ...types import UNSET, Response
def _get_kwargs(
@ -14,21 +18,34 @@ def _get_kwargs(
_client: Client,
json_body: RejectRequest,
consent_challenge: str,
) -> Dict[str, Any]:
url = "{}/oauth2/auth/requests/consent/reject".format(_client.base_url)
url = "{}/oauth2/auth/requests/consent/reject".format(
_client.base_url)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
params: Dict[str, Any] = {}
params["consent_challenge"] = consent_challenge
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
json_json_body = json_body.to_dict()
return {
"method": "put",
"method": "put",
"url": url,
"headers": headers,
"cookies": cookies,
@ -39,17 +56,23 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[CompletedRequest, GenericError]]:
if response.status_code == 200:
if response.status_code == HTTPStatus.OK:
response_200 = CompletedRequest.from_dict(response.json())
return response_200
if response.status_code == 404:
if response.status_code == HTTPStatus.NOT_FOUND:
response_404 = GenericError.from_dict(response.json())
return response_404
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -68,6 +91,7 @@ def sync_detailed(
_client: Client,
json_body: RejectRequest,
consent_challenge: str,
) -> Response[Union[CompletedRequest, GenericError]]:
"""Reject a Consent Request
@ -103,10 +127,12 @@ def sync_detailed(
Response[Union[CompletedRequest, GenericError]]
"""
kwargs = _get_kwargs(
_client=_client,
json_body=json_body,
consent_challenge=consent_challenge,
json_body=json_body,
consent_challenge=consent_challenge,
)
response = httpx.request(
@ -116,12 +142,12 @@ def sync_detailed(
return _build_response(response=response)
def sync(
*,
_client: Client,
json_body: RejectRequest,
consent_challenge: str,
) -> Optional[Union[CompletedRequest, GenericError]]:
"""Reject a Consent Request
@ -157,18 +183,20 @@ def sync(
Response[Union[CompletedRequest, GenericError]]
"""
return sync_detailed(
_client=_client,
json_body=json_body,
consent_challenge=consent_challenge,
).parsed
json_body=json_body,
consent_challenge=consent_challenge,
).parsed
async def asyncio_detailed(
*,
_client: Client,
json_body: RejectRequest,
consent_challenge: str,
) -> Response[Union[CompletedRequest, GenericError]]:
"""Reject a Consent Request
@ -204,23 +232,27 @@ async def asyncio_detailed(
Response[Union[CompletedRequest, GenericError]]
"""
kwargs = _get_kwargs(
_client=_client,
json_body=json_body,
consent_challenge=consent_challenge,
json_body=json_body,
consent_challenge=consent_challenge,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
*,
_client: Client,
json_body: RejectRequest,
consent_challenge: str,
) -> Optional[Union[CompletedRequest, GenericError]]:
"""Reject a Consent Request
@ -256,10 +288,11 @@ async def asyncio(
Response[Union[CompletedRequest, GenericError]]
"""
return (
await asyncio_detailed(
_client=_client,
json_body=json_body,
consent_challenge=consent_challenge,
)
).parsed
return (await asyncio_detailed(
_client=_client,
json_body=json_body,
consent_challenge=consent_challenge,
)).parsed

View file

@ -1,12 +1,16 @@
from typing import Any, Dict, Optional, Union
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from typing import Dict
from typing import cast
from ...models.reject_request import RejectRequest
from ...models.completed_request import CompletedRequest
from ...models.generic_error import GenericError
from ...models.reject_request import RejectRequest
from ...types import UNSET, Response
def _get_kwargs(
@ -14,21 +18,34 @@ def _get_kwargs(
_client: Client,
json_body: RejectRequest,
login_challenge: str,
) -> Dict[str, Any]:
url = "{}/oauth2/auth/requests/login/reject".format(_client.base_url)
url = "{}/oauth2/auth/requests/login/reject".format(
_client.base_url)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
params: Dict[str, Any] = {}
params["login_challenge"] = login_challenge
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
json_json_body = json_body.to_dict()
return {
"method": "put",
"method": "put",
"url": url,
"headers": headers,
"cookies": cookies,
@ -39,25 +56,35 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[CompletedRequest, GenericError]]:
if response.status_code == 200:
if response.status_code == HTTPStatus.OK:
response_200 = CompletedRequest.from_dict(response.json())
return response_200
if response.status_code == 400:
if response.status_code == HTTPStatus.BAD_REQUEST:
response_400 = GenericError.from_dict(response.json())
return response_400
if response.status_code == 401:
if response.status_code == HTTPStatus.UNAUTHORIZED:
response_401 = GenericError.from_dict(response.json())
return response_401
if response.status_code == 404:
if response.status_code == HTTPStatus.NOT_FOUND:
response_404 = GenericError.from_dict(response.json())
return response_404
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -76,6 +103,7 @@ def sync_detailed(
_client: Client,
json_body: RejectRequest,
login_challenge: str,
) -> Response[Union[CompletedRequest, GenericError]]:
"""Reject a Login Request
@ -106,10 +134,12 @@ def sync_detailed(
Response[Union[CompletedRequest, GenericError]]
"""
kwargs = _get_kwargs(
_client=_client,
json_body=json_body,
login_challenge=login_challenge,
json_body=json_body,
login_challenge=login_challenge,
)
response = httpx.request(
@ -119,12 +149,12 @@ def sync_detailed(
return _build_response(response=response)
def sync(
*,
_client: Client,
json_body: RejectRequest,
login_challenge: str,
) -> Optional[Union[CompletedRequest, GenericError]]:
"""Reject a Login Request
@ -155,18 +185,20 @@ def sync(
Response[Union[CompletedRequest, GenericError]]
"""
return sync_detailed(
_client=_client,
json_body=json_body,
login_challenge=login_challenge,
).parsed
json_body=json_body,
login_challenge=login_challenge,
).parsed
async def asyncio_detailed(
*,
_client: Client,
json_body: RejectRequest,
login_challenge: str,
) -> Response[Union[CompletedRequest, GenericError]]:
"""Reject a Login Request
@ -197,23 +229,27 @@ async def asyncio_detailed(
Response[Union[CompletedRequest, GenericError]]
"""
kwargs = _get_kwargs(
_client=_client,
json_body=json_body,
login_challenge=login_challenge,
json_body=json_body,
login_challenge=login_challenge,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
*,
_client: Client,
json_body: RejectRequest,
login_challenge: str,
) -> Optional[Union[CompletedRequest, GenericError]]:
"""Reject a Login Request
@ -244,10 +280,11 @@ async def asyncio(
Response[Union[CompletedRequest, GenericError]]
"""
return (
await asyncio_detailed(
_client=_client,
json_body=json_body,
login_challenge=login_challenge,
)
).parsed
return (await asyncio_detailed(
_client=_client,
json_body=json_body,
login_challenge=login_challenge,
)).parsed

View file

@ -1,54 +1,74 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ...models.generic_error import GenericError
from typing import cast
from ...models.reject_request import RejectRequest
from ...types import UNSET, Response
from typing import Dict
def _get_kwargs(
*,
_client: Client,
form_data: RejectRequest,
json_body: RejectRequest,
logout_challenge: str,
) -> Dict[str, Any]:
url = "{}/oauth2/auth/requests/logout/reject".format(_client.base_url)
url = "{}/oauth2/auth/requests/logout/reject".format(
_client.base_url)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
params: Dict[str, Any] = {}
params["logout_challenge"] = logout_challenge
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
json_body.to_dict()
json_json_body = json_body.to_dict()
return {
"method": "put",
"method": "put",
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": _client.get_timeout(),
"data": form_data.to_dict(),
"json": json_json_body,
"params": params,
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, GenericError]]:
if response.status_code == 204:
if response.status_code == HTTPStatus.NO_CONTENT:
response_204 = cast(Any, None)
return response_204
if response.status_code == 404:
if response.status_code == HTTPStatus.NOT_FOUND:
response_404 = GenericError.from_dict(response.json())
return response_404
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -65,9 +85,9 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, GenericE
def sync_detailed(
*,
_client: Client,
form_data: RejectRequest,
json_body: RejectRequest,
logout_challenge: str,
) -> Response[Union[Any, GenericError]]:
"""Reject a Logout Request
@ -85,11 +105,12 @@ def sync_detailed(
Response[Union[Any, GenericError]]
"""
kwargs = _get_kwargs(
_client=_client,
form_data=form_data,
json_body=json_body,
logout_challenge=logout_challenge,
json_body=json_body,
logout_challenge=logout_challenge,
)
response = httpx.request(
@ -99,13 +120,12 @@ def sync_detailed(
return _build_response(response=response)
def sync(
*,
_client: Client,
form_data: RejectRequest,
json_body: RejectRequest,
logout_challenge: str,
) -> Optional[Union[Any, GenericError]]:
"""Reject a Logout Request
@ -123,20 +143,20 @@ def sync(
Response[Union[Any, GenericError]]
"""
return sync_detailed(
_client=_client,
form_data=form_data,
json_body=json_body,
logout_challenge=logout_challenge,
).parsed
json_body=json_body,
logout_challenge=logout_challenge,
).parsed
async def asyncio_detailed(
*,
_client: Client,
form_data: RejectRequest,
json_body: RejectRequest,
logout_challenge: str,
) -> Response[Union[Any, GenericError]]:
"""Reject a Logout Request
@ -154,25 +174,27 @@ async def asyncio_detailed(
Response[Union[Any, GenericError]]
"""
kwargs = _get_kwargs(
_client=_client,
form_data=form_data,
json_body=json_body,
logout_challenge=logout_challenge,
json_body=json_body,
logout_challenge=logout_challenge,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
*,
_client: Client,
form_data: RejectRequest,
json_body: RejectRequest,
logout_challenge: str,
) -> Optional[Union[Any, GenericError]]:
"""Reject a Logout Request
@ -190,11 +212,11 @@ async def asyncio(
Response[Union[Any, GenericError]]
"""
return (
await asyncio_detailed(
_client=_client,
form_data=form_data,
json_body=json_body,
logout_challenge=logout_challenge,
)
).parsed
return (await asyncio_detailed(
_client=_client,
json_body=json_body,
logout_challenge=logout_challenge,
)).parsed

View file

@ -1,29 +1,46 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ...models.generic_error import GenericError
from ...types import UNSET, Response
from typing import cast
from typing import Dict
def _get_kwargs(
*,
_client: Client,
subject: str,
) -> Dict[str, Any]:
url = "{}/oauth2/auth/sessions/login".format(_client.base_url)
url = "{}/oauth2/auth/sessions/login".format(
_client.base_url)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
params: Dict[str, Any] = {}
params["subject"] = subject
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
return {
"method": "delete",
"method": "delete",
"url": url,
"headers": headers,
"cookies": cookies,
@ -33,20 +50,26 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, GenericError]]:
if response.status_code == 204:
if response.status_code == HTTPStatus.NO_CONTENT:
response_204 = cast(Any, None)
return response_204
if response.status_code == 400:
if response.status_code == HTTPStatus.BAD_REQUEST:
response_400 = GenericError.from_dict(response.json())
return response_400
if response.status_code == 404:
if response.status_code == HTTPStatus.NOT_FOUND:
response_404 = GenericError.from_dict(response.json())
return response_404
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -64,6 +87,7 @@ def sync_detailed(
*,
_client: Client,
subject: str,
) -> Response[Union[Any, GenericError]]:
"""Invalidates All Login Sessions of a Certain User
Invalidates a Subject's Authentication Session
@ -81,9 +105,11 @@ def sync_detailed(
Response[Union[Any, GenericError]]
"""
kwargs = _get_kwargs(
_client=_client,
subject=subject,
subject=subject,
)
response = httpx.request(
@ -93,11 +119,11 @@ def sync_detailed(
return _build_response(response=response)
def sync(
*,
_client: Client,
subject: str,
) -> Optional[Union[Any, GenericError]]:
"""Invalidates All Login Sessions of a Certain User
Invalidates a Subject's Authentication Session
@ -115,16 +141,18 @@ def sync(
Response[Union[Any, GenericError]]
"""
return sync_detailed(
_client=_client,
subject=subject,
).parsed
subject=subject,
).parsed
async def asyncio_detailed(
*,
_client: Client,
subject: str,
) -> Response[Union[Any, GenericError]]:
"""Invalidates All Login Sessions of a Certain User
Invalidates a Subject's Authentication Session
@ -142,21 +170,25 @@ async def asyncio_detailed(
Response[Union[Any, GenericError]]
"""
kwargs = _get_kwargs(
_client=_client,
subject=subject,
subject=subject,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
*,
_client: Client,
subject: str,
) -> Optional[Union[Any, GenericError]]:
"""Invalidates All Login Sessions of a Certain User
Invalidates a Subject's Authentication Session
@ -174,9 +206,10 @@ async def asyncio(
Response[Union[Any, GenericError]]
"""
return (
await asyncio_detailed(
_client=_client,
subject=subject,
)
).parsed
return (await asyncio_detailed(
_client=_client,
subject=subject,
)).parsed

View file

@ -1,10 +1,17 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from typing import Dict
from typing import Union
from typing import cast
from ...types import UNSET, Unset
from ...models.generic_error import GenericError
from ...types import UNSET, Response, Unset
from typing import Optional
def _get_kwargs(
@ -13,23 +20,38 @@ def _get_kwargs(
subject: str,
client: Union[Unset, None, str] = UNSET,
all_: Union[Unset, None, bool] = UNSET,
) -> Dict[str, Any]:
url = "{}/oauth2/auth/sessions/consent".format(_client.base_url)
url = "{}/oauth2/auth/sessions/consent".format(
_client.base_url)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
params: Dict[str, Any] = {}
params["subject"] = subject
params["client"] = client
params["all"] = all_
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
return {
"method": "delete",
"method": "delete",
"url": url,
"headers": headers,
"cookies": cookies,
@ -39,20 +61,26 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, GenericError]]:
if response.status_code == 204:
if response.status_code == HTTPStatus.NO_CONTENT:
response_204 = cast(Any, None)
return response_204
if response.status_code == 400:
if response.status_code == HTTPStatus.BAD_REQUEST:
response_400 = GenericError.from_dict(response.json())
return response_400
if response.status_code == 404:
if response.status_code == HTTPStatus.NOT_FOUND:
response_404 = GenericError.from_dict(response.json())
return response_404
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -72,6 +100,7 @@ def sync_detailed(
subject: str,
client: Union[Unset, None, str] = UNSET,
all_: Union[Unset, None, bool] = UNSET,
) -> Response[Union[Any, GenericError]]:
"""Revokes Consent Sessions of a Subject for a Specific OAuth 2.0 Client
@ -88,11 +117,13 @@ def sync_detailed(
Response[Union[Any, GenericError]]
"""
kwargs = _get_kwargs(
_client=_client,
subject=subject,
client=client,
all_=all_,
subject=subject,
client=client,
all_=all_,
)
response = httpx.request(
@ -102,13 +133,13 @@ def sync_detailed(
return _build_response(response=response)
def sync(
*,
_client: Client,
subject: str,
client: Union[Unset, None, str] = UNSET,
all_: Union[Unset, None, bool] = UNSET,
) -> Optional[Union[Any, GenericError]]:
"""Revokes Consent Sessions of a Subject for a Specific OAuth 2.0 Client
@ -125,13 +156,14 @@ def sync(
Response[Union[Any, GenericError]]
"""
return sync_detailed(
_client=_client,
subject=subject,
client=client,
all_=all_,
).parsed
subject=subject,
client=client,
all_=all_,
).parsed
async def asyncio_detailed(
*,
@ -139,6 +171,7 @@ async def asyncio_detailed(
subject: str,
client: Union[Unset, None, str] = UNSET,
all_: Union[Unset, None, bool] = UNSET,
) -> Response[Union[Any, GenericError]]:
"""Revokes Consent Sessions of a Subject for a Specific OAuth 2.0 Client
@ -155,25 +188,29 @@ async def asyncio_detailed(
Response[Union[Any, GenericError]]
"""
kwargs = _get_kwargs(
_client=_client,
subject=subject,
client=client,
all_=all_,
subject=subject,
client=client,
all_=all_,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
*,
_client: Client,
subject: str,
client: Union[Unset, None, str] = UNSET,
all_: Union[Unset, None, bool] = UNSET,
) -> Optional[Union[Any, GenericError]]:
"""Revokes Consent Sessions of a Subject for a Specific OAuth 2.0 Client
@ -190,11 +227,12 @@ async def asyncio(
Response[Union[Any, GenericError]]
"""
return (
await asyncio_detailed(
_client=_client,
subject=subject,
client=client,
all_=all_,
)
).parsed
return (await asyncio_detailed(
_client=_client,
subject=subject,
client=client,
all_=all_,
)).parsed

View file

@ -1,11 +1,15 @@
from typing import Any, Dict, Optional, Union
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ...models.generic_error import GenericError
from typing import cast
from ...models.json_web_key import JSONWebKey
from ...types import Response
from typing import Dict
def _get_kwargs(
@ -14,16 +18,28 @@ def _get_kwargs(
*,
_client: Client,
json_body: JSONWebKey,
) -> Dict[str, Any]:
url = "{}/keys/{set}/{kid}".format(_client.base_url, set=set_, kid=kid)
url = "{}/keys/{set}/{kid}".format(
_client.base_url,set=set_,kid=kid)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
json_json_body = json_body.to_dict()
return {
"method": "put",
"method": "put",
"url": url,
"headers": headers,
"cookies": cookies,
@ -33,21 +49,29 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, JSONWebKey]]:
if response.status_code == 200:
if response.status_code == HTTPStatus.OK:
response_200 = JSONWebKey.from_dict(response.json())
return response_200
if response.status_code == 401:
if response.status_code == HTTPStatus.UNAUTHORIZED:
response_401 = GenericError.from_dict(response.json())
return response_401
if response.status_code == 403:
if response.status_code == HTTPStatus.FORBIDDEN:
response_403 = GenericError.from_dict(response.json())
return response_403
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -67,6 +91,7 @@ def sync_detailed(
*,
_client: Client,
json_body: JSONWebKey,
) -> Response[Union[GenericError, JSONWebKey]]:
"""Update a JSON Web Key
@ -90,11 +115,13 @@ def sync_detailed(
Response[Union[GenericError, JSONWebKey]]
"""
kwargs = _get_kwargs(
set_=set_,
kid=kid,
_client=_client,
json_body=json_body,
kid=kid,
_client=_client,
json_body=json_body,
)
response = httpx.request(
@ -104,13 +131,13 @@ def sync_detailed(
return _build_response(response=response)
def sync(
set_: str,
kid: str,
*,
_client: Client,
json_body: JSONWebKey,
) -> Optional[Union[GenericError, JSONWebKey]]:
"""Update a JSON Web Key
@ -134,13 +161,14 @@ def sync(
Response[Union[GenericError, JSONWebKey]]
"""
return sync_detailed(
set_=set_,
kid=kid,
_client=_client,
json_body=json_body,
).parsed
kid=kid,
_client=_client,
json_body=json_body,
).parsed
async def asyncio_detailed(
set_: str,
@ -148,6 +176,7 @@ async def asyncio_detailed(
*,
_client: Client,
json_body: JSONWebKey,
) -> Response[Union[GenericError, JSONWebKey]]:
"""Update a JSON Web Key
@ -171,25 +200,29 @@ async def asyncio_detailed(
Response[Union[GenericError, JSONWebKey]]
"""
kwargs = _get_kwargs(
set_=set_,
kid=kid,
_client=_client,
json_body=json_body,
kid=kid,
_client=_client,
json_body=json_body,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
set_: str,
kid: str,
*,
_client: Client,
json_body: JSONWebKey,
) -> Optional[Union[GenericError, JSONWebKey]]:
"""Update a JSON Web Key
@ -213,11 +246,12 @@ async def asyncio(
Response[Union[GenericError, JSONWebKey]]
"""
return (
await asyncio_detailed(
set_=set_,
kid=kid,
_client=_client,
json_body=json_body,
)
).parsed
return (await asyncio_detailed(
set_=set_,
kid=kid,
_client=_client,
json_body=json_body,
)).parsed

View file

@ -1,11 +1,15 @@
from typing import Any, Dict, Optional, Union
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ...models.generic_error import GenericError
from typing import Dict
from typing import cast
from ...models.json_web_key_set import JSONWebKeySet
from ...types import Response
def _get_kwargs(
@ -13,16 +17,28 @@ def _get_kwargs(
*,
_client: Client,
json_body: JSONWebKeySet,
) -> Dict[str, Any]:
url = "{}/keys/{set}".format(_client.base_url, set=set_)
url = "{}/keys/{set}".format(
_client.base_url,set=set_)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
json_json_body = json_body.to_dict()
return {
"method": "put",
"method": "put",
"url": url,
"headers": headers,
"cookies": cookies,
@ -32,21 +48,29 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, JSONWebKeySet]]:
if response.status_code == 200:
if response.status_code == HTTPStatus.OK:
response_200 = JSONWebKeySet.from_dict(response.json())
return response_200
if response.status_code == 401:
if response.status_code == HTTPStatus.UNAUTHORIZED:
response_401 = GenericError.from_dict(response.json())
return response_401
if response.status_code == 403:
if response.status_code == HTTPStatus.FORBIDDEN:
response_403 = GenericError.from_dict(response.json())
return response_403
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -65,6 +89,7 @@ def sync_detailed(
*,
_client: Client,
json_body: JSONWebKeySet,
) -> Response[Union[GenericError, JSONWebKeySet]]:
"""Update a JSON Web Key Set
@ -90,10 +115,12 @@ def sync_detailed(
Response[Union[GenericError, JSONWebKeySet]]
"""
kwargs = _get_kwargs(
set_=set_,
_client=_client,
json_body=json_body,
_client=_client,
json_body=json_body,
)
response = httpx.request(
@ -103,12 +130,12 @@ def sync_detailed(
return _build_response(response=response)
def sync(
set_: str,
*,
_client: Client,
json_body: JSONWebKeySet,
) -> Optional[Union[GenericError, JSONWebKeySet]]:
"""Update a JSON Web Key Set
@ -134,18 +161,20 @@ def sync(
Response[Union[GenericError, JSONWebKeySet]]
"""
return sync_detailed(
set_=set_,
_client=_client,
json_body=json_body,
).parsed
_client=_client,
json_body=json_body,
).parsed
async def asyncio_detailed(
set_: str,
*,
_client: Client,
json_body: JSONWebKeySet,
) -> Response[Union[GenericError, JSONWebKeySet]]:
"""Update a JSON Web Key Set
@ -171,23 +200,27 @@ async def asyncio_detailed(
Response[Union[GenericError, JSONWebKeySet]]
"""
kwargs = _get_kwargs(
set_=set_,
_client=_client,
json_body=json_body,
_client=_client,
json_body=json_body,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
set_: str,
*,
_client: Client,
json_body: JSONWebKeySet,
) -> Optional[Union[GenericError, JSONWebKeySet]]:
"""Update a JSON Web Key Set
@ -213,10 +246,11 @@ async def asyncio(
Response[Union[GenericError, JSONWebKeySet]]
"""
return (
await asyncio_detailed(
set_=set_,
_client=_client,
json_body=json_body,
)
).parsed
return (await asyncio_detailed(
set_=set_,
_client=_client,
json_body=json_body,
)).parsed

View file

@ -1,11 +1,15 @@
from typing import Any, Dict, Optional, Union
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ...models.generic_error import GenericError
from typing import cast
from ...models.o_auth_2_client import OAuth2Client
from ...types import Response
from typing import Dict
def _get_kwargs(
@ -13,16 +17,28 @@ def _get_kwargs(
*,
_client: Client,
json_body: OAuth2Client,
) -> Dict[str, Any]:
url = "{}/clients/{id}".format(_client.base_url, id=id)
url = "{}/clients/{id}".format(
_client.base_url,id=id)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
json_json_body = json_body.to_dict()
return {
"method": "put",
"method": "put",
"url": url,
"headers": headers,
"cookies": cookies,
@ -32,13 +48,17 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, OAuth2Client]]:
if response.status_code == 200:
if response.status_code == HTTPStatus.OK:
response_200 = OAuth2Client.from_dict(response.json())
return response_200
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -57,6 +77,7 @@ def sync_detailed(
*,
_client: Client,
json_body: OAuth2Client,
) -> Response[Union[GenericError, OAuth2Client]]:
"""Update an OAuth 2.0 Client
@ -77,10 +98,12 @@ def sync_detailed(
Response[Union[GenericError, OAuth2Client]]
"""
kwargs = _get_kwargs(
id=id,
_client=_client,
json_body=json_body,
_client=_client,
json_body=json_body,
)
response = httpx.request(
@ -90,12 +113,12 @@ def sync_detailed(
return _build_response(response=response)
def sync(
id: str,
*,
_client: Client,
json_body: OAuth2Client,
) -> Optional[Union[GenericError, OAuth2Client]]:
"""Update an OAuth 2.0 Client
@ -116,18 +139,20 @@ def sync(
Response[Union[GenericError, OAuth2Client]]
"""
return sync_detailed(
id=id,
_client=_client,
json_body=json_body,
).parsed
_client=_client,
json_body=json_body,
).parsed
async def asyncio_detailed(
id: str,
*,
_client: Client,
json_body: OAuth2Client,
) -> Response[Union[GenericError, OAuth2Client]]:
"""Update an OAuth 2.0 Client
@ -148,23 +173,27 @@ async def asyncio_detailed(
Response[Union[GenericError, OAuth2Client]]
"""
kwargs = _get_kwargs(
id=id,
_client=_client,
json_body=json_body,
_client=_client,
json_body=json_body,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
id: str,
*,
_client: Client,
json_body: OAuth2Client,
) -> Optional[Union[GenericError, OAuth2Client]]:
"""Update an OAuth 2.0 Client
@ -185,10 +214,11 @@ async def asyncio(
Response[Union[GenericError, OAuth2Client]]
"""
return (
await asyncio_detailed(
id=id,
_client=_client,
json_body=json_body,
)
).parsed
return (await asyncio_detailed(
id=id,
_client=_client,
json_body=json_body,
)).parsed

View file

@ -1,22 +1,36 @@
from typing import Any, Dict
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...types import Response
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
def _get_kwargs(
*,
_client: Client,
) -> Dict[str, Any]:
url = "{}/oauth2/sessions/logout".format(_client.base_url)
url = "{}/oauth2/sessions/logout".format(
_client.base_url)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
return {
"method": "get",
"method": "get",
"url": url,
"headers": headers,
"cookies": cookies,
@ -24,6 +38,8 @@ def _get_kwargs(
}
def _build_response(*, response: httpx.Response) -> Response[Any]:
return Response(
status_code=response.status_code,
@ -36,6 +52,7 @@ def _build_response(*, response: httpx.Response) -> Response[Any]:
def sync_detailed(
*,
_client: Client,
) -> Response[Any]:
"""OpenID Connect Front-Backchannel Enabled Logout
@ -49,8 +66,10 @@ def sync_detailed(
Response[Any]
"""
kwargs = _get_kwargs(
_client=_client,
)
response = httpx.request(
@ -64,6 +83,7 @@ def sync_detailed(
async def asyncio_detailed(
*,
_client: Client,
) -> Response[Any]:
"""OpenID Connect Front-Backchannel Enabled Logout
@ -77,11 +97,17 @@ async def asyncio_detailed(
Response[Any]
"""
kwargs = _get_kwargs(
_client=_client,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)

View file

@ -1,24 +1,40 @@
from typing import Any, Dict, Optional, Union
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ...models.generic_error import GenericError
from typing import Dict
from typing import cast
from ...models.well_known import WellKnown
from ...types import Response
def _get_kwargs(
*,
_client: Client,
) -> Dict[str, Any]:
url = "{}/.well-known/openid-configuration".format(_client.base_url)
url = "{}/.well-known/openid-configuration".format(
_client.base_url)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
return {
"method": "get",
"method": "get",
"url": url,
"headers": headers,
"cookies": cookies,
@ -27,17 +43,23 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, WellKnown]]:
if response.status_code == 200:
if response.status_code == HTTPStatus.OK:
response_200 = WellKnown.from_dict(response.json())
return response_200
if response.status_code == 401:
if response.status_code == HTTPStatus.UNAUTHORIZED:
response_401 = GenericError.from_dict(response.json())
return response_401
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -54,6 +76,7 @@ def _build_response(*, response: httpx.Response) -> Response[Union[GenericError,
def sync_detailed(
*,
_client: Client,
) -> Response[Union[GenericError, WellKnown]]:
"""OpenID Connect Discovery
@ -71,8 +94,10 @@ def sync_detailed(
Response[Union[GenericError, WellKnown]]
"""
kwargs = _get_kwargs(
_client=_client,
)
response = httpx.request(
@ -82,10 +107,10 @@ def sync_detailed(
return _build_response(response=response)
def sync(
*,
_client: Client,
) -> Optional[Union[GenericError, WellKnown]]:
"""OpenID Connect Discovery
@ -103,14 +128,16 @@ def sync(
Response[Union[GenericError, WellKnown]]
"""
return sync_detailed(
_client=_client,
).parsed
).parsed
async def asyncio_detailed(
*,
_client: Client,
) -> Response[Union[GenericError, WellKnown]]:
"""OpenID Connect Discovery
@ -128,19 +155,23 @@ async def asyncio_detailed(
Response[Union[GenericError, WellKnown]]
"""
kwargs = _get_kwargs(
_client=_client,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
*,
_client: Client,
) -> Optional[Union[GenericError, WellKnown]]:
"""OpenID Connect Discovery
@ -158,8 +189,9 @@ async def asyncio(
Response[Union[GenericError, WellKnown]]
"""
return (
await asyncio_detailed(
_client=_client,
)
).parsed
return (await asyncio_detailed(
_client=_client,
)).parsed

View file

@ -1,24 +1,40 @@
from typing import Any, Dict, Optional, Union
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...models.health_not_ready_status import HealthNotReadyStatus
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ...models.health_status import HealthStatus
from ...types import Response
from typing import cast
from ...models.health_not_ready_status import HealthNotReadyStatus
from typing import Dict
def _get_kwargs(
*,
_client: Client,
) -> Dict[str, Any]:
url = "{}/health/ready".format(_client.base_url)
url = "{}/health/ready".format(
_client.base_url)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
return {
"method": "get",
"method": "get",
"url": url,
"headers": headers,
"cookies": cookies,
@ -27,13 +43,17 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[HealthNotReadyStatus, HealthStatus]]:
if response.status_code == 200:
if response.status_code == HTTPStatus.OK:
response_200 = HealthStatus.from_dict(response.json())
return response_200
if response.status_code == 503:
if response.status_code == HTTPStatus.SERVICE_UNAVAILABLE:
response_503 = HealthNotReadyStatus.from_dict(response.json())
return response_503
return None
@ -50,6 +70,7 @@ def _build_response(*, response: httpx.Response) -> Response[Union[HealthNotRead
def sync_detailed(
*,
_client: Client,
) -> Response[Union[HealthNotReadyStatus, HealthStatus]]:
"""Check Readiness Status
@ -67,8 +88,10 @@ def sync_detailed(
Response[Union[HealthNotReadyStatus, HealthStatus]]
"""
kwargs = _get_kwargs(
_client=_client,
)
response = httpx.request(
@ -78,10 +101,10 @@ def sync_detailed(
return _build_response(response=response)
def sync(
*,
_client: Client,
) -> Optional[Union[HealthNotReadyStatus, HealthStatus]]:
"""Check Readiness Status
@ -99,14 +122,16 @@ def sync(
Response[Union[HealthNotReadyStatus, HealthStatus]]
"""
return sync_detailed(
_client=_client,
).parsed
).parsed
async def asyncio_detailed(
*,
_client: Client,
) -> Response[Union[HealthNotReadyStatus, HealthStatus]]:
"""Check Readiness Status
@ -124,19 +149,23 @@ async def asyncio_detailed(
Response[Union[HealthNotReadyStatus, HealthStatus]]
"""
kwargs = _get_kwargs(
_client=_client,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
*,
_client: Client,
) -> Optional[Union[HealthNotReadyStatus, HealthStatus]]:
"""Check Readiness Status
@ -154,8 +183,9 @@ async def asyncio(
Response[Union[HealthNotReadyStatus, HealthStatus]]
"""
return (
await asyncio_detailed(
_client=_client,
)
).parsed
return (await asyncio_detailed(
_client=_client,
)).parsed

View file

@ -1,24 +1,41 @@
from typing import Any, Dict, Optional, Union
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient
from ...models.generic_error import GenericError
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from typing import Dict
from ...models.oauth_2_token_response import Oauth2TokenResponse
from ...types import Response
from typing import cast
from ...models.oauth_2_token_data import Oauth2TokenData
from ...models.generic_error import GenericError
def _get_kwargs(
*,
_client: AuthenticatedClient,
) -> Dict[str, Any]:
url = "{}/oauth2/token".format(_client.base_url)
url = "{}/oauth2/token".format(
_client.base_url)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
return {
"method": "post",
"method": "post",
"url": url,
"headers": headers,
"cookies": cookies,
@ -27,21 +44,29 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, Oauth2TokenResponse]]:
if response.status_code == 200:
if response.status_code == HTTPStatus.OK:
response_200 = Oauth2TokenResponse.from_dict(response.json())
return response_200
if response.status_code == 400:
if response.status_code == HTTPStatus.BAD_REQUEST:
response_400 = GenericError.from_dict(response.json())
return response_400
if response.status_code == 401:
if response.status_code == HTTPStatus.UNAUTHORIZED:
response_401 = GenericError.from_dict(response.json())
return response_401
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -58,6 +83,7 @@ def _build_response(*, response: httpx.Response) -> Response[Union[GenericError,
def sync_detailed(
*,
_client: AuthenticatedClient,
) -> Response[Union[GenericError, Oauth2TokenResponse]]:
"""The OAuth 2.0 Token Endpoint
@ -76,8 +102,10 @@ def sync_detailed(
Response[Union[GenericError, Oauth2TokenResponse]]
"""
kwargs = _get_kwargs(
_client=_client,
)
response = httpx.request(
@ -87,10 +115,10 @@ def sync_detailed(
return _build_response(response=response)
def sync(
*,
_client: AuthenticatedClient,
) -> Optional[Union[GenericError, Oauth2TokenResponse]]:
"""The OAuth 2.0 Token Endpoint
@ -109,14 +137,16 @@ def sync(
Response[Union[GenericError, Oauth2TokenResponse]]
"""
return sync_detailed(
_client=_client,
).parsed
).parsed
async def asyncio_detailed(
*,
_client: AuthenticatedClient,
) -> Response[Union[GenericError, Oauth2TokenResponse]]:
"""The OAuth 2.0 Token Endpoint
@ -135,19 +165,23 @@ async def asyncio_detailed(
Response[Union[GenericError, Oauth2TokenResponse]]
"""
kwargs = _get_kwargs(
_client=_client,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
*,
_client: AuthenticatedClient,
) -> Optional[Union[GenericError, Oauth2TokenResponse]]:
"""The OAuth 2.0 Token Endpoint
@ -166,8 +200,9 @@ async def asyncio(
Response[Union[GenericError, Oauth2TokenResponse]]
"""
return (
await asyncio_detailed(
_client=_client,
)
).parsed
return (await asyncio_detailed(
_client=_client,
)).parsed

View file

@ -1,23 +1,39 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ...models.generic_error import GenericError
from ...types import Response
from typing import cast
from typing import Dict
def _get_kwargs(
*,
_client: Client,
) -> Dict[str, Any]:
url = "{}/oauth2/auth".format(_client.base_url)
url = "{}/oauth2/auth".format(
_client.base_url)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
return {
"method": "get",
"method": "get",
"url": url,
"headers": headers,
"cookies": cookies,
@ -26,16 +42,20 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, GenericError]]:
if response.status_code == 302:
if response.status_code == HTTPStatus.FOUND:
response_302 = cast(Any, None)
return response_302
if response.status_code == 401:
if response.status_code == HTTPStatus.UNAUTHORIZED:
response_401 = GenericError.from_dict(response.json())
return response_401
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -52,6 +72,7 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, GenericE
def sync_detailed(
*,
_client: Client,
) -> Response[Union[Any, GenericError]]:
"""The OAuth 2.0 Authorize Endpoint
@ -65,8 +86,10 @@ def sync_detailed(
Response[Union[Any, GenericError]]
"""
kwargs = _get_kwargs(
_client=_client,
)
response = httpx.request(
@ -76,10 +99,10 @@ def sync_detailed(
return _build_response(response=response)
def sync(
*,
_client: Client,
) -> Optional[Union[Any, GenericError]]:
"""The OAuth 2.0 Authorize Endpoint
@ -93,14 +116,16 @@ def sync(
Response[Union[Any, GenericError]]
"""
return sync_detailed(
_client=_client,
).parsed
).parsed
async def asyncio_detailed(
*,
_client: Client,
) -> Response[Union[Any, GenericError]]:
"""The OAuth 2.0 Authorize Endpoint
@ -114,19 +139,23 @@ async def asyncio_detailed(
Response[Union[Any, GenericError]]
"""
kwargs = _get_kwargs(
_client=_client,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
*,
_client: Client,
) -> Optional[Union[Any, GenericError]]:
"""The OAuth 2.0 Authorize Endpoint
@ -140,8 +169,9 @@ async def asyncio(
Response[Union[Any, GenericError]]
"""
return (
await asyncio_detailed(
_client=_client,
)
).parsed
return (await asyncio_detailed(
_client=_client,
)).parsed

View file

@ -1,23 +1,40 @@
from typing import Any, Dict, Optional, Union, cast
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ...models.generic_error import GenericError
from ...types import Response
from ...models.revoke_o_auth_2_token_data import RevokeOAuth2TokenData
from typing import cast
from typing import Dict
def _get_kwargs(
*,
_client: AuthenticatedClient,
) -> Dict[str, Any]:
url = "{}/oauth2/revoke".format(_client.base_url)
url = "{}/oauth2/revoke".format(
_client.base_url)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
return {
"method": "post",
"method": "post",
"url": url,
"headers": headers,
"cookies": cookies,
@ -26,16 +43,20 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, GenericError]]:
if response.status_code == 200:
if response.status_code == HTTPStatus.OK:
response_200 = cast(Any, None)
return response_200
if response.status_code == 401:
if response.status_code == HTTPStatus.UNAUTHORIZED:
response_401 = GenericError.from_dict(response.json())
return response_401
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -52,6 +73,7 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, GenericE
def sync_detailed(
*,
_client: AuthenticatedClient,
) -> Response[Union[Any, GenericError]]:
"""Revoke OAuth2 Tokens
@ -67,8 +89,10 @@ def sync_detailed(
Response[Union[Any, GenericError]]
"""
kwargs = _get_kwargs(
_client=_client,
)
response = httpx.request(
@ -78,10 +102,10 @@ def sync_detailed(
return _build_response(response=response)
def sync(
*,
_client: AuthenticatedClient,
) -> Optional[Union[Any, GenericError]]:
"""Revoke OAuth2 Tokens
@ -97,14 +121,16 @@ def sync(
Response[Union[Any, GenericError]]
"""
return sync_detailed(
_client=_client,
).parsed
).parsed
async def asyncio_detailed(
*,
_client: AuthenticatedClient,
) -> Response[Union[Any, GenericError]]:
"""Revoke OAuth2 Tokens
@ -120,19 +146,23 @@ async def asyncio_detailed(
Response[Union[Any, GenericError]]
"""
kwargs = _get_kwargs(
_client=_client,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
*,
_client: AuthenticatedClient,
) -> Optional[Union[Any, GenericError]]:
"""Revoke OAuth2 Tokens
@ -148,8 +178,9 @@ async def asyncio(
Response[Union[Any, GenericError]]
"""
return (
await asyncio_detailed(
_client=_client,
)
).parsed
return (await asyncio_detailed(
_client=_client,
)).parsed

View file

@ -1,24 +1,40 @@
from typing import Any, Dict, Optional, Union
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import AuthenticatedClient
from ...models.generic_error import GenericError
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ...models.userinfo_response import UserinfoResponse
from ...types import Response
from ...models.generic_error import GenericError
from typing import cast
from typing import Dict
def _get_kwargs(
*,
_client: AuthenticatedClient,
) -> Dict[str, Any]:
url = "{}/userinfo".format(_client.base_url)
url = "{}/userinfo".format(
_client.base_url)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
return {
"method": "get",
"method": "get",
"url": url,
"headers": headers,
"cookies": cookies,
@ -27,17 +43,23 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, UserinfoResponse]]:
if response.status_code == 200:
if response.status_code == HTTPStatus.OK:
response_200 = UserinfoResponse.from_dict(response.json())
return response_200
if response.status_code == 401:
if response.status_code == HTTPStatus.UNAUTHORIZED:
response_401 = GenericError.from_dict(response.json())
return response_401
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -54,6 +76,7 @@ def _build_response(*, response: httpx.Response) -> Response[Union[GenericError,
def sync_detailed(
*,
_client: AuthenticatedClient,
) -> Response[Union[GenericError, UserinfoResponse]]:
"""OpenID Connect Userinfo
@ -67,8 +90,10 @@ def sync_detailed(
Response[Union[GenericError, UserinfoResponse]]
"""
kwargs = _get_kwargs(
_client=_client,
)
response = httpx.request(
@ -78,10 +103,10 @@ def sync_detailed(
return _build_response(response=response)
def sync(
*,
_client: AuthenticatedClient,
) -> Optional[Union[GenericError, UserinfoResponse]]:
"""OpenID Connect Userinfo
@ -95,14 +120,16 @@ def sync(
Response[Union[GenericError, UserinfoResponse]]
"""
return sync_detailed(
_client=_client,
).parsed
).parsed
async def asyncio_detailed(
*,
_client: AuthenticatedClient,
) -> Response[Union[GenericError, UserinfoResponse]]:
"""OpenID Connect Userinfo
@ -116,19 +143,23 @@ async def asyncio_detailed(
Response[Union[GenericError, UserinfoResponse]]
"""
kwargs = _get_kwargs(
_client=_client,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
*,
_client: AuthenticatedClient,
) -> Optional[Union[GenericError, UserinfoResponse]]:
"""OpenID Connect Userinfo
@ -142,8 +173,9 @@ async def asyncio(
Response[Union[GenericError, UserinfoResponse]]
"""
return (
await asyncio_detailed(
_client=_client,
)
).parsed
return (await asyncio_detailed(
_client=_client,
)).parsed

View file

@ -1,24 +1,40 @@
from typing import Any, Dict, Optional, Union
from typing import Any, Dict, List, Optional, Union, cast
import httpx
from ...client import Client
from ...client import AuthenticatedClient, Client
from ...types import Response, UNSET
from ...models.generic_error import GenericError
from ...models.json_web_key_set import JSONWebKeySet
from ...types import Response
from typing import cast
from typing import Dict
def _get_kwargs(
*,
_client: Client,
) -> Dict[str, Any]:
url = "{}/.well-known/jwks.json".format(_client.base_url)
url = "{}/.well-known/jwks.json".format(
_client.base_url)
headers: Dict[str, str] = _client.get_headers()
cookies: Dict[str, Any] = _client.get_cookies()
return {
"method": "get",
"method": "get",
"url": url,
"headers": headers,
"cookies": cookies,
@ -27,13 +43,17 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, JSONWebKeySet]]:
if response.status_code == 200:
if response.status_code == HTTPStatus.OK:
response_200 = JSONWebKeySet.from_dict(response.json())
return response_200
if response.status_code == 500:
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
response_500 = GenericError.from_dict(response.json())
return response_500
return None
@ -50,6 +70,7 @@ def _build_response(*, response: httpx.Response) -> Response[Union[GenericError,
def sync_detailed(
*,
_client: Client,
) -> Response[Union[GenericError, JSONWebKeySet]]:
"""JSON Web Keys Discovery
@ -62,8 +83,10 @@ def sync_detailed(
Response[Union[GenericError, JSONWebKeySet]]
"""
kwargs = _get_kwargs(
_client=_client,
)
response = httpx.request(
@ -73,10 +96,10 @@ def sync_detailed(
return _build_response(response=response)
def sync(
*,
_client: Client,
) -> Optional[Union[GenericError, JSONWebKeySet]]:
"""JSON Web Keys Discovery
@ -89,14 +112,16 @@ def sync(
Response[Union[GenericError, JSONWebKeySet]]
"""
return sync_detailed(
_client=_client,
).parsed
).parsed
async def asyncio_detailed(
*,
_client: Client,
) -> Response[Union[GenericError, JSONWebKeySet]]:
"""JSON Web Keys Discovery
@ -109,19 +134,23 @@ async def asyncio_detailed(
Response[Union[GenericError, JSONWebKeySet]]
"""
kwargs = _get_kwargs(
_client=_client,
)
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
response = await __client.request(**kwargs)
response = await __client.request(
**kwargs
)
return _build_response(response=response)
async def asyncio(
*,
_client: Client,
) -> Optional[Union[GenericError, JSONWebKeySet]]:
"""JSON Web Keys Discovery
@ -134,8 +163,9 @@ async def asyncio(
Response[Union[GenericError, JSONWebKeySet]]
"""
return (
await asyncio_detailed(
_client=_client,
)
).parsed
return (await asyncio_detailed(
_client=_client,
)).parsed