add openapi-python-client generator + client
This commit is contained in:
@@ -0,0 +1 @@
|
||||
"""Contains endpoint functions for accessing the API"""
|
||||
+199
@@ -0,0 +1,199 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.completion_started import CompletionStarted
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
body: Union[
|
||||
CompletionStarted,
|
||||
CompletionStarted,
|
||||
CompletionStarted,
|
||||
],
|
||||
) -> dict[str, Any]:
|
||||
headers: dict[str, Any] = {}
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "post",
|
||||
"url": "/api/v2/modules_completion/completion_started/",
|
||||
}
|
||||
|
||||
if isinstance(body, CompletionStarted):
|
||||
_kwargs["json"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/json"
|
||||
if isinstance(body, CompletionStarted):
|
||||
_kwargs["data"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded"
|
||||
if isinstance(body, CompletionStarted):
|
||||
_kwargs["files"] = body.to_multipart()
|
||||
|
||||
headers["Content-Type"] = "multipart/form-data"
|
||||
|
||||
_kwargs["headers"] = headers
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[CompletionStarted]:
|
||||
if response.status_code == 201:
|
||||
response_201 = CompletionStarted.from_dict(response.json())
|
||||
|
||||
return response_201
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[CompletionStarted]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
CompletionStarted,
|
||||
CompletionStarted,
|
||||
CompletionStarted,
|
||||
],
|
||||
) -> Response[CompletionStarted]:
|
||||
"""ViewSet to tell the backend that the customer has reached the ticket office summary page.
|
||||
It will trigger hooks that, for example, send a payment reminder email.
|
||||
|
||||
Args:
|
||||
body (CompletionStarted): Serializer for CompletionStartedViewSet
|
||||
body (CompletionStarted): Serializer for CompletionStartedViewSet
|
||||
body (CompletionStarted): Serializer for CompletionStartedViewSet
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[CompletionStarted]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
CompletionStarted,
|
||||
CompletionStarted,
|
||||
CompletionStarted,
|
||||
],
|
||||
) -> Optional[CompletionStarted]:
|
||||
"""ViewSet to tell the backend that the customer has reached the ticket office summary page.
|
||||
It will trigger hooks that, for example, send a payment reminder email.
|
||||
|
||||
Args:
|
||||
body (CompletionStarted): Serializer for CompletionStartedViewSet
|
||||
body (CompletionStarted): Serializer for CompletionStartedViewSet
|
||||
body (CompletionStarted): Serializer for CompletionStartedViewSet
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
CompletionStarted
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
body=body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
CompletionStarted,
|
||||
CompletionStarted,
|
||||
CompletionStarted,
|
||||
],
|
||||
) -> Response[CompletionStarted]:
|
||||
"""ViewSet to tell the backend that the customer has reached the ticket office summary page.
|
||||
It will trigger hooks that, for example, send a payment reminder email.
|
||||
|
||||
Args:
|
||||
body (CompletionStarted): Serializer for CompletionStartedViewSet
|
||||
body (CompletionStarted): Serializer for CompletionStartedViewSet
|
||||
body (CompletionStarted): Serializer for CompletionStartedViewSet
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[CompletionStarted]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
CompletionStarted,
|
||||
CompletionStarted,
|
||||
CompletionStarted,
|
||||
],
|
||||
) -> Optional[CompletionStarted]:
|
||||
"""ViewSet to tell the backend that the customer has reached the ticket office summary page.
|
||||
It will trigger hooks that, for example, send a payment reminder email.
|
||||
|
||||
Args:
|
||||
body (CompletionStarted): Serializer for CompletionStartedViewSet
|
||||
body (CompletionStarted): Serializer for CompletionStartedViewSet
|
||||
body (CompletionStarted): Serializer for CompletionStartedViewSet
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
CompletionStarted
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
body=body,
|
||||
)
|
||||
).parsed
|
||||
+207
@@ -0,0 +1,207 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.confirmation_page_extra_text_active_module import ConfirmationPageExtraTextActiveModule
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
body: Union[
|
||||
ConfirmationPageExtraTextActiveModule,
|
||||
ConfirmationPageExtraTextActiveModule,
|
||||
ConfirmationPageExtraTextActiveModule,
|
||||
],
|
||||
) -> dict[str, Any]:
|
||||
headers: dict[str, Any] = {}
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "post",
|
||||
"url": "/api/v2/modules_completion/confirmation_page_extra_text/modules/",
|
||||
}
|
||||
|
||||
if isinstance(body, ConfirmationPageExtraTextActiveModule):
|
||||
_kwargs["json"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/json"
|
||||
if isinstance(body, ConfirmationPageExtraTextActiveModule):
|
||||
_kwargs["data"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded"
|
||||
if isinstance(body, ConfirmationPageExtraTextActiveModule):
|
||||
_kwargs["files"] = body.to_multipart()
|
||||
|
||||
headers["Content-Type"] = "multipart/form-data"
|
||||
|
||||
_kwargs["headers"] = headers
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[ConfirmationPageExtraTextActiveModule]:
|
||||
if response.status_code == 201:
|
||||
response_201 = ConfirmationPageExtraTextActiveModule.from_dict(response.json())
|
||||
|
||||
return response_201
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[ConfirmationPageExtraTextActiveModule]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
ConfirmationPageExtraTextActiveModule,
|
||||
ConfirmationPageExtraTextActiveModule,
|
||||
ConfirmationPageExtraTextActiveModule,
|
||||
],
|
||||
) -> Response[ConfirmationPageExtraTextActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText`.
|
||||
|
||||
Args:
|
||||
body (ConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionConfirmationPageExtraText`
|
||||
body (ConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionConfirmationPageExtraText`
|
||||
body (ConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionConfirmationPageExtraText`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ConfirmationPageExtraTextActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
ConfirmationPageExtraTextActiveModule,
|
||||
ConfirmationPageExtraTextActiveModule,
|
||||
ConfirmationPageExtraTextActiveModule,
|
||||
],
|
||||
) -> Optional[ConfirmationPageExtraTextActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText`.
|
||||
|
||||
Args:
|
||||
body (ConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionConfirmationPageExtraText`
|
||||
body (ConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionConfirmationPageExtraText`
|
||||
body (ConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionConfirmationPageExtraText`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ConfirmationPageExtraTextActiveModule
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
body=body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
ConfirmationPageExtraTextActiveModule,
|
||||
ConfirmationPageExtraTextActiveModule,
|
||||
ConfirmationPageExtraTextActiveModule,
|
||||
],
|
||||
) -> Response[ConfirmationPageExtraTextActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText`.
|
||||
|
||||
Args:
|
||||
body (ConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionConfirmationPageExtraText`
|
||||
body (ConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionConfirmationPageExtraText`
|
||||
body (ConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionConfirmationPageExtraText`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ConfirmationPageExtraTextActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
ConfirmationPageExtraTextActiveModule,
|
||||
ConfirmationPageExtraTextActiveModule,
|
||||
ConfirmationPageExtraTextActiveModule,
|
||||
],
|
||||
) -> Optional[ConfirmationPageExtraTextActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText`.
|
||||
|
||||
Args:
|
||||
body (ConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionConfirmationPageExtraText`
|
||||
body (ConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionConfirmationPageExtraText`
|
||||
body (ConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionConfirmationPageExtraText`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ConfirmationPageExtraTextActiveModule
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
body=body,
|
||||
)
|
||||
).parsed
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: int,
|
||||
) -> dict[str, Any]:
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "delete",
|
||||
"url": f"/api/v2/modules_completion/confirmation_page_extra_text/modules/{id}/",
|
||||
}
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
||||
if response.status_code == 204:
|
||||
return None
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Response[Any]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Response[Any]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
+220
@@ -0,0 +1,220 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.paginated_confirmation_page_extra_text_active_module_list import (
|
||||
PaginatedConfirmationPageExtraTextActiveModuleList,
|
||||
)
|
||||
from ...types import UNSET, Response, Unset
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> dict[str, Any]:
|
||||
params: dict[str, Any] = {}
|
||||
|
||||
params["event"] = event
|
||||
|
||||
params["o"] = o
|
||||
|
||||
params["offset"] = offset
|
||||
|
||||
params["page_limit"] = page_limit
|
||||
|
||||
params["q"] = q
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "get",
|
||||
"url": "/api/v2/modules_completion/confirmation_page_extra_text/modules/",
|
||||
"params": params,
|
||||
}
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[PaginatedConfirmationPageExtraTextActiveModuleList]:
|
||||
if response.status_code == 200:
|
||||
response_200 = PaginatedConfirmationPageExtraTextActiveModuleList.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[PaginatedConfirmationPageExtraTextActiveModuleList]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Response[PaginatedConfirmationPageExtraTextActiveModuleList]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText`.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, int]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[PaginatedConfirmationPageExtraTextActiveModuleList]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Optional[PaginatedConfirmationPageExtraTextActiveModuleList]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText`.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, int]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
PaginatedConfirmationPageExtraTextActiveModuleList
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Response[PaginatedConfirmationPageExtraTextActiveModuleList]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText`.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, int]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[PaginatedConfirmationPageExtraTextActiveModuleList]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Optional[PaginatedConfirmationPageExtraTextActiveModuleList]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText`.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, int]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
PaginatedConfirmationPageExtraTextActiveModuleList
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
).parsed
|
||||
+229
@@ -0,0 +1,229 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.confirmation_page_extra_text_active_module import ConfirmationPageExtraTextActiveModule
|
||||
from ...models.patched_confirmation_page_extra_text_active_module import PatchedConfirmationPageExtraTextActiveModule
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: int,
|
||||
*,
|
||||
body: Union[
|
||||
PatchedConfirmationPageExtraTextActiveModule,
|
||||
PatchedConfirmationPageExtraTextActiveModule,
|
||||
PatchedConfirmationPageExtraTextActiveModule,
|
||||
],
|
||||
) -> dict[str, Any]:
|
||||
headers: dict[str, Any] = {}
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "patch",
|
||||
"url": f"/api/v2/modules_completion/confirmation_page_extra_text/modules/{id}/",
|
||||
}
|
||||
|
||||
if isinstance(body, PatchedConfirmationPageExtraTextActiveModule):
|
||||
_kwargs["json"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/json"
|
||||
if isinstance(body, PatchedConfirmationPageExtraTextActiveModule):
|
||||
_kwargs["data"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded"
|
||||
if isinstance(body, PatchedConfirmationPageExtraTextActiveModule):
|
||||
_kwargs["files"] = body.to_multipart()
|
||||
|
||||
headers["Content-Type"] = "multipart/form-data"
|
||||
|
||||
_kwargs["headers"] = headers
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[ConfirmationPageExtraTextActiveModule]:
|
||||
if response.status_code == 200:
|
||||
response_200 = ConfirmationPageExtraTextActiveModule.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[ConfirmationPageExtraTextActiveModule]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedConfirmationPageExtraTextActiveModule,
|
||||
PatchedConfirmationPageExtraTextActiveModule,
|
||||
PatchedConfirmationPageExtraTextActiveModule,
|
||||
],
|
||||
) -> Response[ConfirmationPageExtraTextActiveModule]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionConfirmationPageExtraText`
|
||||
body (PatchedConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionConfirmationPageExtraText`
|
||||
body (PatchedConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionConfirmationPageExtraText`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ConfirmationPageExtraTextActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedConfirmationPageExtraTextActiveModule,
|
||||
PatchedConfirmationPageExtraTextActiveModule,
|
||||
PatchedConfirmationPageExtraTextActiveModule,
|
||||
],
|
||||
) -> Optional[ConfirmationPageExtraTextActiveModule]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionConfirmationPageExtraText`
|
||||
body (PatchedConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionConfirmationPageExtraText`
|
||||
body (PatchedConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionConfirmationPageExtraText`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ConfirmationPageExtraTextActiveModule
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
body=body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedConfirmationPageExtraTextActiveModule,
|
||||
PatchedConfirmationPageExtraTextActiveModule,
|
||||
PatchedConfirmationPageExtraTextActiveModule,
|
||||
],
|
||||
) -> Response[ConfirmationPageExtraTextActiveModule]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionConfirmationPageExtraText`
|
||||
body (PatchedConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionConfirmationPageExtraText`
|
||||
body (PatchedConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionConfirmationPageExtraText`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ConfirmationPageExtraTextActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedConfirmationPageExtraTextActiveModule,
|
||||
PatchedConfirmationPageExtraTextActiveModule,
|
||||
PatchedConfirmationPageExtraTextActiveModule,
|
||||
],
|
||||
) -> Optional[ConfirmationPageExtraTextActiveModule]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionConfirmationPageExtraText`
|
||||
body (PatchedConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionConfirmationPageExtraText`
|
||||
body (PatchedConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionConfirmationPageExtraText`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ConfirmationPageExtraTextActiveModule
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
body=body,
|
||||
)
|
||||
).parsed
|
||||
+150
@@ -0,0 +1,150 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.confirmation_page_extra_text_active_module import ConfirmationPageExtraTextActiveModule
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: int,
|
||||
) -> dict[str, Any]:
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "get",
|
||||
"url": f"/api/v2/modules_completion/confirmation_page_extra_text/modules/{id}/",
|
||||
}
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[ConfirmationPageExtraTextActiveModule]:
|
||||
if response.status_code == 200:
|
||||
response_200 = ConfirmationPageExtraTextActiveModule.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[ConfirmationPageExtraTextActiveModule]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Response[ConfirmationPageExtraTextActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ConfirmationPageExtraTextActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Optional[ConfirmationPageExtraTextActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ConfirmationPageExtraTextActiveModule
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Response[ConfirmationPageExtraTextActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ConfirmationPageExtraTextActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Optional[ConfirmationPageExtraTextActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ConfirmationPageExtraTextActiveModule
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
+209
@@ -0,0 +1,209 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.module_completion_email_registration_completed_active_module import (
|
||||
ModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
)
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
body: Union[
|
||||
ModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
ModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
ModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
],
|
||||
) -> dict[str, Any]:
|
||||
headers: dict[str, Any] = {}
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "post",
|
||||
"url": "/api/v2/modules_completion/email_registration_completed_simple/modules/",
|
||||
}
|
||||
|
||||
if isinstance(body, ModuleCompletionEmailRegistrationCompletedActiveModule):
|
||||
_kwargs["json"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/json"
|
||||
if isinstance(body, ModuleCompletionEmailRegistrationCompletedActiveModule):
|
||||
_kwargs["data"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded"
|
||||
if isinstance(body, ModuleCompletionEmailRegistrationCompletedActiveModule):
|
||||
_kwargs["files"] = body.to_multipart()
|
||||
|
||||
headers["Content-Type"] = "multipart/form-data"
|
||||
|
||||
_kwargs["headers"] = headers
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[ModuleCompletionEmailRegistrationCompletedActiveModule]:
|
||||
if response.status_code == 201:
|
||||
response_201 = ModuleCompletionEmailRegistrationCompletedActiveModule.from_dict(response.json())
|
||||
|
||||
return response_201
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[ModuleCompletionEmailRegistrationCompletedActiveModule]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
ModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
ModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
ModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
],
|
||||
) -> Response[ModuleCompletionEmailRegistrationCompletedActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`.
|
||||
|
||||
Args:
|
||||
body (ModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`
|
||||
body (ModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`
|
||||
body (ModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ModuleCompletionEmailRegistrationCompletedActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
ModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
ModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
ModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
],
|
||||
) -> Optional[ModuleCompletionEmailRegistrationCompletedActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`.
|
||||
|
||||
Args:
|
||||
body (ModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`
|
||||
body (ModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`
|
||||
body (ModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ModuleCompletionEmailRegistrationCompletedActiveModule
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
body=body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
ModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
ModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
ModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
],
|
||||
) -> Response[ModuleCompletionEmailRegistrationCompletedActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`.
|
||||
|
||||
Args:
|
||||
body (ModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`
|
||||
body (ModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`
|
||||
body (ModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ModuleCompletionEmailRegistrationCompletedActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
ModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
ModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
ModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
],
|
||||
) -> Optional[ModuleCompletionEmailRegistrationCompletedActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`.
|
||||
|
||||
Args:
|
||||
body (ModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`
|
||||
body (ModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`
|
||||
body (ModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ModuleCompletionEmailRegistrationCompletedActiveModule
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
body=body,
|
||||
)
|
||||
).parsed
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: int,
|
||||
) -> dict[str, Any]:
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "delete",
|
||||
"url": f"/api/v2/modules_completion/email_registration_completed_simple/modules/{id}/",
|
||||
}
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
||||
if response.status_code == 204:
|
||||
return None
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Response[Any]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Response[Any]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
+220
@@ -0,0 +1,220 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.paginated_module_completion_email_registration_completed_active_module_list import (
|
||||
PaginatedModuleCompletionEmailRegistrationCompletedActiveModuleList,
|
||||
)
|
||||
from ...types import UNSET, Response, Unset
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> dict[str, Any]:
|
||||
params: dict[str, Any] = {}
|
||||
|
||||
params["event"] = event
|
||||
|
||||
params["o"] = o
|
||||
|
||||
params["offset"] = offset
|
||||
|
||||
params["page_limit"] = page_limit
|
||||
|
||||
params["q"] = q
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "get",
|
||||
"url": "/api/v2/modules_completion/email_registration_completed_simple/modules/",
|
||||
"params": params,
|
||||
}
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[PaginatedModuleCompletionEmailRegistrationCompletedActiveModuleList]:
|
||||
if response.status_code == 200:
|
||||
response_200 = PaginatedModuleCompletionEmailRegistrationCompletedActiveModuleList.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[PaginatedModuleCompletionEmailRegistrationCompletedActiveModuleList]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Response[PaginatedModuleCompletionEmailRegistrationCompletedActiveModuleList]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, int]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[PaginatedModuleCompletionEmailRegistrationCompletedActiveModuleList]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Optional[PaginatedModuleCompletionEmailRegistrationCompletedActiveModuleList]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, int]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
PaginatedModuleCompletionEmailRegistrationCompletedActiveModuleList
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Response[PaginatedModuleCompletionEmailRegistrationCompletedActiveModuleList]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, int]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[PaginatedModuleCompletionEmailRegistrationCompletedActiveModuleList]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Optional[PaginatedModuleCompletionEmailRegistrationCompletedActiveModuleList]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, int]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
PaginatedModuleCompletionEmailRegistrationCompletedActiveModuleList
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
).parsed
|
||||
+233
@@ -0,0 +1,233 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.module_completion_email_registration_completed_active_module import (
|
||||
ModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
)
|
||||
from ...models.patched_module_completion_email_registration_completed_active_module import (
|
||||
PatchedModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
)
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: int,
|
||||
*,
|
||||
body: Union[
|
||||
PatchedModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
PatchedModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
PatchedModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
],
|
||||
) -> dict[str, Any]:
|
||||
headers: dict[str, Any] = {}
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "patch",
|
||||
"url": f"/api/v2/modules_completion/email_registration_completed_simple/modules/{id}/",
|
||||
}
|
||||
|
||||
if isinstance(body, PatchedModuleCompletionEmailRegistrationCompletedActiveModule):
|
||||
_kwargs["json"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/json"
|
||||
if isinstance(body, PatchedModuleCompletionEmailRegistrationCompletedActiveModule):
|
||||
_kwargs["data"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded"
|
||||
if isinstance(body, PatchedModuleCompletionEmailRegistrationCompletedActiveModule):
|
||||
_kwargs["files"] = body.to_multipart()
|
||||
|
||||
headers["Content-Type"] = "multipart/form-data"
|
||||
|
||||
_kwargs["headers"] = headers
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[ModuleCompletionEmailRegistrationCompletedActiveModule]:
|
||||
if response.status_code == 200:
|
||||
response_200 = ModuleCompletionEmailRegistrationCompletedActiveModule.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[ModuleCompletionEmailRegistrationCompletedActiveModule]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
PatchedModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
PatchedModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
],
|
||||
) -> Response[ModuleCompletionEmailRegistrationCompletedActiveModule]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`
|
||||
body (PatchedModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`
|
||||
body (PatchedModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ModuleCompletionEmailRegistrationCompletedActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
PatchedModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
PatchedModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
],
|
||||
) -> Optional[ModuleCompletionEmailRegistrationCompletedActiveModule]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`
|
||||
body (PatchedModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`
|
||||
body (PatchedModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ModuleCompletionEmailRegistrationCompletedActiveModule
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
body=body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
PatchedModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
PatchedModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
],
|
||||
) -> Response[ModuleCompletionEmailRegistrationCompletedActiveModule]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`
|
||||
body (PatchedModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`
|
||||
body (PatchedModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ModuleCompletionEmailRegistrationCompletedActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
PatchedModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
PatchedModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
],
|
||||
) -> Optional[ModuleCompletionEmailRegistrationCompletedActiveModule]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`
|
||||
body (PatchedModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`
|
||||
body (PatchedModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ModuleCompletionEmailRegistrationCompletedActiveModule
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
body=body,
|
||||
)
|
||||
).parsed
|
||||
+152
@@ -0,0 +1,152 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.module_completion_email_registration_completed_active_module import (
|
||||
ModuleCompletionEmailRegistrationCompletedActiveModule,
|
||||
)
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: int,
|
||||
) -> dict[str, Any]:
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "get",
|
||||
"url": f"/api/v2/modules_completion/email_registration_completed_simple/modules/{id}/",
|
||||
}
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[ModuleCompletionEmailRegistrationCompletedActiveModule]:
|
||||
if response.status_code == 200:
|
||||
response_200 = ModuleCompletionEmailRegistrationCompletedActiveModule.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[ModuleCompletionEmailRegistrationCompletedActiveModule]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Response[ModuleCompletionEmailRegistrationCompletedActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ModuleCompletionEmailRegistrationCompletedActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Optional[ModuleCompletionEmailRegistrationCompletedActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ModuleCompletionEmailRegistrationCompletedActiveModule
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Response[ModuleCompletionEmailRegistrationCompletedActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ModuleCompletionEmailRegistrationCompletedActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Optional[ModuleCompletionEmailRegistrationCompletedActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ModuleCompletionEmailRegistrationCompletedActiveModule
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
+209
@@ -0,0 +1,209 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.module_completion_email_registration_creation_active_module import (
|
||||
ModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
)
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
body: Union[
|
||||
ModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
ModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
ModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
],
|
||||
) -> dict[str, Any]:
|
||||
headers: dict[str, Any] = {}
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "post",
|
||||
"url": "/api/v2/modules_completion/email_registration_creation/modules/",
|
||||
}
|
||||
|
||||
if isinstance(body, ModuleCompletionEmailRegistrationCreationActiveModule):
|
||||
_kwargs["json"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/json"
|
||||
if isinstance(body, ModuleCompletionEmailRegistrationCreationActiveModule):
|
||||
_kwargs["data"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded"
|
||||
if isinstance(body, ModuleCompletionEmailRegistrationCreationActiveModule):
|
||||
_kwargs["files"] = body.to_multipart()
|
||||
|
||||
headers["Content-Type"] = "multipart/form-data"
|
||||
|
||||
_kwargs["headers"] = headers
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[ModuleCompletionEmailRegistrationCreationActiveModule]:
|
||||
if response.status_code == 201:
|
||||
response_201 = ModuleCompletionEmailRegistrationCreationActiveModule.from_dict(response.json())
|
||||
|
||||
return response_201
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[ModuleCompletionEmailRegistrationCreationActiveModule]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
ModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
ModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
ModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
],
|
||||
) -> Response[ModuleCompletionEmailRegistrationCreationActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`.
|
||||
|
||||
Args:
|
||||
body (ModuleCompletionEmailRegistrationCreationActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`
|
||||
body (ModuleCompletionEmailRegistrationCreationActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`
|
||||
body (ModuleCompletionEmailRegistrationCreationActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ModuleCompletionEmailRegistrationCreationActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
ModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
ModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
ModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
],
|
||||
) -> Optional[ModuleCompletionEmailRegistrationCreationActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`.
|
||||
|
||||
Args:
|
||||
body (ModuleCompletionEmailRegistrationCreationActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`
|
||||
body (ModuleCompletionEmailRegistrationCreationActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`
|
||||
body (ModuleCompletionEmailRegistrationCreationActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ModuleCompletionEmailRegistrationCreationActiveModule
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
body=body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
ModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
ModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
ModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
],
|
||||
) -> Response[ModuleCompletionEmailRegistrationCreationActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`.
|
||||
|
||||
Args:
|
||||
body (ModuleCompletionEmailRegistrationCreationActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`
|
||||
body (ModuleCompletionEmailRegistrationCreationActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`
|
||||
body (ModuleCompletionEmailRegistrationCreationActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ModuleCompletionEmailRegistrationCreationActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
ModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
ModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
ModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
],
|
||||
) -> Optional[ModuleCompletionEmailRegistrationCreationActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`.
|
||||
|
||||
Args:
|
||||
body (ModuleCompletionEmailRegistrationCreationActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`
|
||||
body (ModuleCompletionEmailRegistrationCreationActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`
|
||||
body (ModuleCompletionEmailRegistrationCreationActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ModuleCompletionEmailRegistrationCreationActiveModule
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
body=body,
|
||||
)
|
||||
).parsed
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: int,
|
||||
) -> dict[str, Any]:
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "delete",
|
||||
"url": f"/api/v2/modules_completion/email_registration_creation/modules/{id}/",
|
||||
}
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
||||
if response.status_code == 204:
|
||||
return None
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Response[Any]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Response[Any]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
+220
@@ -0,0 +1,220 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.paginated_module_completion_email_registration_creation_active_module_list import (
|
||||
PaginatedModuleCompletionEmailRegistrationCreationActiveModuleList,
|
||||
)
|
||||
from ...types import UNSET, Response, Unset
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> dict[str, Any]:
|
||||
params: dict[str, Any] = {}
|
||||
|
||||
params["event"] = event
|
||||
|
||||
params["o"] = o
|
||||
|
||||
params["offset"] = offset
|
||||
|
||||
params["page_limit"] = page_limit
|
||||
|
||||
params["q"] = q
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "get",
|
||||
"url": "/api/v2/modules_completion/email_registration_creation/modules/",
|
||||
"params": params,
|
||||
}
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[PaginatedModuleCompletionEmailRegistrationCreationActiveModuleList]:
|
||||
if response.status_code == 200:
|
||||
response_200 = PaginatedModuleCompletionEmailRegistrationCreationActiveModuleList.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[PaginatedModuleCompletionEmailRegistrationCreationActiveModuleList]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Response[PaginatedModuleCompletionEmailRegistrationCreationActiveModuleList]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, int]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[PaginatedModuleCompletionEmailRegistrationCreationActiveModuleList]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Optional[PaginatedModuleCompletionEmailRegistrationCreationActiveModuleList]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, int]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
PaginatedModuleCompletionEmailRegistrationCreationActiveModuleList
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Response[PaginatedModuleCompletionEmailRegistrationCreationActiveModuleList]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, int]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[PaginatedModuleCompletionEmailRegistrationCreationActiveModuleList]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Optional[PaginatedModuleCompletionEmailRegistrationCreationActiveModuleList]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, int]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
PaginatedModuleCompletionEmailRegistrationCreationActiveModuleList
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
).parsed
|
||||
+233
@@ -0,0 +1,233 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.module_completion_email_registration_creation_active_module import (
|
||||
ModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
)
|
||||
from ...models.patched_module_completion_email_registration_creation_active_module import (
|
||||
PatchedModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
)
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: int,
|
||||
*,
|
||||
body: Union[
|
||||
PatchedModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
PatchedModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
PatchedModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
],
|
||||
) -> dict[str, Any]:
|
||||
headers: dict[str, Any] = {}
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "patch",
|
||||
"url": f"/api/v2/modules_completion/email_registration_creation/modules/{id}/",
|
||||
}
|
||||
|
||||
if isinstance(body, PatchedModuleCompletionEmailRegistrationCreationActiveModule):
|
||||
_kwargs["json"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/json"
|
||||
if isinstance(body, PatchedModuleCompletionEmailRegistrationCreationActiveModule):
|
||||
_kwargs["data"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded"
|
||||
if isinstance(body, PatchedModuleCompletionEmailRegistrationCreationActiveModule):
|
||||
_kwargs["files"] = body.to_multipart()
|
||||
|
||||
headers["Content-Type"] = "multipart/form-data"
|
||||
|
||||
_kwargs["headers"] = headers
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[ModuleCompletionEmailRegistrationCreationActiveModule]:
|
||||
if response.status_code == 200:
|
||||
response_200 = ModuleCompletionEmailRegistrationCreationActiveModule.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[ModuleCompletionEmailRegistrationCreationActiveModule]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
PatchedModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
PatchedModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
],
|
||||
) -> Response[ModuleCompletionEmailRegistrationCreationActiveModule]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedModuleCompletionEmailRegistrationCreationActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`
|
||||
body (PatchedModuleCompletionEmailRegistrationCreationActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`
|
||||
body (PatchedModuleCompletionEmailRegistrationCreationActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ModuleCompletionEmailRegistrationCreationActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
PatchedModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
PatchedModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
],
|
||||
) -> Optional[ModuleCompletionEmailRegistrationCreationActiveModule]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedModuleCompletionEmailRegistrationCreationActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`
|
||||
body (PatchedModuleCompletionEmailRegistrationCreationActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`
|
||||
body (PatchedModuleCompletionEmailRegistrationCreationActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ModuleCompletionEmailRegistrationCreationActiveModule
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
body=body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
PatchedModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
PatchedModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
],
|
||||
) -> Response[ModuleCompletionEmailRegistrationCreationActiveModule]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedModuleCompletionEmailRegistrationCreationActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`
|
||||
body (PatchedModuleCompletionEmailRegistrationCreationActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`
|
||||
body (PatchedModuleCompletionEmailRegistrationCreationActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ModuleCompletionEmailRegistrationCreationActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
PatchedModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
PatchedModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
],
|
||||
) -> Optional[ModuleCompletionEmailRegistrationCreationActiveModule]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedModuleCompletionEmailRegistrationCreationActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`
|
||||
body (PatchedModuleCompletionEmailRegistrationCreationActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`
|
||||
body (PatchedModuleCompletionEmailRegistrationCreationActiveModule): Serializer for
|
||||
`ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ModuleCompletionEmailRegistrationCreationActiveModule
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
body=body,
|
||||
)
|
||||
).parsed
|
||||
+152
@@ -0,0 +1,152 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.module_completion_email_registration_creation_active_module import (
|
||||
ModuleCompletionEmailRegistrationCreationActiveModule,
|
||||
)
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: int,
|
||||
) -> dict[str, Any]:
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "get",
|
||||
"url": f"/api/v2/modules_completion/email_registration_creation/modules/{id}/",
|
||||
}
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[ModuleCompletionEmailRegistrationCreationActiveModule]:
|
||||
if response.status_code == 200:
|
||||
response_200 = ModuleCompletionEmailRegistrationCreationActiveModule.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[ModuleCompletionEmailRegistrationCreationActiveModule]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Response[ModuleCompletionEmailRegistrationCreationActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ModuleCompletionEmailRegistrationCreationActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Optional[ModuleCompletionEmailRegistrationCreationActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ModuleCompletionEmailRegistrationCreationActiveModule
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Response[ModuleCompletionEmailRegistrationCreationActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ModuleCompletionEmailRegistrationCreationActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Optional[ModuleCompletionEmailRegistrationCreationActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ModuleCompletionEmailRegistrationCreationActiveModule
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
+207
@@ -0,0 +1,207 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.module_completion_pdf_ticket_active_module import ModuleCompletionPDFTicketActiveModule
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
body: Union[
|
||||
ModuleCompletionPDFTicketActiveModule,
|
||||
ModuleCompletionPDFTicketActiveModule,
|
||||
ModuleCompletionPDFTicketActiveModule,
|
||||
],
|
||||
) -> dict[str, Any]:
|
||||
headers: dict[str, Any] = {}
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "post",
|
||||
"url": "/api/v2/modules_completion/pdf_ticket/modules/",
|
||||
}
|
||||
|
||||
if isinstance(body, ModuleCompletionPDFTicketActiveModule):
|
||||
_kwargs["json"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/json"
|
||||
if isinstance(body, ModuleCompletionPDFTicketActiveModule):
|
||||
_kwargs["data"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded"
|
||||
if isinstance(body, ModuleCompletionPDFTicketActiveModule):
|
||||
_kwargs["files"] = body.to_multipart()
|
||||
|
||||
headers["Content-Type"] = "multipart/form-data"
|
||||
|
||||
_kwargs["headers"] = headers
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[ModuleCompletionPDFTicketActiveModule]:
|
||||
if response.status_code == 201:
|
||||
response_201 = ModuleCompletionPDFTicketActiveModule.from_dict(response.json())
|
||||
|
||||
return response_201
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[ModuleCompletionPDFTicketActiveModule]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
ModuleCompletionPDFTicketActiveModule,
|
||||
ModuleCompletionPDFTicketActiveModule,
|
||||
ModuleCompletionPDFTicketActiveModule,
|
||||
],
|
||||
) -> Response[ModuleCompletionPDFTicketActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionPDFTicket`.
|
||||
|
||||
Args:
|
||||
body (ModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionPDFTicket`
|
||||
body (ModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionPDFTicket`
|
||||
body (ModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionPDFTicket`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ModuleCompletionPDFTicketActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
ModuleCompletionPDFTicketActiveModule,
|
||||
ModuleCompletionPDFTicketActiveModule,
|
||||
ModuleCompletionPDFTicketActiveModule,
|
||||
],
|
||||
) -> Optional[ModuleCompletionPDFTicketActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionPDFTicket`.
|
||||
|
||||
Args:
|
||||
body (ModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionPDFTicket`
|
||||
body (ModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionPDFTicket`
|
||||
body (ModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionPDFTicket`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ModuleCompletionPDFTicketActiveModule
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
body=body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
ModuleCompletionPDFTicketActiveModule,
|
||||
ModuleCompletionPDFTicketActiveModule,
|
||||
ModuleCompletionPDFTicketActiveModule,
|
||||
],
|
||||
) -> Response[ModuleCompletionPDFTicketActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionPDFTicket`.
|
||||
|
||||
Args:
|
||||
body (ModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionPDFTicket`
|
||||
body (ModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionPDFTicket`
|
||||
body (ModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionPDFTicket`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ModuleCompletionPDFTicketActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
ModuleCompletionPDFTicketActiveModule,
|
||||
ModuleCompletionPDFTicketActiveModule,
|
||||
ModuleCompletionPDFTicketActiveModule,
|
||||
],
|
||||
) -> Optional[ModuleCompletionPDFTicketActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionPDFTicket`.
|
||||
|
||||
Args:
|
||||
body (ModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionPDFTicket`
|
||||
body (ModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionPDFTicket`
|
||||
body (ModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionPDFTicket`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ModuleCompletionPDFTicketActiveModule
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
body=body,
|
||||
)
|
||||
).parsed
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: int,
|
||||
) -> dict[str, Any]:
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "delete",
|
||||
"url": f"/api/v2/modules_completion/pdf_ticket/modules/{id}/",
|
||||
}
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
||||
if response.status_code == 204:
|
||||
return None
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Response[Any]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionPDFTicket`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Response[Any]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionPDFTicket`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
+220
@@ -0,0 +1,220 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.paginated_module_completion_pdf_ticket_active_module_list import (
|
||||
PaginatedModuleCompletionPDFTicketActiveModuleList,
|
||||
)
|
||||
from ...types import UNSET, Response, Unset
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> dict[str, Any]:
|
||||
params: dict[str, Any] = {}
|
||||
|
||||
params["event"] = event
|
||||
|
||||
params["o"] = o
|
||||
|
||||
params["offset"] = offset
|
||||
|
||||
params["page_limit"] = page_limit
|
||||
|
||||
params["q"] = q
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "get",
|
||||
"url": "/api/v2/modules_completion/pdf_ticket/modules/",
|
||||
"params": params,
|
||||
}
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[PaginatedModuleCompletionPDFTicketActiveModuleList]:
|
||||
if response.status_code == 200:
|
||||
response_200 = PaginatedModuleCompletionPDFTicketActiveModuleList.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[PaginatedModuleCompletionPDFTicketActiveModuleList]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Response[PaginatedModuleCompletionPDFTicketActiveModuleList]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionPDFTicket`.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, int]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[PaginatedModuleCompletionPDFTicketActiveModuleList]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Optional[PaginatedModuleCompletionPDFTicketActiveModuleList]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionPDFTicket`.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, int]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
PaginatedModuleCompletionPDFTicketActiveModuleList
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Response[PaginatedModuleCompletionPDFTicketActiveModuleList]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionPDFTicket`.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, int]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[PaginatedModuleCompletionPDFTicketActiveModuleList]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Optional[PaginatedModuleCompletionPDFTicketActiveModuleList]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionPDFTicket`.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, int]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
PaginatedModuleCompletionPDFTicketActiveModuleList
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
).parsed
|
||||
+229
@@ -0,0 +1,229 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.module_completion_pdf_ticket_active_module import ModuleCompletionPDFTicketActiveModule
|
||||
from ...models.patched_module_completion_pdf_ticket_active_module import PatchedModuleCompletionPDFTicketActiveModule
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: int,
|
||||
*,
|
||||
body: Union[
|
||||
PatchedModuleCompletionPDFTicketActiveModule,
|
||||
PatchedModuleCompletionPDFTicketActiveModule,
|
||||
PatchedModuleCompletionPDFTicketActiveModule,
|
||||
],
|
||||
) -> dict[str, Any]:
|
||||
headers: dict[str, Any] = {}
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "patch",
|
||||
"url": f"/api/v2/modules_completion/pdf_ticket/modules/{id}/",
|
||||
}
|
||||
|
||||
if isinstance(body, PatchedModuleCompletionPDFTicketActiveModule):
|
||||
_kwargs["json"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/json"
|
||||
if isinstance(body, PatchedModuleCompletionPDFTicketActiveModule):
|
||||
_kwargs["data"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded"
|
||||
if isinstance(body, PatchedModuleCompletionPDFTicketActiveModule):
|
||||
_kwargs["files"] = body.to_multipart()
|
||||
|
||||
headers["Content-Type"] = "multipart/form-data"
|
||||
|
||||
_kwargs["headers"] = headers
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[ModuleCompletionPDFTicketActiveModule]:
|
||||
if response.status_code == 200:
|
||||
response_200 = ModuleCompletionPDFTicketActiveModule.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[ModuleCompletionPDFTicketActiveModule]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedModuleCompletionPDFTicketActiveModule,
|
||||
PatchedModuleCompletionPDFTicketActiveModule,
|
||||
PatchedModuleCompletionPDFTicketActiveModule,
|
||||
],
|
||||
) -> Response[ModuleCompletionPDFTicketActiveModule]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionPDFTicket`
|
||||
body (PatchedModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionPDFTicket`
|
||||
body (PatchedModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionPDFTicket`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ModuleCompletionPDFTicketActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedModuleCompletionPDFTicketActiveModule,
|
||||
PatchedModuleCompletionPDFTicketActiveModule,
|
||||
PatchedModuleCompletionPDFTicketActiveModule,
|
||||
],
|
||||
) -> Optional[ModuleCompletionPDFTicketActiveModule]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionPDFTicket`
|
||||
body (PatchedModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionPDFTicket`
|
||||
body (PatchedModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionPDFTicket`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ModuleCompletionPDFTicketActiveModule
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
body=body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedModuleCompletionPDFTicketActiveModule,
|
||||
PatchedModuleCompletionPDFTicketActiveModule,
|
||||
PatchedModuleCompletionPDFTicketActiveModule,
|
||||
],
|
||||
) -> Response[ModuleCompletionPDFTicketActiveModule]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionPDFTicket`
|
||||
body (PatchedModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionPDFTicket`
|
||||
body (PatchedModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionPDFTicket`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ModuleCompletionPDFTicketActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedModuleCompletionPDFTicketActiveModule,
|
||||
PatchedModuleCompletionPDFTicketActiveModule,
|
||||
PatchedModuleCompletionPDFTicketActiveModule,
|
||||
],
|
||||
) -> Optional[ModuleCompletionPDFTicketActiveModule]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionPDFTicket`
|
||||
body (PatchedModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionPDFTicket`
|
||||
body (PatchedModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionPDFTicket`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ModuleCompletionPDFTicketActiveModule
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
body=body,
|
||||
)
|
||||
).parsed
|
||||
+150
@@ -0,0 +1,150 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.module_completion_pdf_ticket_active_module import ModuleCompletionPDFTicketActiveModule
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: int,
|
||||
) -> dict[str, Any]:
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "get",
|
||||
"url": f"/api/v2/modules_completion/pdf_ticket/modules/{id}/",
|
||||
}
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[ModuleCompletionPDFTicketActiveModule]:
|
||||
if response.status_code == 200:
|
||||
response_200 = ModuleCompletionPDFTicketActiveModule.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[ModuleCompletionPDFTicketActiveModule]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Response[ModuleCompletionPDFTicketActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionPDFTicket`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ModuleCompletionPDFTicketActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Optional[ModuleCompletionPDFTicketActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionPDFTicket`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ModuleCompletionPDFTicketActiveModule
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Response[ModuleCompletionPDFTicketActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionPDFTicket`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ModuleCompletionPDFTicketActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Optional[ModuleCompletionPDFTicketActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionPDFTicket`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ModuleCompletionPDFTicketActiveModule
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
+207
@@ -0,0 +1,207 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.module_completion_redirect_active_module import ModuleCompletionRedirectActiveModule
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
body: Union[
|
||||
ModuleCompletionRedirectActiveModule,
|
||||
ModuleCompletionRedirectActiveModule,
|
||||
ModuleCompletionRedirectActiveModule,
|
||||
],
|
||||
) -> dict[str, Any]:
|
||||
headers: dict[str, Any] = {}
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "post",
|
||||
"url": "/api/v2/modules_completion/redirect/modules/",
|
||||
}
|
||||
|
||||
if isinstance(body, ModuleCompletionRedirectActiveModule):
|
||||
_kwargs["json"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/json"
|
||||
if isinstance(body, ModuleCompletionRedirectActiveModule):
|
||||
_kwargs["data"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded"
|
||||
if isinstance(body, ModuleCompletionRedirectActiveModule):
|
||||
_kwargs["files"] = body.to_multipart()
|
||||
|
||||
headers["Content-Type"] = "multipart/form-data"
|
||||
|
||||
_kwargs["headers"] = headers
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[ModuleCompletionRedirectActiveModule]:
|
||||
if response.status_code == 201:
|
||||
response_201 = ModuleCompletionRedirectActiveModule.from_dict(response.json())
|
||||
|
||||
return response_201
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[ModuleCompletionRedirectActiveModule]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
ModuleCompletionRedirectActiveModule,
|
||||
ModuleCompletionRedirectActiveModule,
|
||||
ModuleCompletionRedirectActiveModule,
|
||||
],
|
||||
) -> Response[ModuleCompletionRedirectActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionRedirect`.
|
||||
|
||||
Args:
|
||||
body (ModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionRedirect`
|
||||
body (ModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionRedirect`
|
||||
body (ModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionRedirect`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ModuleCompletionRedirectActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
ModuleCompletionRedirectActiveModule,
|
||||
ModuleCompletionRedirectActiveModule,
|
||||
ModuleCompletionRedirectActiveModule,
|
||||
],
|
||||
) -> Optional[ModuleCompletionRedirectActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionRedirect`.
|
||||
|
||||
Args:
|
||||
body (ModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionRedirect`
|
||||
body (ModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionRedirect`
|
||||
body (ModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionRedirect`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ModuleCompletionRedirectActiveModule
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
body=body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
ModuleCompletionRedirectActiveModule,
|
||||
ModuleCompletionRedirectActiveModule,
|
||||
ModuleCompletionRedirectActiveModule,
|
||||
],
|
||||
) -> Response[ModuleCompletionRedirectActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionRedirect`.
|
||||
|
||||
Args:
|
||||
body (ModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionRedirect`
|
||||
body (ModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionRedirect`
|
||||
body (ModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionRedirect`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ModuleCompletionRedirectActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
ModuleCompletionRedirectActiveModule,
|
||||
ModuleCompletionRedirectActiveModule,
|
||||
ModuleCompletionRedirectActiveModule,
|
||||
],
|
||||
) -> Optional[ModuleCompletionRedirectActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionRedirect`.
|
||||
|
||||
Args:
|
||||
body (ModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionRedirect`
|
||||
body (ModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionRedirect`
|
||||
body (ModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModuleCompletionRedirect`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ModuleCompletionRedirectActiveModule
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
body=body,
|
||||
)
|
||||
).parsed
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: int,
|
||||
) -> dict[str, Any]:
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "delete",
|
||||
"url": f"/api/v2/modules_completion/redirect/modules/{id}/",
|
||||
}
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
||||
if response.status_code == 204:
|
||||
return None
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Response[Any]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionRedirect`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Response[Any]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionRedirect`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
+220
@@ -0,0 +1,220 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.paginated_module_completion_redirect_active_module_list import (
|
||||
PaginatedModuleCompletionRedirectActiveModuleList,
|
||||
)
|
||||
from ...types import UNSET, Response, Unset
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> dict[str, Any]:
|
||||
params: dict[str, Any] = {}
|
||||
|
||||
params["event"] = event
|
||||
|
||||
params["o"] = o
|
||||
|
||||
params["offset"] = offset
|
||||
|
||||
params["page_limit"] = page_limit
|
||||
|
||||
params["q"] = q
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "get",
|
||||
"url": "/api/v2/modules_completion/redirect/modules/",
|
||||
"params": params,
|
||||
}
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[PaginatedModuleCompletionRedirectActiveModuleList]:
|
||||
if response.status_code == 200:
|
||||
response_200 = PaginatedModuleCompletionRedirectActiveModuleList.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[PaginatedModuleCompletionRedirectActiveModuleList]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Response[PaginatedModuleCompletionRedirectActiveModuleList]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionRedirect`.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, int]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[PaginatedModuleCompletionRedirectActiveModuleList]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Optional[PaginatedModuleCompletionRedirectActiveModuleList]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionRedirect`.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, int]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
PaginatedModuleCompletionRedirectActiveModuleList
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Response[PaginatedModuleCompletionRedirectActiveModuleList]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionRedirect`.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, int]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[PaginatedModuleCompletionRedirectActiveModuleList]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Optional[PaginatedModuleCompletionRedirectActiveModuleList]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionRedirect`.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, int]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, str]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
PaginatedModuleCompletionRedirectActiveModuleList
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
).parsed
|
||||
+229
@@ -0,0 +1,229 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.module_completion_redirect_active_module import ModuleCompletionRedirectActiveModule
|
||||
from ...models.patched_module_completion_redirect_active_module import PatchedModuleCompletionRedirectActiveModule
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: int,
|
||||
*,
|
||||
body: Union[
|
||||
PatchedModuleCompletionRedirectActiveModule,
|
||||
PatchedModuleCompletionRedirectActiveModule,
|
||||
PatchedModuleCompletionRedirectActiveModule,
|
||||
],
|
||||
) -> dict[str, Any]:
|
||||
headers: dict[str, Any] = {}
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "patch",
|
||||
"url": f"/api/v2/modules_completion/redirect/modules/{id}/",
|
||||
}
|
||||
|
||||
if isinstance(body, PatchedModuleCompletionRedirectActiveModule):
|
||||
_kwargs["json"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/json"
|
||||
if isinstance(body, PatchedModuleCompletionRedirectActiveModule):
|
||||
_kwargs["data"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded"
|
||||
if isinstance(body, PatchedModuleCompletionRedirectActiveModule):
|
||||
_kwargs["files"] = body.to_multipart()
|
||||
|
||||
headers["Content-Type"] = "multipart/form-data"
|
||||
|
||||
_kwargs["headers"] = headers
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[ModuleCompletionRedirectActiveModule]:
|
||||
if response.status_code == 200:
|
||||
response_200 = ModuleCompletionRedirectActiveModule.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[ModuleCompletionRedirectActiveModule]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedModuleCompletionRedirectActiveModule,
|
||||
PatchedModuleCompletionRedirectActiveModule,
|
||||
PatchedModuleCompletionRedirectActiveModule,
|
||||
],
|
||||
) -> Response[ModuleCompletionRedirectActiveModule]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionRedirect`
|
||||
body (PatchedModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionRedirect`
|
||||
body (PatchedModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionRedirect`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ModuleCompletionRedirectActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedModuleCompletionRedirectActiveModule,
|
||||
PatchedModuleCompletionRedirectActiveModule,
|
||||
PatchedModuleCompletionRedirectActiveModule,
|
||||
],
|
||||
) -> Optional[ModuleCompletionRedirectActiveModule]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionRedirect`
|
||||
body (PatchedModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionRedirect`
|
||||
body (PatchedModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionRedirect`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ModuleCompletionRedirectActiveModule
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
body=body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedModuleCompletionRedirectActiveModule,
|
||||
PatchedModuleCompletionRedirectActiveModule,
|
||||
PatchedModuleCompletionRedirectActiveModule,
|
||||
],
|
||||
) -> Response[ModuleCompletionRedirectActiveModule]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionRedirect`
|
||||
body (PatchedModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionRedirect`
|
||||
body (PatchedModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionRedirect`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ModuleCompletionRedirectActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedModuleCompletionRedirectActiveModule,
|
||||
PatchedModuleCompletionRedirectActiveModule,
|
||||
PatchedModuleCompletionRedirectActiveModule,
|
||||
],
|
||||
) -> Optional[ModuleCompletionRedirectActiveModule]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionRedirect`
|
||||
body (PatchedModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionRedirect`
|
||||
body (PatchedModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModuleCompletionRedirect`
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ModuleCompletionRedirectActiveModule
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
body=body,
|
||||
)
|
||||
).parsed
|
||||
+150
@@ -0,0 +1,150 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.module_completion_redirect_active_module import ModuleCompletionRedirectActiveModule
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: int,
|
||||
) -> dict[str, Any]:
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "get",
|
||||
"url": f"/api/v2/modules_completion/redirect/modules/{id}/",
|
||||
}
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[ModuleCompletionRedirectActiveModule]:
|
||||
if response.status_code == 200:
|
||||
response_200 = ModuleCompletionRedirectActiveModule.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[ModuleCompletionRedirectActiveModule]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Response[ModuleCompletionRedirectActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionRedirect`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ModuleCompletionRedirectActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Optional[ModuleCompletionRedirectActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionRedirect`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ModuleCompletionRedirectActiveModule
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Response[ModuleCompletionRedirectActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionRedirect`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[ModuleCompletionRedirectActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Optional[ModuleCompletionRedirectActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModuleCompletionRedirect`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
ModuleCompletionRedirectActiveModule
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
Reference in New Issue
Block a user