add openapi-python-client generator + client

This commit is contained in:
2025-07-11 12:00:23 +02:00
parent 6910cf37f2
commit 1cc7d01c27
485 changed files with 72495 additions and 0 deletions
@@ -0,0 +1 @@
"""Contains endpoint functions for accessing the API"""
@@ -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_registration_access_management_active_module import ModuleRegistrationAccessManagementActiveModule
from ...types import Response
def _get_kwargs(
*,
body: Union[
ModuleRegistrationAccessManagementActiveModule,
ModuleRegistrationAccessManagementActiveModule,
ModuleRegistrationAccessManagementActiveModule,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": "/api/v2/modules_registrations/access_management/modules/",
}
if isinstance(body, ModuleRegistrationAccessManagementActiveModule):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, ModuleRegistrationAccessManagementActiveModule):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, ModuleRegistrationAccessManagementActiveModule):
_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[ModuleRegistrationAccessManagementActiveModule]:
if response.status_code == 201:
response_201 = ModuleRegistrationAccessManagementActiveModule.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[ModuleRegistrationAccessManagementActiveModule]:
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[
ModuleRegistrationAccessManagementActiveModule,
ModuleRegistrationAccessManagementActiveModule,
ModuleRegistrationAccessManagementActiveModule,
],
) -> Response[ModuleRegistrationAccessManagementActiveModule]:
"""ViewSet of model `ActiveModule` linked to `ModuleRegistrationAccessManagement`.
Args:
body (ModuleRegistrationAccessManagementActiveModule): Serializer for `ActiveModule`
linked to `ModuleRegistrationOptions`
body (ModuleRegistrationAccessManagementActiveModule): Serializer for `ActiveModule`
linked to `ModuleRegistrationOptions`
body (ModuleRegistrationAccessManagementActiveModule): Serializer for `ActiveModule`
linked to `ModuleRegistrationOptions`
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[ModuleRegistrationAccessManagementActiveModule]
"""
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[
ModuleRegistrationAccessManagementActiveModule,
ModuleRegistrationAccessManagementActiveModule,
ModuleRegistrationAccessManagementActiveModule,
],
) -> Optional[ModuleRegistrationAccessManagementActiveModule]:
"""ViewSet of model `ActiveModule` linked to `ModuleRegistrationAccessManagement`.
Args:
body (ModuleRegistrationAccessManagementActiveModule): Serializer for `ActiveModule`
linked to `ModuleRegistrationOptions`
body (ModuleRegistrationAccessManagementActiveModule): Serializer for `ActiveModule`
linked to `ModuleRegistrationOptions`
body (ModuleRegistrationAccessManagementActiveModule): Serializer for `ActiveModule`
linked to `ModuleRegistrationOptions`
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:
ModuleRegistrationAccessManagementActiveModule
"""
return sync_detailed(
client=client,
body=body,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
body: Union[
ModuleRegistrationAccessManagementActiveModule,
ModuleRegistrationAccessManagementActiveModule,
ModuleRegistrationAccessManagementActiveModule,
],
) -> Response[ModuleRegistrationAccessManagementActiveModule]:
"""ViewSet of model `ActiveModule` linked to `ModuleRegistrationAccessManagement`.
Args:
body (ModuleRegistrationAccessManagementActiveModule): Serializer for `ActiveModule`
linked to `ModuleRegistrationOptions`
body (ModuleRegistrationAccessManagementActiveModule): Serializer for `ActiveModule`
linked to `ModuleRegistrationOptions`
body (ModuleRegistrationAccessManagementActiveModule): Serializer for `ActiveModule`
linked to `ModuleRegistrationOptions`
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[ModuleRegistrationAccessManagementActiveModule]
"""
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[
ModuleRegistrationAccessManagementActiveModule,
ModuleRegistrationAccessManagementActiveModule,
ModuleRegistrationAccessManagementActiveModule,
],
) -> Optional[ModuleRegistrationAccessManagementActiveModule]:
"""ViewSet of model `ActiveModule` linked to `ModuleRegistrationAccessManagement`.
Args:
body (ModuleRegistrationAccessManagementActiveModule): Serializer for `ActiveModule`
linked to `ModuleRegistrationOptions`
body (ModuleRegistrationAccessManagementActiveModule): Serializer for `ActiveModule`
linked to `ModuleRegistrationOptions`
body (ModuleRegistrationAccessManagementActiveModule): Serializer for `ActiveModule`
linked to `ModuleRegistrationOptions`
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:
ModuleRegistrationAccessManagementActiveModule
"""
return (
await asyncio_detailed(
client=client,
body=body,
)
).parsed
@@ -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_registration_access_management_active_module_list import (
PaginatedModuleRegistrationAccessManagementActiveModuleList,
)
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_registrations/access_management/modules/",
"params": params,
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[PaginatedModuleRegistrationAccessManagementActiveModuleList]:
if response.status_code == 200:
response_200 = PaginatedModuleRegistrationAccessManagementActiveModuleList.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[PaginatedModuleRegistrationAccessManagementActiveModuleList]:
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[PaginatedModuleRegistrationAccessManagementActiveModuleList]:
"""ViewSet of model `ActiveModule` linked to `ModuleRegistrationAccessManagement`.
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[PaginatedModuleRegistrationAccessManagementActiveModuleList]
"""
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[PaginatedModuleRegistrationAccessManagementActiveModuleList]:
"""ViewSet of model `ActiveModule` linked to `ModuleRegistrationAccessManagement`.
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:
PaginatedModuleRegistrationAccessManagementActiveModuleList
"""
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[PaginatedModuleRegistrationAccessManagementActiveModuleList]:
"""ViewSet of model `ActiveModule` linked to `ModuleRegistrationAccessManagement`.
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[PaginatedModuleRegistrationAccessManagementActiveModuleList]
"""
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[PaginatedModuleRegistrationAccessManagementActiveModuleList]:
"""ViewSet of model `ActiveModule` linked to `ModuleRegistrationAccessManagement`.
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:
PaginatedModuleRegistrationAccessManagementActiveModuleList
"""
return (
await asyncio_detailed(
client=client,
event=event,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
)
).parsed
@@ -0,0 +1,231 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.module_registration_access_management_active_module import ModuleRegistrationAccessManagementActiveModule
from ...models.patched_module_registration_access_management_active_module import (
PatchedModuleRegistrationAccessManagementActiveModule,
)
from ...types import Response
def _get_kwargs(
id: int,
*,
body: Union[
PatchedModuleRegistrationAccessManagementActiveModule,
PatchedModuleRegistrationAccessManagementActiveModule,
PatchedModuleRegistrationAccessManagementActiveModule,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "patch",
"url": f"/api/v2/modules_registrations/access_management/modules/{id}/",
}
if isinstance(body, PatchedModuleRegistrationAccessManagementActiveModule):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, PatchedModuleRegistrationAccessManagementActiveModule):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, PatchedModuleRegistrationAccessManagementActiveModule):
_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[ModuleRegistrationAccessManagementActiveModule]:
if response.status_code == 200:
response_200 = ModuleRegistrationAccessManagementActiveModule.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[ModuleRegistrationAccessManagementActiveModule]:
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[
PatchedModuleRegistrationAccessManagementActiveModule,
PatchedModuleRegistrationAccessManagementActiveModule,
PatchedModuleRegistrationAccessManagementActiveModule,
],
) -> Response[ModuleRegistrationAccessManagementActiveModule]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedModuleRegistrationAccessManagementActiveModule): Serializer for
`ActiveModule` linked to `ModuleRegistrationOptions`
body (PatchedModuleRegistrationAccessManagementActiveModule): Serializer for
`ActiveModule` linked to `ModuleRegistrationOptions`
body (PatchedModuleRegistrationAccessManagementActiveModule): Serializer for
`ActiveModule` linked to `ModuleRegistrationOptions`
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[ModuleRegistrationAccessManagementActiveModule]
"""
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[
PatchedModuleRegistrationAccessManagementActiveModule,
PatchedModuleRegistrationAccessManagementActiveModule,
PatchedModuleRegistrationAccessManagementActiveModule,
],
) -> Optional[ModuleRegistrationAccessManagementActiveModule]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedModuleRegistrationAccessManagementActiveModule): Serializer for
`ActiveModule` linked to `ModuleRegistrationOptions`
body (PatchedModuleRegistrationAccessManagementActiveModule): Serializer for
`ActiveModule` linked to `ModuleRegistrationOptions`
body (PatchedModuleRegistrationAccessManagementActiveModule): Serializer for
`ActiveModule` linked to `ModuleRegistrationOptions`
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:
ModuleRegistrationAccessManagementActiveModule
"""
return sync_detailed(
id=id,
client=client,
body=body,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
body: Union[
PatchedModuleRegistrationAccessManagementActiveModule,
PatchedModuleRegistrationAccessManagementActiveModule,
PatchedModuleRegistrationAccessManagementActiveModule,
],
) -> Response[ModuleRegistrationAccessManagementActiveModule]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedModuleRegistrationAccessManagementActiveModule): Serializer for
`ActiveModule` linked to `ModuleRegistrationOptions`
body (PatchedModuleRegistrationAccessManagementActiveModule): Serializer for
`ActiveModule` linked to `ModuleRegistrationOptions`
body (PatchedModuleRegistrationAccessManagementActiveModule): Serializer for
`ActiveModule` linked to `ModuleRegistrationOptions`
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[ModuleRegistrationAccessManagementActiveModule]
"""
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[
PatchedModuleRegistrationAccessManagementActiveModule,
PatchedModuleRegistrationAccessManagementActiveModule,
PatchedModuleRegistrationAccessManagementActiveModule,
],
) -> Optional[ModuleRegistrationAccessManagementActiveModule]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedModuleRegistrationAccessManagementActiveModule): Serializer for
`ActiveModule` linked to `ModuleRegistrationOptions`
body (PatchedModuleRegistrationAccessManagementActiveModule): Serializer for
`ActiveModule` linked to `ModuleRegistrationOptions`
body (PatchedModuleRegistrationAccessManagementActiveModule): Serializer for
`ActiveModule` linked to `ModuleRegistrationOptions`
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:
ModuleRegistrationAccessManagementActiveModule
"""
return (
await asyncio_detailed(
id=id,
client=client,
body=body,
)
).parsed
@@ -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_registration_access_management_active_module import ModuleRegistrationAccessManagementActiveModule
from ...types import Response
def _get_kwargs(
id: int,
) -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": f"/api/v2/modules_registrations/access_management/modules/{id}/",
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[ModuleRegistrationAccessManagementActiveModule]:
if response.status_code == 200:
response_200 = ModuleRegistrationAccessManagementActiveModule.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[ModuleRegistrationAccessManagementActiveModule]:
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[ModuleRegistrationAccessManagementActiveModule]:
"""ViewSet of model `ActiveModule` linked to `ModuleRegistrationAccessManagement`.
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[ModuleRegistrationAccessManagementActiveModule]
"""
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[ModuleRegistrationAccessManagementActiveModule]:
"""ViewSet of model `ActiveModule` linked to `ModuleRegistrationAccessManagement`.
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:
ModuleRegistrationAccessManagementActiveModule
"""
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
) -> Response[ModuleRegistrationAccessManagementActiveModule]:
"""ViewSet of model `ActiveModule` linked to `ModuleRegistrationAccessManagement`.
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[ModuleRegistrationAccessManagementActiveModule]
"""
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[ModuleRegistrationAccessManagementActiveModule]:
"""ViewSet of model `ActiveModule` linked to `ModuleRegistrationAccessManagement`.
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:
ModuleRegistrationAccessManagementActiveModule
"""
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed
@@ -0,0 +1,195 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.access_management_place import AccessManagementPlace
from ...types import Response
def _get_kwargs(
*,
body: Union[
AccessManagementPlace,
AccessManagementPlace,
AccessManagementPlace,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": "/api/v2/modules_registrations/access_management/places/",
}
if isinstance(body, AccessManagementPlace):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, AccessManagementPlace):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, AccessManagementPlace):
_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[AccessManagementPlace]:
if response.status_code == 201:
response_201 = AccessManagementPlace.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[AccessManagementPlace]:
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[
AccessManagementPlace,
AccessManagementPlace,
AccessManagementPlace,
],
) -> Response[AccessManagementPlace]:
"""ViewSet of model AccessManagementPlace
Args:
body (AccessManagementPlace): Serializer for AccessManagementPlace model
body (AccessManagementPlace): Serializer for AccessManagementPlace model
body (AccessManagementPlace): Serializer for AccessManagementPlace model
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[AccessManagementPlace]
"""
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[
AccessManagementPlace,
AccessManagementPlace,
AccessManagementPlace,
],
) -> Optional[AccessManagementPlace]:
"""ViewSet of model AccessManagementPlace
Args:
body (AccessManagementPlace): Serializer for AccessManagementPlace model
body (AccessManagementPlace): Serializer for AccessManagementPlace model
body (AccessManagementPlace): Serializer for AccessManagementPlace model
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:
AccessManagementPlace
"""
return sync_detailed(
client=client,
body=body,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
body: Union[
AccessManagementPlace,
AccessManagementPlace,
AccessManagementPlace,
],
) -> Response[AccessManagementPlace]:
"""ViewSet of model AccessManagementPlace
Args:
body (AccessManagementPlace): Serializer for AccessManagementPlace model
body (AccessManagementPlace): Serializer for AccessManagementPlace model
body (AccessManagementPlace): Serializer for AccessManagementPlace model
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[AccessManagementPlace]
"""
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[
AccessManagementPlace,
AccessManagementPlace,
AccessManagementPlace,
],
) -> Optional[AccessManagementPlace]:
"""ViewSet of model AccessManagementPlace
Args:
body (AccessManagementPlace): Serializer for AccessManagementPlace model
body (AccessManagementPlace): Serializer for AccessManagementPlace model
body (AccessManagementPlace): Serializer for AccessManagementPlace model
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:
AccessManagementPlace
"""
return (
await asyncio_detailed(
client=client,
body=body,
)
).parsed
@@ -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_registrations/access_management/places/{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 AccessManagementPlace
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 AccessManagementPlace
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)
@@ -0,0 +1,218 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.paginated_access_management_place_list import PaginatedAccessManagementPlaceList
from ...types import UNSET, Response, Unset
def _get_kwargs(
*,
event_id: Union[Unset, float] = 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_id"] = event_id
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_registrations/access_management/places/",
"params": params,
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[PaginatedAccessManagementPlaceList]:
if response.status_code == 200:
response_200 = PaginatedAccessManagementPlaceList.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[PaginatedAccessManagementPlaceList]:
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedAccessManagementPlaceList]:
"""ViewSet of model AccessManagementPlace
Args:
event_id (Union[Unset, float]):
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[PaginatedAccessManagementPlaceList]
"""
kwargs = _get_kwargs(
event_id=event_id,
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedAccessManagementPlaceList]:
"""ViewSet of model AccessManagementPlace
Args:
event_id (Union[Unset, float]):
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:
PaginatedAccessManagementPlaceList
"""
return sync_detailed(
client=client,
event_id=event_id,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
event_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedAccessManagementPlaceList]:
"""ViewSet of model AccessManagementPlace
Args:
event_id (Union[Unset, float]):
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[PaginatedAccessManagementPlaceList]
"""
kwargs = _get_kwargs(
event_id=event_id,
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedAccessManagementPlaceList]:
"""ViewSet of model AccessManagementPlace
Args:
event_id (Union[Unset, float]):
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:
PaginatedAccessManagementPlaceList
"""
return (
await asyncio_detailed(
client=client,
event_id=event_id,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
)
).parsed
@@ -0,0 +1,217 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.access_management_place import AccessManagementPlace
from ...models.patched_access_management_place import PatchedAccessManagementPlace
from ...types import Response
def _get_kwargs(
id: int,
*,
body: Union[
PatchedAccessManagementPlace,
PatchedAccessManagementPlace,
PatchedAccessManagementPlace,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "patch",
"url": f"/api/v2/modules_registrations/access_management/places/{id}/",
}
if isinstance(body, PatchedAccessManagementPlace):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, PatchedAccessManagementPlace):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, PatchedAccessManagementPlace):
_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[AccessManagementPlace]:
if response.status_code == 200:
response_200 = AccessManagementPlace.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[AccessManagementPlace]:
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[
PatchedAccessManagementPlace,
PatchedAccessManagementPlace,
PatchedAccessManagementPlace,
],
) -> Response[AccessManagementPlace]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedAccessManagementPlace): Serializer for AccessManagementPlace model
body (PatchedAccessManagementPlace): Serializer for AccessManagementPlace model
body (PatchedAccessManagementPlace): Serializer for AccessManagementPlace model
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[AccessManagementPlace]
"""
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[
PatchedAccessManagementPlace,
PatchedAccessManagementPlace,
PatchedAccessManagementPlace,
],
) -> Optional[AccessManagementPlace]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedAccessManagementPlace): Serializer for AccessManagementPlace model
body (PatchedAccessManagementPlace): Serializer for AccessManagementPlace model
body (PatchedAccessManagementPlace): Serializer for AccessManagementPlace model
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:
AccessManagementPlace
"""
return sync_detailed(
id=id,
client=client,
body=body,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
body: Union[
PatchedAccessManagementPlace,
PatchedAccessManagementPlace,
PatchedAccessManagementPlace,
],
) -> Response[AccessManagementPlace]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedAccessManagementPlace): Serializer for AccessManagementPlace model
body (PatchedAccessManagementPlace): Serializer for AccessManagementPlace model
body (PatchedAccessManagementPlace): Serializer for AccessManagementPlace model
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[AccessManagementPlace]
"""
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[
PatchedAccessManagementPlace,
PatchedAccessManagementPlace,
PatchedAccessManagementPlace,
],
) -> Optional[AccessManagementPlace]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedAccessManagementPlace): Serializer for AccessManagementPlace model
body (PatchedAccessManagementPlace): Serializer for AccessManagementPlace model
body (PatchedAccessManagementPlace): Serializer for AccessManagementPlace model
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:
AccessManagementPlace
"""
return (
await asyncio_detailed(
id=id,
client=client,
body=body,
)
).parsed
@@ -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.access_management_place import AccessManagementPlace
from ...types import Response
def _get_kwargs(
id: int,
) -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": f"/api/v2/modules_registrations/access_management/places/{id}/",
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[AccessManagementPlace]:
if response.status_code == 200:
response_200 = AccessManagementPlace.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[AccessManagementPlace]:
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[AccessManagementPlace]:
"""ViewSet of model AccessManagementPlace
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[AccessManagementPlace]
"""
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[AccessManagementPlace]:
"""ViewSet of model AccessManagementPlace
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:
AccessManagementPlace
"""
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
) -> Response[AccessManagementPlace]:
"""ViewSet of model AccessManagementPlace
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[AccessManagementPlace]
"""
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[AccessManagementPlace]:
"""ViewSet of model AccessManagementPlace
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:
AccessManagementPlace
"""
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed
@@ -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.node_access import NodeAccess
from ...types import Response
def _get_kwargs(
*,
body: Union[
NodeAccess,
NodeAccess,
NodeAccess,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": "/api/v2/modules_registrations/options/accesses/",
}
if isinstance(body, NodeAccess):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, NodeAccess):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, NodeAccess):
_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[NodeAccess]:
if response.status_code == 201:
response_201 = NodeAccess.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[NodeAccess]:
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[
NodeAccess,
NodeAccess,
NodeAccess,
],
) -> Response[NodeAccess]:
"""This view manages accesses
It filters accesses linked to configurations, via `NodeAccessM2M` through table, which users have
access to.
Args:
body (NodeAccess): Serializer (read/write) for `NodeAccess` model
body (NodeAccess): Serializer (read/write) for `NodeAccess` model
body (NodeAccess): Serializer (read/write) for `NodeAccess` model
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[NodeAccess]
"""
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[
NodeAccess,
NodeAccess,
NodeAccess,
],
) -> Optional[NodeAccess]:
"""This view manages accesses
It filters accesses linked to configurations, via `NodeAccessM2M` through table, which users have
access to.
Args:
body (NodeAccess): Serializer (read/write) for `NodeAccess` model
body (NodeAccess): Serializer (read/write) for `NodeAccess` model
body (NodeAccess): Serializer (read/write) for `NodeAccess` model
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:
NodeAccess
"""
return sync_detailed(
client=client,
body=body,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
body: Union[
NodeAccess,
NodeAccess,
NodeAccess,
],
) -> Response[NodeAccess]:
"""This view manages accesses
It filters accesses linked to configurations, via `NodeAccessM2M` through table, which users have
access to.
Args:
body (NodeAccess): Serializer (read/write) for `NodeAccess` model
body (NodeAccess): Serializer (read/write) for `NodeAccess` model
body (NodeAccess): Serializer (read/write) for `NodeAccess` model
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[NodeAccess]
"""
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[
NodeAccess,
NodeAccess,
NodeAccess,
],
) -> Optional[NodeAccess]:
"""This view manages accesses
It filters accesses linked to configurations, via `NodeAccessM2M` through table, which users have
access to.
Args:
body (NodeAccess): Serializer (read/write) for `NodeAccess` model
body (NodeAccess): Serializer (read/write) for `NodeAccess` model
body (NodeAccess): Serializer (read/write) for `NodeAccess` model
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:
NodeAccess
"""
return (
await asyncio_detailed(
client=client,
body=body,
)
).parsed
@@ -0,0 +1,97 @@
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_registrations/options/accesses/{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]:
"""This view manages accesses
It filters accesses linked to configurations, via `NodeAccessM2M` through table, which users have
access to.
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]:
"""This view manages accesses
It filters accesses linked to configurations, via `NodeAccessM2M` through table, which users have
access to.
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)
@@ -0,0 +1,245 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.paginated_node_access_list import PaginatedNodeAccessList
from ...types import UNSET, Response, Unset
def _get_kwargs(
*,
event_id: Union[Unset, float] = UNSET,
node_configurations: Union[Unset, list[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_id"] = event_id
json_node_configurations: Union[Unset, list[int]] = UNSET
if not isinstance(node_configurations, Unset):
json_node_configurations = node_configurations
params["node_configurations"] = json_node_configurations
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_registrations/options/accesses/",
"params": params,
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[PaginatedNodeAccessList]:
if response.status_code == 200:
response_200 = PaginatedNodeAccessList.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[PaginatedNodeAccessList]:
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_id: Union[Unset, float] = UNSET,
node_configurations: Union[Unset, list[int]] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedNodeAccessList]:
"""This view manages accesses
It filters accesses linked to configurations, via `NodeAccessM2M` through table, which users have
access to.
Args:
event_id (Union[Unset, float]):
node_configurations (Union[Unset, list[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[PaginatedNodeAccessList]
"""
kwargs = _get_kwargs(
event_id=event_id,
node_configurations=node_configurations,
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_id: Union[Unset, float] = UNSET,
node_configurations: Union[Unset, list[int]] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedNodeAccessList]:
"""This view manages accesses
It filters accesses linked to configurations, via `NodeAccessM2M` through table, which users have
access to.
Args:
event_id (Union[Unset, float]):
node_configurations (Union[Unset, list[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:
PaginatedNodeAccessList
"""
return sync_detailed(
client=client,
event_id=event_id,
node_configurations=node_configurations,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
event_id: Union[Unset, float] = UNSET,
node_configurations: Union[Unset, list[int]] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedNodeAccessList]:
"""This view manages accesses
It filters accesses linked to configurations, via `NodeAccessM2M` through table, which users have
access to.
Args:
event_id (Union[Unset, float]):
node_configurations (Union[Unset, list[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[PaginatedNodeAccessList]
"""
kwargs = _get_kwargs(
event_id=event_id,
node_configurations=node_configurations,
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_id: Union[Unset, float] = UNSET,
node_configurations: Union[Unset, list[int]] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedNodeAccessList]:
"""This view manages accesses
It filters accesses linked to configurations, via `NodeAccessM2M` through table, which users have
access to.
Args:
event_id (Union[Unset, float]):
node_configurations (Union[Unset, list[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:
PaginatedNodeAccessList
"""
return (
await asyncio_detailed(
client=client,
event_id=event_id,
node_configurations=node_configurations,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
)
).parsed
@@ -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.node_access_m2m import NodeAccessM2M
from ...types import Response
def _get_kwargs(
*,
body: Union[
NodeAccessM2M,
NodeAccessM2M,
NodeAccessM2M,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": "/api/v2/modules_registrations/options/accesses_m2m/",
}
if isinstance(body, NodeAccessM2M):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, NodeAccessM2M):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, NodeAccessM2M):
_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[NodeAccessM2M]:
if response.status_code == 201:
response_201 = NodeAccessM2M.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[NodeAccessM2M]:
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[
NodeAccessM2M,
NodeAccessM2M,
NodeAccessM2M,
],
) -> Response[NodeAccessM2M]:
"""This view manages node configuration/access relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
body (NodeAccessM2M): Serializer (read/write) for `NodeAccessM2M` relation model
body (NodeAccessM2M): Serializer (read/write) for `NodeAccessM2M` relation model
body (NodeAccessM2M): Serializer (read/write) for `NodeAccessM2M` relation model
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[NodeAccessM2M]
"""
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[
NodeAccessM2M,
NodeAccessM2M,
NodeAccessM2M,
],
) -> Optional[NodeAccessM2M]:
"""This view manages node configuration/access relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
body (NodeAccessM2M): Serializer (read/write) for `NodeAccessM2M` relation model
body (NodeAccessM2M): Serializer (read/write) for `NodeAccessM2M` relation model
body (NodeAccessM2M): Serializer (read/write) for `NodeAccessM2M` relation model
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:
NodeAccessM2M
"""
return sync_detailed(
client=client,
body=body,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
body: Union[
NodeAccessM2M,
NodeAccessM2M,
NodeAccessM2M,
],
) -> Response[NodeAccessM2M]:
"""This view manages node configuration/access relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
body (NodeAccessM2M): Serializer (read/write) for `NodeAccessM2M` relation model
body (NodeAccessM2M): Serializer (read/write) for `NodeAccessM2M` relation model
body (NodeAccessM2M): Serializer (read/write) for `NodeAccessM2M` relation model
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[NodeAccessM2M]
"""
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[
NodeAccessM2M,
NodeAccessM2M,
NodeAccessM2M,
],
) -> Optional[NodeAccessM2M]:
"""This view manages node configuration/access relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
body (NodeAccessM2M): Serializer (read/write) for `NodeAccessM2M` relation model
body (NodeAccessM2M): Serializer (read/write) for `NodeAccessM2M` relation model
body (NodeAccessM2M): Serializer (read/write) for `NodeAccessM2M` relation model
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:
NodeAccessM2M
"""
return (
await asyncio_detailed(
client=client,
body=body,
)
).parsed
@@ -0,0 +1,97 @@
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_registrations/options/accesses_m2m/{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]:
"""This view manages node configuration/access relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
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]:
"""This view manages node configuration/access relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
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)
@@ -0,0 +1,256 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.paginated_node_access_m2m_list import PaginatedNodeAccessM2MList
from ...types import UNSET, Response, Unset
def _get_kwargs(
*,
access: Union[Unset, int] = UNSET,
event_id: Union[Unset, float] = UNSET,
node_configuration: 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["access"] = access
params["event_id"] = event_id
params["node_configuration"] = node_configuration
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_registrations/options/accesses_m2m/",
"params": params,
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[PaginatedNodeAccessM2MList]:
if response.status_code == 200:
response_200 = PaginatedNodeAccessM2MList.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[PaginatedNodeAccessM2MList]:
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,
access: Union[Unset, int] = UNSET,
event_id: Union[Unset, float] = UNSET,
node_configuration: 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[PaginatedNodeAccessM2MList]:
"""This view manages node configuration/access relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
access (Union[Unset, int]):
event_id (Union[Unset, float]):
node_configuration (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[PaginatedNodeAccessM2MList]
"""
kwargs = _get_kwargs(
access=access,
event_id=event_id,
node_configuration=node_configuration,
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,
access: Union[Unset, int] = UNSET,
event_id: Union[Unset, float] = UNSET,
node_configuration: 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[PaginatedNodeAccessM2MList]:
"""This view manages node configuration/access relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
access (Union[Unset, int]):
event_id (Union[Unset, float]):
node_configuration (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:
PaginatedNodeAccessM2MList
"""
return sync_detailed(
client=client,
access=access,
event_id=event_id,
node_configuration=node_configuration,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
access: Union[Unset, int] = UNSET,
event_id: Union[Unset, float] = UNSET,
node_configuration: 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[PaginatedNodeAccessM2MList]:
"""This view manages node configuration/access relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
access (Union[Unset, int]):
event_id (Union[Unset, float]):
node_configuration (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[PaginatedNodeAccessM2MList]
"""
kwargs = _get_kwargs(
access=access,
event_id=event_id,
node_configuration=node_configuration,
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,
access: Union[Unset, int] = UNSET,
event_id: Union[Unset, float] = UNSET,
node_configuration: 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[PaginatedNodeAccessM2MList]:
"""This view manages node configuration/access relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
access (Union[Unset, int]):
event_id (Union[Unset, float]):
node_configuration (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:
PaginatedNodeAccessM2MList
"""
return (
await asyncio_detailed(
client=client,
access=access,
event_id=event_id,
node_configuration=node_configuration,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
)
).parsed
@@ -0,0 +1,154 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node_access_m2m import NodeAccessM2M
from ...types import Response
def _get_kwargs(
id: int,
) -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": f"/api/v2/modules_registrations/options/accesses_m2m/{id}/",
}
return _kwargs
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[NodeAccessM2M]:
if response.status_code == 200:
response_200 = NodeAccessM2M.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[NodeAccessM2M]:
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[NodeAccessM2M]:
"""This view manages node configuration/access relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
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[NodeAccessM2M]
"""
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[NodeAccessM2M]:
"""This view manages node configuration/access relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
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:
NodeAccessM2M
"""
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
) -> Response[NodeAccessM2M]:
"""This view manages node configuration/access relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
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[NodeAccessM2M]
"""
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[NodeAccessM2M]:
"""This view manages node configuration/access relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
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:
NodeAccessM2M
"""
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed
@@ -0,0 +1,213 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node_access import NodeAccess
from ...models.patched_node_access import PatchedNodeAccess
from ...types import Response
def _get_kwargs(
id: int,
*,
body: Union[
PatchedNodeAccess,
PatchedNodeAccess,
PatchedNodeAccess,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "patch",
"url": f"/api/v2/modules_registrations/options/accesses/{id}/",
}
if isinstance(body, PatchedNodeAccess):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, PatchedNodeAccess):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, PatchedNodeAccess):
_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[NodeAccess]:
if response.status_code == 200:
response_200 = NodeAccess.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[NodeAccess]:
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[
PatchedNodeAccess,
PatchedNodeAccess,
PatchedNodeAccess,
],
) -> Response[NodeAccess]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeAccess): Serializer (read/write) for `NodeAccess` model
body (PatchedNodeAccess): Serializer (read/write) for `NodeAccess` model
body (PatchedNodeAccess): Serializer (read/write) for `NodeAccess` model
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[NodeAccess]
"""
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[
PatchedNodeAccess,
PatchedNodeAccess,
PatchedNodeAccess,
],
) -> Optional[NodeAccess]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeAccess): Serializer (read/write) for `NodeAccess` model
body (PatchedNodeAccess): Serializer (read/write) for `NodeAccess` model
body (PatchedNodeAccess): Serializer (read/write) for `NodeAccess` model
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:
NodeAccess
"""
return sync_detailed(
id=id,
client=client,
body=body,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
body: Union[
PatchedNodeAccess,
PatchedNodeAccess,
PatchedNodeAccess,
],
) -> Response[NodeAccess]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeAccess): Serializer (read/write) for `NodeAccess` model
body (PatchedNodeAccess): Serializer (read/write) for `NodeAccess` model
body (PatchedNodeAccess): Serializer (read/write) for `NodeAccess` model
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[NodeAccess]
"""
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[
PatchedNodeAccess,
PatchedNodeAccess,
PatchedNodeAccess,
],
) -> Optional[NodeAccess]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeAccess): Serializer (read/write) for `NodeAccess` model
body (PatchedNodeAccess): Serializer (read/write) for `NodeAccess` model
body (PatchedNodeAccess): Serializer (read/write) for `NodeAccess` model
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:
NodeAccess
"""
return (
await asyncio_detailed(
id=id,
client=client,
body=body,
)
).parsed
@@ -0,0 +1,154 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node_access import NodeAccess
from ...types import Response
def _get_kwargs(
id: int,
) -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": f"/api/v2/modules_registrations/options/accesses/{id}/",
}
return _kwargs
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[NodeAccess]:
if response.status_code == 200:
response_200 = NodeAccess.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[NodeAccess]:
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[NodeAccess]:
"""This view manages accesses
It filters accesses linked to configurations, via `NodeAccessM2M` through table, which users have
access to.
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[NodeAccess]
"""
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[NodeAccess]:
"""This view manages accesses
It filters accesses linked to configurations, via `NodeAccessM2M` through table, which users have
access to.
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:
NodeAccess
"""
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
) -> Response[NodeAccess]:
"""This view manages accesses
It filters accesses linked to configurations, via `NodeAccessM2M` through table, which users have
access to.
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[NodeAccess]
"""
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[NodeAccess]:
"""This view manages accesses
It filters accesses linked to configurations, via `NodeAccessM2M` through table, which users have
access to.
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:
NodeAccess
"""
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed
@@ -0,0 +1,191 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node_availability import NodeAvailability
from ...types import Response
def _get_kwargs(
*,
body: Union[
NodeAvailability,
NodeAvailability,
NodeAvailability,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": "/api/v2/modules_registrations/options/availabilities/",
}
if isinstance(body, NodeAvailability):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, NodeAvailability):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, NodeAvailability):
_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[NodeAvailability]:
if response.status_code == 201:
response_201 = NodeAvailability.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[NodeAvailability]:
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[
NodeAvailability,
NodeAvailability,
NodeAvailability,
],
) -> Response[NodeAvailability]:
"""
Args:
body (NodeAvailability): Serializer (read/write) for NodeAvailability model
body (NodeAvailability): Serializer (read/write) for NodeAvailability model
body (NodeAvailability): Serializer (read/write) for NodeAvailability model
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[NodeAvailability]
"""
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[
NodeAvailability,
NodeAvailability,
NodeAvailability,
],
) -> Optional[NodeAvailability]:
"""
Args:
body (NodeAvailability): Serializer (read/write) for NodeAvailability model
body (NodeAvailability): Serializer (read/write) for NodeAvailability model
body (NodeAvailability): Serializer (read/write) for NodeAvailability model
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:
NodeAvailability
"""
return sync_detailed(
client=client,
body=body,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
body: Union[
NodeAvailability,
NodeAvailability,
NodeAvailability,
],
) -> Response[NodeAvailability]:
"""
Args:
body (NodeAvailability): Serializer (read/write) for NodeAvailability model
body (NodeAvailability): Serializer (read/write) for NodeAvailability model
body (NodeAvailability): Serializer (read/write) for NodeAvailability model
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[NodeAvailability]
"""
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[
NodeAvailability,
NodeAvailability,
NodeAvailability,
],
) -> Optional[NodeAvailability]:
"""
Args:
body (NodeAvailability): Serializer (read/write) for NodeAvailability model
body (NodeAvailability): Serializer (read/write) for NodeAvailability model
body (NodeAvailability): Serializer (read/write) for NodeAvailability model
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:
NodeAvailability
"""
return (
await asyncio_detailed(
client=client,
body=body,
)
).parsed
@@ -0,0 +1,91 @@
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_registrations/options/availabilities/{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]:
"""
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]:
"""
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)
@@ -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.paginated_node_availability_list import PaginatedNodeAvailabilityList
from ...types import UNSET, Response, Unset
def _get_kwargs(
*,
event_id: Union[Unset, float] = UNSET,
node_configurations: Union[Unset, list[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_id"] = event_id
json_node_configurations: Union[Unset, list[int]] = UNSET
if not isinstance(node_configurations, Unset):
json_node_configurations = node_configurations
params["node_configurations"] = json_node_configurations
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_registrations/options/availabilities/",
"params": params,
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[PaginatedNodeAvailabilityList]:
if response.status_code == 200:
response_200 = PaginatedNodeAvailabilityList.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[PaginatedNodeAvailabilityList]:
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_id: Union[Unset, float] = UNSET,
node_configurations: Union[Unset, list[int]] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedNodeAvailabilityList]:
"""
Args:
event_id (Union[Unset, float]):
node_configurations (Union[Unset, list[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[PaginatedNodeAvailabilityList]
"""
kwargs = _get_kwargs(
event_id=event_id,
node_configurations=node_configurations,
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_id: Union[Unset, float] = UNSET,
node_configurations: Union[Unset, list[int]] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedNodeAvailabilityList]:
"""
Args:
event_id (Union[Unset, float]):
node_configurations (Union[Unset, list[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:
PaginatedNodeAvailabilityList
"""
return sync_detailed(
client=client,
event_id=event_id,
node_configurations=node_configurations,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
event_id: Union[Unset, float] = UNSET,
node_configurations: Union[Unset, list[int]] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedNodeAvailabilityList]:
"""
Args:
event_id (Union[Unset, float]):
node_configurations (Union[Unset, list[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[PaginatedNodeAvailabilityList]
"""
kwargs = _get_kwargs(
event_id=event_id,
node_configurations=node_configurations,
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_id: Union[Unset, float] = UNSET,
node_configurations: Union[Unset, list[int]] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedNodeAvailabilityList]:
"""
Args:
event_id (Union[Unset, float]):
node_configurations (Union[Unset, list[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:
PaginatedNodeAvailabilityList
"""
return (
await asyncio_detailed(
client=client,
event_id=event_id,
node_configurations=node_configurations,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
)
).parsed
@@ -0,0 +1,215 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node_availability_m2m import NodeAvailabilityM2M
from ...types import Response
def _get_kwargs(
*,
body: Union[
NodeAvailabilityM2M,
NodeAvailabilityM2M,
NodeAvailabilityM2M,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": "/api/v2/modules_registrations/options/availabilities_m2m/",
}
if isinstance(body, NodeAvailabilityM2M):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, NodeAvailabilityM2M):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, NodeAvailabilityM2M):
_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[NodeAvailabilityM2M]:
if response.status_code == 201:
response_201 = NodeAvailabilityM2M.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[NodeAvailabilityM2M]:
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[
NodeAvailabilityM2M,
NodeAvailabilityM2M,
NodeAvailabilityM2M,
],
) -> Response[NodeAvailabilityM2M]:
"""This view manages node configuration/availabilities relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
body (NodeAvailabilityM2M): Serializer (read/write) for `NodeAvailabilityM2M` relation
model
body (NodeAvailabilityM2M): Serializer (read/write) for `NodeAvailabilityM2M` relation
model
body (NodeAvailabilityM2M): Serializer (read/write) for `NodeAvailabilityM2M` relation
model
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[NodeAvailabilityM2M]
"""
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[
NodeAvailabilityM2M,
NodeAvailabilityM2M,
NodeAvailabilityM2M,
],
) -> Optional[NodeAvailabilityM2M]:
"""This view manages node configuration/availabilities relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
body (NodeAvailabilityM2M): Serializer (read/write) for `NodeAvailabilityM2M` relation
model
body (NodeAvailabilityM2M): Serializer (read/write) for `NodeAvailabilityM2M` relation
model
body (NodeAvailabilityM2M): Serializer (read/write) for `NodeAvailabilityM2M` relation
model
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:
NodeAvailabilityM2M
"""
return sync_detailed(
client=client,
body=body,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
body: Union[
NodeAvailabilityM2M,
NodeAvailabilityM2M,
NodeAvailabilityM2M,
],
) -> Response[NodeAvailabilityM2M]:
"""This view manages node configuration/availabilities relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
body (NodeAvailabilityM2M): Serializer (read/write) for `NodeAvailabilityM2M` relation
model
body (NodeAvailabilityM2M): Serializer (read/write) for `NodeAvailabilityM2M` relation
model
body (NodeAvailabilityM2M): Serializer (read/write) for `NodeAvailabilityM2M` relation
model
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[NodeAvailabilityM2M]
"""
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[
NodeAvailabilityM2M,
NodeAvailabilityM2M,
NodeAvailabilityM2M,
],
) -> Optional[NodeAvailabilityM2M]:
"""This view manages node configuration/availabilities relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
body (NodeAvailabilityM2M): Serializer (read/write) for `NodeAvailabilityM2M` relation
model
body (NodeAvailabilityM2M): Serializer (read/write) for `NodeAvailabilityM2M` relation
model
body (NodeAvailabilityM2M): Serializer (read/write) for `NodeAvailabilityM2M` relation
model
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:
NodeAvailabilityM2M
"""
return (
await asyncio_detailed(
client=client,
body=body,
)
).parsed
@@ -0,0 +1,97 @@
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_registrations/options/availabilities_m2m/{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]:
"""This view manages node configuration/availabilities relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
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]:
"""This view manages node configuration/availabilities relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
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)
@@ -0,0 +1,256 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.paginated_node_availability_m2m_list import PaginatedNodeAvailabilityM2MList
from ...types import UNSET, Response, Unset
def _get_kwargs(
*,
availability: Union[Unset, int] = UNSET,
event_id: Union[Unset, float] = UNSET,
node_configuration: 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["availability"] = availability
params["event_id"] = event_id
params["node_configuration"] = node_configuration
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_registrations/options/availabilities_m2m/",
"params": params,
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[PaginatedNodeAvailabilityM2MList]:
if response.status_code == 200:
response_200 = PaginatedNodeAvailabilityM2MList.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[PaginatedNodeAvailabilityM2MList]:
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,
availability: Union[Unset, int] = UNSET,
event_id: Union[Unset, float] = UNSET,
node_configuration: 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[PaginatedNodeAvailabilityM2MList]:
"""This view manages node configuration/availabilities relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
availability (Union[Unset, int]):
event_id (Union[Unset, float]):
node_configuration (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[PaginatedNodeAvailabilityM2MList]
"""
kwargs = _get_kwargs(
availability=availability,
event_id=event_id,
node_configuration=node_configuration,
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,
availability: Union[Unset, int] = UNSET,
event_id: Union[Unset, float] = UNSET,
node_configuration: 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[PaginatedNodeAvailabilityM2MList]:
"""This view manages node configuration/availabilities relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
availability (Union[Unset, int]):
event_id (Union[Unset, float]):
node_configuration (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:
PaginatedNodeAvailabilityM2MList
"""
return sync_detailed(
client=client,
availability=availability,
event_id=event_id,
node_configuration=node_configuration,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
availability: Union[Unset, int] = UNSET,
event_id: Union[Unset, float] = UNSET,
node_configuration: 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[PaginatedNodeAvailabilityM2MList]:
"""This view manages node configuration/availabilities relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
availability (Union[Unset, int]):
event_id (Union[Unset, float]):
node_configuration (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[PaginatedNodeAvailabilityM2MList]
"""
kwargs = _get_kwargs(
availability=availability,
event_id=event_id,
node_configuration=node_configuration,
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,
availability: Union[Unset, int] = UNSET,
event_id: Union[Unset, float] = UNSET,
node_configuration: 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[PaginatedNodeAvailabilityM2MList]:
"""This view manages node configuration/availabilities relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
availability (Union[Unset, int]):
event_id (Union[Unset, float]):
node_configuration (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:
PaginatedNodeAvailabilityM2MList
"""
return (
await asyncio_detailed(
client=client,
availability=availability,
event_id=event_id,
node_configuration=node_configuration,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
)
).parsed
@@ -0,0 +1,158 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node_availability_m2m import NodeAvailabilityM2M
from ...types import Response
def _get_kwargs(
id: int,
) -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": f"/api/v2/modules_registrations/options/availabilities_m2m/{id}/",
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[NodeAvailabilityM2M]:
if response.status_code == 200:
response_200 = NodeAvailabilityM2M.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[NodeAvailabilityM2M]:
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[NodeAvailabilityM2M]:
"""This view manages node configuration/availabilities relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
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[NodeAvailabilityM2M]
"""
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[NodeAvailabilityM2M]:
"""This view manages node configuration/availabilities relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
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:
NodeAvailabilityM2M
"""
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
) -> Response[NodeAvailabilityM2M]:
"""This view manages node configuration/availabilities relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
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[NodeAvailabilityM2M]
"""
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[NodeAvailabilityM2M]:
"""This view manages node configuration/availabilities relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
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:
NodeAvailabilityM2M
"""
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed
@@ -0,0 +1,217 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node_availability import NodeAvailability
from ...models.patched_node_availability import PatchedNodeAvailability
from ...types import Response
def _get_kwargs(
id: int,
*,
body: Union[
PatchedNodeAvailability,
PatchedNodeAvailability,
PatchedNodeAvailability,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "patch",
"url": f"/api/v2/modules_registrations/options/availabilities/{id}/",
}
if isinstance(body, PatchedNodeAvailability):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, PatchedNodeAvailability):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, PatchedNodeAvailability):
_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[NodeAvailability]:
if response.status_code == 200:
response_200 = NodeAvailability.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[NodeAvailability]:
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[
PatchedNodeAvailability,
PatchedNodeAvailability,
PatchedNodeAvailability,
],
) -> Response[NodeAvailability]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeAvailability): Serializer (read/write) for NodeAvailability model
body (PatchedNodeAvailability): Serializer (read/write) for NodeAvailability model
body (PatchedNodeAvailability): Serializer (read/write) for NodeAvailability model
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[NodeAvailability]
"""
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[
PatchedNodeAvailability,
PatchedNodeAvailability,
PatchedNodeAvailability,
],
) -> Optional[NodeAvailability]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeAvailability): Serializer (read/write) for NodeAvailability model
body (PatchedNodeAvailability): Serializer (read/write) for NodeAvailability model
body (PatchedNodeAvailability): Serializer (read/write) for NodeAvailability model
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:
NodeAvailability
"""
return sync_detailed(
id=id,
client=client,
body=body,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
body: Union[
PatchedNodeAvailability,
PatchedNodeAvailability,
PatchedNodeAvailability,
],
) -> Response[NodeAvailability]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeAvailability): Serializer (read/write) for NodeAvailability model
body (PatchedNodeAvailability): Serializer (read/write) for NodeAvailability model
body (PatchedNodeAvailability): Serializer (read/write) for NodeAvailability model
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[NodeAvailability]
"""
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[
PatchedNodeAvailability,
PatchedNodeAvailability,
PatchedNodeAvailability,
],
) -> Optional[NodeAvailability]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeAvailability): Serializer (read/write) for NodeAvailability model
body (PatchedNodeAvailability): Serializer (read/write) for NodeAvailability model
body (PatchedNodeAvailability): Serializer (read/write) for NodeAvailability model
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:
NodeAvailability
"""
return (
await asyncio_detailed(
id=id,
client=client,
body=body,
)
).parsed
@@ -0,0 +1,146 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node_availability import NodeAvailability
from ...types import Response
def _get_kwargs(
id: int,
) -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": f"/api/v2/modules_registrations/options/availabilities/{id}/",
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[NodeAvailability]:
if response.status_code == 200:
response_200 = NodeAvailability.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[NodeAvailability]:
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[NodeAvailability]:
"""
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[NodeAvailability]
"""
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[NodeAvailability]:
"""
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:
NodeAvailability
"""
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
) -> Response[NodeAvailability]:
"""
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[NodeAvailability]
"""
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[NodeAvailability]:
"""
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:
NodeAvailability
"""
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed
@@ -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.condition import Condition
from ...types import Response
def _get_kwargs(
*,
body: Union[
Condition,
Condition,
Condition,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": "/api/v2/modules_registrations/options/conditions/",
}
if isinstance(body, Condition):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, Condition):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, Condition):
_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[Condition]:
if response.status_code == 201:
response_201 = Condition.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[Condition]:
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[
Condition,
Condition,
Condition,
],
) -> Response[Condition]:
"""This view manages conditions
It filters conditions linked to configurations, via node configuration properties, which users have
access to.
Args:
body (Condition): Serializer (read/write) for `Condition` model
body (Condition): Serializer (read/write) for `Condition` model
body (Condition): Serializer (read/write) for `Condition` model
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[Condition]
"""
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[
Condition,
Condition,
Condition,
],
) -> Optional[Condition]:
"""This view manages conditions
It filters conditions linked to configurations, via node configuration properties, which users have
access to.
Args:
body (Condition): Serializer (read/write) for `Condition` model
body (Condition): Serializer (read/write) for `Condition` model
body (Condition): Serializer (read/write) for `Condition` model
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:
Condition
"""
return sync_detailed(
client=client,
body=body,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
body: Union[
Condition,
Condition,
Condition,
],
) -> Response[Condition]:
"""This view manages conditions
It filters conditions linked to configurations, via node configuration properties, which users have
access to.
Args:
body (Condition): Serializer (read/write) for `Condition` model
body (Condition): Serializer (read/write) for `Condition` model
body (Condition): Serializer (read/write) for `Condition` model
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[Condition]
"""
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[
Condition,
Condition,
Condition,
],
) -> Optional[Condition]:
"""This view manages conditions
It filters conditions linked to configurations, via node configuration properties, which users have
access to.
Args:
body (Condition): Serializer (read/write) for `Condition` model
body (Condition): Serializer (read/write) for `Condition` model
body (Condition): Serializer (read/write) for `Condition` model
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:
Condition
"""
return (
await asyncio_detailed(
client=client,
body=body,
)
).parsed
@@ -0,0 +1,97 @@
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_registrations/options/conditions/{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]:
"""This view manages conditions
It filters conditions linked to configurations, via node configuration properties, which users have
access to.
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]:
"""This view manages conditions
It filters conditions linked to configurations, via node configuration properties, which users have
access to.
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)
@@ -0,0 +1,226 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.paginated_condition_list import PaginatedConditionList
from ...types import UNSET, Response, Unset
def _get_kwargs(
*,
event_id: Union[Unset, float] = 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_id"] = event_id
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_registrations/options/conditions/",
"params": params,
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[PaginatedConditionList]:
if response.status_code == 200:
response_200 = PaginatedConditionList.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[PaginatedConditionList]:
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedConditionList]:
"""This view manages conditions
It filters conditions linked to configurations, via node configuration properties, which users have
access to.
Args:
event_id (Union[Unset, float]):
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[PaginatedConditionList]
"""
kwargs = _get_kwargs(
event_id=event_id,
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedConditionList]:
"""This view manages conditions
It filters conditions linked to configurations, via node configuration properties, which users have
access to.
Args:
event_id (Union[Unset, float]):
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:
PaginatedConditionList
"""
return sync_detailed(
client=client,
event_id=event_id,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
event_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedConditionList]:
"""This view manages conditions
It filters conditions linked to configurations, via node configuration properties, which users have
access to.
Args:
event_id (Union[Unset, float]):
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[PaginatedConditionList]
"""
kwargs = _get_kwargs(
event_id=event_id,
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedConditionList]:
"""This view manages conditions
It filters conditions linked to configurations, via node configuration properties, which users have
access to.
Args:
event_id (Union[Unset, float]):
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:
PaginatedConditionList
"""
return (
await asyncio_detailed(
client=client,
event_id=event_id,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
)
).parsed
@@ -0,0 +1,213 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.condition import Condition
from ...models.patched_condition import PatchedCondition
from ...types import Response
def _get_kwargs(
id: int,
*,
body: Union[
PatchedCondition,
PatchedCondition,
PatchedCondition,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "patch",
"url": f"/api/v2/modules_registrations/options/conditions/{id}/",
}
if isinstance(body, PatchedCondition):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, PatchedCondition):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, PatchedCondition):
_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[Condition]:
if response.status_code == 200:
response_200 = Condition.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[Condition]:
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[
PatchedCondition,
PatchedCondition,
PatchedCondition,
],
) -> Response[Condition]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedCondition): Serializer (read/write) for `Condition` model
body (PatchedCondition): Serializer (read/write) for `Condition` model
body (PatchedCondition): Serializer (read/write) for `Condition` model
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[Condition]
"""
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[
PatchedCondition,
PatchedCondition,
PatchedCondition,
],
) -> Optional[Condition]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedCondition): Serializer (read/write) for `Condition` model
body (PatchedCondition): Serializer (read/write) for `Condition` model
body (PatchedCondition): Serializer (read/write) for `Condition` model
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:
Condition
"""
return sync_detailed(
id=id,
client=client,
body=body,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
body: Union[
PatchedCondition,
PatchedCondition,
PatchedCondition,
],
) -> Response[Condition]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedCondition): Serializer (read/write) for `Condition` model
body (PatchedCondition): Serializer (read/write) for `Condition` model
body (PatchedCondition): Serializer (read/write) for `Condition` model
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[Condition]
"""
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[
PatchedCondition,
PatchedCondition,
PatchedCondition,
],
) -> Optional[Condition]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedCondition): Serializer (read/write) for `Condition` model
body (PatchedCondition): Serializer (read/write) for `Condition` model
body (PatchedCondition): Serializer (read/write) for `Condition` model
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:
Condition
"""
return (
await asyncio_detailed(
id=id,
client=client,
body=body,
)
).parsed
@@ -0,0 +1,154 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.condition import Condition
from ...types import Response
def _get_kwargs(
id: int,
) -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": f"/api/v2/modules_registrations/options/conditions/{id}/",
}
return _kwargs
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Condition]:
if response.status_code == 200:
response_200 = Condition.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[Condition]:
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[Condition]:
"""This view manages conditions
It filters conditions linked to configurations, via node configuration properties, which users have
access to.
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[Condition]
"""
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[Condition]:
"""This view manages conditions
It filters conditions linked to configurations, via node configuration properties, which users have
access to.
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:
Condition
"""
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
) -> Response[Condition]:
"""This view manages conditions
It filters conditions linked to configurations, via node configuration properties, which users have
access to.
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[Condition]
"""
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[Condition]:
"""This view manages conditions
It filters conditions linked to configurations, via node configuration properties, which users have
access to.
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:
Condition
"""
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed
@@ -0,0 +1,203 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node_extra_info_group import NodeExtraInfoGroup
from ...types import Response
def _get_kwargs(
*,
body: Union[
NodeExtraInfoGroup,
NodeExtraInfoGroup,
NodeExtraInfoGroup,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": "/api/v2/modules_registrations/options/extra_info_groups/",
}
if isinstance(body, NodeExtraInfoGroup):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, NodeExtraInfoGroup):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, NodeExtraInfoGroup):
_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[NodeExtraInfoGroup]:
if response.status_code == 201:
response_201 = NodeExtraInfoGroup.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[NodeExtraInfoGroup]:
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[
NodeExtraInfoGroup,
NodeExtraInfoGroup,
NodeExtraInfoGroup,
],
) -> Response[NodeExtraInfoGroup]:
"""This view manages extra info group
It filters groups linked to configurations, via `NodeExtraInfoGroupM2M` through table, which users
have access to.
Args:
body (NodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model
body (NodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model
body (NodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model
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[NodeExtraInfoGroup]
"""
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[
NodeExtraInfoGroup,
NodeExtraInfoGroup,
NodeExtraInfoGroup,
],
) -> Optional[NodeExtraInfoGroup]:
"""This view manages extra info group
It filters groups linked to configurations, via `NodeExtraInfoGroupM2M` through table, which users
have access to.
Args:
body (NodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model
body (NodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model
body (NodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model
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:
NodeExtraInfoGroup
"""
return sync_detailed(
client=client,
body=body,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
body: Union[
NodeExtraInfoGroup,
NodeExtraInfoGroup,
NodeExtraInfoGroup,
],
) -> Response[NodeExtraInfoGroup]:
"""This view manages extra info group
It filters groups linked to configurations, via `NodeExtraInfoGroupM2M` through table, which users
have access to.
Args:
body (NodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model
body (NodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model
body (NodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model
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[NodeExtraInfoGroup]
"""
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[
NodeExtraInfoGroup,
NodeExtraInfoGroup,
NodeExtraInfoGroup,
],
) -> Optional[NodeExtraInfoGroup]:
"""This view manages extra info group
It filters groups linked to configurations, via `NodeExtraInfoGroupM2M` through table, which users
have access to.
Args:
body (NodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model
body (NodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model
body (NodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model
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:
NodeExtraInfoGroup
"""
return (
await asyncio_detailed(
client=client,
body=body,
)
).parsed
@@ -0,0 +1,97 @@
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_registrations/options/extra_info_groups/{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]:
"""This view manages extra info group
It filters groups linked to configurations, via `NodeExtraInfoGroupM2M` through table, which users
have access to.
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]:
"""This view manages extra info group
It filters groups linked to configurations, via `NodeExtraInfoGroupM2M` through table, which users
have access to.
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)
@@ -0,0 +1,226 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.paginated_node_extra_info_group_list import PaginatedNodeExtraInfoGroupList
from ...types import UNSET, Response, Unset
def _get_kwargs(
*,
event_id: Union[Unset, float] = 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_id"] = event_id
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_registrations/options/extra_info_groups/",
"params": params,
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[PaginatedNodeExtraInfoGroupList]:
if response.status_code == 200:
response_200 = PaginatedNodeExtraInfoGroupList.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[PaginatedNodeExtraInfoGroupList]:
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedNodeExtraInfoGroupList]:
"""This view manages extra info group
It filters groups linked to configurations, via `NodeExtraInfoGroupM2M` through table, which users
have access to.
Args:
event_id (Union[Unset, float]):
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[PaginatedNodeExtraInfoGroupList]
"""
kwargs = _get_kwargs(
event_id=event_id,
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedNodeExtraInfoGroupList]:
"""This view manages extra info group
It filters groups linked to configurations, via `NodeExtraInfoGroupM2M` through table, which users
have access to.
Args:
event_id (Union[Unset, float]):
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:
PaginatedNodeExtraInfoGroupList
"""
return sync_detailed(
client=client,
event_id=event_id,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
event_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedNodeExtraInfoGroupList]:
"""This view manages extra info group
It filters groups linked to configurations, via `NodeExtraInfoGroupM2M` through table, which users
have access to.
Args:
event_id (Union[Unset, float]):
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[PaginatedNodeExtraInfoGroupList]
"""
kwargs = _get_kwargs(
event_id=event_id,
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedNodeExtraInfoGroupList]:
"""This view manages extra info group
It filters groups linked to configurations, via `NodeExtraInfoGroupM2M` through table, which users
have access to.
Args:
event_id (Union[Unset, float]):
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:
PaginatedNodeExtraInfoGroupList
"""
return (
await asyncio_detailed(
client=client,
event_id=event_id,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
)
).parsed
@@ -0,0 +1,215 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node_extra_info_group_m2m import NodeExtraInfoGroupM2M
from ...types import Response
def _get_kwargs(
*,
body: Union[
NodeExtraInfoGroupM2M,
NodeExtraInfoGroupM2M,
NodeExtraInfoGroupM2M,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": "/api/v2/modules_registrations/options/extra_info_groups_m2m/",
}
if isinstance(body, NodeExtraInfoGroupM2M):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, NodeExtraInfoGroupM2M):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, NodeExtraInfoGroupM2M):
_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[NodeExtraInfoGroupM2M]:
if response.status_code == 201:
response_201 = NodeExtraInfoGroupM2M.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[NodeExtraInfoGroupM2M]:
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[
NodeExtraInfoGroupM2M,
NodeExtraInfoGroupM2M,
NodeExtraInfoGroupM2M,
],
) -> Response[NodeExtraInfoGroupM2M]:
"""This view manages node configuration/extra group info relations.
PUT and PATCH methods are not supported.
It filters relations linked to configurations which users have access to.
Args:
body (NodeExtraInfoGroupM2M): Serializer (read/write) for `NodeExtraInfoGroupM2M` relation
model
body (NodeExtraInfoGroupM2M): Serializer (read/write) for `NodeExtraInfoGroupM2M` relation
model
body (NodeExtraInfoGroupM2M): Serializer (read/write) for `NodeExtraInfoGroupM2M` relation
model
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[NodeExtraInfoGroupM2M]
"""
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[
NodeExtraInfoGroupM2M,
NodeExtraInfoGroupM2M,
NodeExtraInfoGroupM2M,
],
) -> Optional[NodeExtraInfoGroupM2M]:
"""This view manages node configuration/extra group info relations.
PUT and PATCH methods are not supported.
It filters relations linked to configurations which users have access to.
Args:
body (NodeExtraInfoGroupM2M): Serializer (read/write) for `NodeExtraInfoGroupM2M` relation
model
body (NodeExtraInfoGroupM2M): Serializer (read/write) for `NodeExtraInfoGroupM2M` relation
model
body (NodeExtraInfoGroupM2M): Serializer (read/write) for `NodeExtraInfoGroupM2M` relation
model
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:
NodeExtraInfoGroupM2M
"""
return sync_detailed(
client=client,
body=body,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
body: Union[
NodeExtraInfoGroupM2M,
NodeExtraInfoGroupM2M,
NodeExtraInfoGroupM2M,
],
) -> Response[NodeExtraInfoGroupM2M]:
"""This view manages node configuration/extra group info relations.
PUT and PATCH methods are not supported.
It filters relations linked to configurations which users have access to.
Args:
body (NodeExtraInfoGroupM2M): Serializer (read/write) for `NodeExtraInfoGroupM2M` relation
model
body (NodeExtraInfoGroupM2M): Serializer (read/write) for `NodeExtraInfoGroupM2M` relation
model
body (NodeExtraInfoGroupM2M): Serializer (read/write) for `NodeExtraInfoGroupM2M` relation
model
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[NodeExtraInfoGroupM2M]
"""
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[
NodeExtraInfoGroupM2M,
NodeExtraInfoGroupM2M,
NodeExtraInfoGroupM2M,
],
) -> Optional[NodeExtraInfoGroupM2M]:
"""This view manages node configuration/extra group info relations.
PUT and PATCH methods are not supported.
It filters relations linked to configurations which users have access to.
Args:
body (NodeExtraInfoGroupM2M): Serializer (read/write) for `NodeExtraInfoGroupM2M` relation
model
body (NodeExtraInfoGroupM2M): Serializer (read/write) for `NodeExtraInfoGroupM2M` relation
model
body (NodeExtraInfoGroupM2M): Serializer (read/write) for `NodeExtraInfoGroupM2M` relation
model
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:
NodeExtraInfoGroupM2M
"""
return (
await asyncio_detailed(
client=client,
body=body,
)
).parsed
@@ -0,0 +1,97 @@
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_registrations/options/extra_info_groups_m2m/{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]:
"""This view manages node configuration/extra group info relations.
PUT and PATCH methods are not supported.
It filters relations linked to configurations which users have access to.
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]:
"""This view manages node configuration/extra group info relations.
PUT and PATCH methods are not supported.
It filters relations linked to configurations which users have access to.
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)
@@ -0,0 +1,226 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.paginated_node_extra_info_group_m2m_list import PaginatedNodeExtraInfoGroupM2MList
from ...types import UNSET, Response, Unset
def _get_kwargs(
*,
event_id: Union[Unset, float] = 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_id"] = event_id
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_registrations/options/extra_info_groups_m2m/",
"params": params,
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[PaginatedNodeExtraInfoGroupM2MList]:
if response.status_code == 200:
response_200 = PaginatedNodeExtraInfoGroupM2MList.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[PaginatedNodeExtraInfoGroupM2MList]:
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedNodeExtraInfoGroupM2MList]:
"""This view manages node configuration/extra group info relations.
PUT and PATCH methods are not supported.
It filters relations linked to configurations which users have access to.
Args:
event_id (Union[Unset, float]):
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[PaginatedNodeExtraInfoGroupM2MList]
"""
kwargs = _get_kwargs(
event_id=event_id,
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedNodeExtraInfoGroupM2MList]:
"""This view manages node configuration/extra group info relations.
PUT and PATCH methods are not supported.
It filters relations linked to configurations which users have access to.
Args:
event_id (Union[Unset, float]):
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:
PaginatedNodeExtraInfoGroupM2MList
"""
return sync_detailed(
client=client,
event_id=event_id,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
event_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedNodeExtraInfoGroupM2MList]:
"""This view manages node configuration/extra group info relations.
PUT and PATCH methods are not supported.
It filters relations linked to configurations which users have access to.
Args:
event_id (Union[Unset, float]):
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[PaginatedNodeExtraInfoGroupM2MList]
"""
kwargs = _get_kwargs(
event_id=event_id,
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedNodeExtraInfoGroupM2MList]:
"""This view manages node configuration/extra group info relations.
PUT and PATCH methods are not supported.
It filters relations linked to configurations which users have access to.
Args:
event_id (Union[Unset, float]):
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:
PaginatedNodeExtraInfoGroupM2MList
"""
return (
await asyncio_detailed(
client=client,
event_id=event_id,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
)
).parsed
@@ -0,0 +1,158 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node_extra_info_group_m2m import NodeExtraInfoGroupM2M
from ...types import Response
def _get_kwargs(
id: int,
) -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": f"/api/v2/modules_registrations/options/extra_info_groups_m2m/{id}/",
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[NodeExtraInfoGroupM2M]:
if response.status_code == 200:
response_200 = NodeExtraInfoGroupM2M.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[NodeExtraInfoGroupM2M]:
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[NodeExtraInfoGroupM2M]:
"""This view manages node configuration/extra group info relations.
PUT and PATCH methods are not supported.
It filters relations linked to configurations which users have access to.
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[NodeExtraInfoGroupM2M]
"""
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[NodeExtraInfoGroupM2M]:
"""This view manages node configuration/extra group info relations.
PUT and PATCH methods are not supported.
It filters relations linked to configurations which users have access to.
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:
NodeExtraInfoGroupM2M
"""
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
) -> Response[NodeExtraInfoGroupM2M]:
"""This view manages node configuration/extra group info relations.
PUT and PATCH methods are not supported.
It filters relations linked to configurations which users have access to.
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[NodeExtraInfoGroupM2M]
"""
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[NodeExtraInfoGroupM2M]:
"""This view manages node configuration/extra group info relations.
PUT and PATCH methods are not supported.
It filters relations linked to configurations which users have access to.
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:
NodeExtraInfoGroupM2M
"""
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed
@@ -0,0 +1,217 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node_extra_info_group import NodeExtraInfoGroup
from ...models.patched_node_extra_info_group import PatchedNodeExtraInfoGroup
from ...types import Response
def _get_kwargs(
id: int,
*,
body: Union[
PatchedNodeExtraInfoGroup,
PatchedNodeExtraInfoGroup,
PatchedNodeExtraInfoGroup,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "patch",
"url": f"/api/v2/modules_registrations/options/extra_info_groups/{id}/",
}
if isinstance(body, PatchedNodeExtraInfoGroup):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, PatchedNodeExtraInfoGroup):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, PatchedNodeExtraInfoGroup):
_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[NodeExtraInfoGroup]:
if response.status_code == 200:
response_200 = NodeExtraInfoGroup.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[NodeExtraInfoGroup]:
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[
PatchedNodeExtraInfoGroup,
PatchedNodeExtraInfoGroup,
PatchedNodeExtraInfoGroup,
],
) -> Response[NodeExtraInfoGroup]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model
body (PatchedNodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model
body (PatchedNodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model
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[NodeExtraInfoGroup]
"""
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[
PatchedNodeExtraInfoGroup,
PatchedNodeExtraInfoGroup,
PatchedNodeExtraInfoGroup,
],
) -> Optional[NodeExtraInfoGroup]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model
body (PatchedNodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model
body (PatchedNodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model
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:
NodeExtraInfoGroup
"""
return sync_detailed(
id=id,
client=client,
body=body,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
body: Union[
PatchedNodeExtraInfoGroup,
PatchedNodeExtraInfoGroup,
PatchedNodeExtraInfoGroup,
],
) -> Response[NodeExtraInfoGroup]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model
body (PatchedNodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model
body (PatchedNodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model
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[NodeExtraInfoGroup]
"""
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[
PatchedNodeExtraInfoGroup,
PatchedNodeExtraInfoGroup,
PatchedNodeExtraInfoGroup,
],
) -> Optional[NodeExtraInfoGroup]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model
body (PatchedNodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model
body (PatchedNodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model
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:
NodeExtraInfoGroup
"""
return (
await asyncio_detailed(
id=id,
client=client,
body=body,
)
).parsed
@@ -0,0 +1,158 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node_extra_info_group import NodeExtraInfoGroup
from ...types import Response
def _get_kwargs(
id: int,
) -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": f"/api/v2/modules_registrations/options/extra_info_groups/{id}/",
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[NodeExtraInfoGroup]:
if response.status_code == 200:
response_200 = NodeExtraInfoGroup.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[NodeExtraInfoGroup]:
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[NodeExtraInfoGroup]:
"""This view manages extra info group
It filters groups linked to configurations, via `NodeExtraInfoGroupM2M` through table, which users
have access to.
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[NodeExtraInfoGroup]
"""
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[NodeExtraInfoGroup]:
"""This view manages extra info group
It filters groups linked to configurations, via `NodeExtraInfoGroupM2M` through table, which users
have access to.
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:
NodeExtraInfoGroup
"""
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
) -> Response[NodeExtraInfoGroup]:
"""This view manages extra info group
It filters groups linked to configurations, via `NodeExtraInfoGroupM2M` through table, which users
have access to.
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[NodeExtraInfoGroup]
"""
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[NodeExtraInfoGroup]:
"""This view manages extra info group
It filters groups linked to configurations, via `NodeExtraInfoGroupM2M` through table, which users
have access to.
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:
NodeExtraInfoGroup
"""
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed
@@ -0,0 +1,195 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node_extra_info import NodeExtraInfo
from ...types import Response
def _get_kwargs(
*,
body: Union[
NodeExtraInfo,
NodeExtraInfo,
NodeExtraInfo,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": "/api/v2/modules_registrations/options/extra_infos/",
}
if isinstance(body, NodeExtraInfo):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, NodeExtraInfo):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, NodeExtraInfo):
_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[NodeExtraInfo]:
if response.status_code == 201:
response_201 = NodeExtraInfo.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[NodeExtraInfo]:
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[
NodeExtraInfo,
NodeExtraInfo,
NodeExtraInfo,
],
) -> Response[NodeExtraInfo]:
"""This view manages extra infos
It filters extra infos linked to groups which users have access to.
Args:
body (NodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model
body (NodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model
body (NodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model
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[NodeExtraInfo]
"""
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[
NodeExtraInfo,
NodeExtraInfo,
NodeExtraInfo,
],
) -> Optional[NodeExtraInfo]:
"""This view manages extra infos
It filters extra infos linked to groups which users have access to.
Args:
body (NodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model
body (NodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model
body (NodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model
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:
NodeExtraInfo
"""
return sync_detailed(
client=client,
body=body,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
body: Union[
NodeExtraInfo,
NodeExtraInfo,
NodeExtraInfo,
],
) -> Response[NodeExtraInfo]:
"""This view manages extra infos
It filters extra infos linked to groups which users have access to.
Args:
body (NodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model
body (NodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model
body (NodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model
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[NodeExtraInfo]
"""
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[
NodeExtraInfo,
NodeExtraInfo,
NodeExtraInfo,
],
) -> Optional[NodeExtraInfo]:
"""This view manages extra infos
It filters extra infos linked to groups which users have access to.
Args:
body (NodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model
body (NodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model
body (NodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model
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:
NodeExtraInfo
"""
return (
await asyncio_detailed(
client=client,
body=body,
)
).parsed
@@ -0,0 +1,95 @@
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_registrations/options/extra_infos/{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]:
"""This view manages extra infos
It filters extra infos linked to groups which users have access to.
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]:
"""This view manages extra infos
It filters extra infos linked to groups which users have access to.
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)
@@ -0,0 +1,222 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.paginated_node_extra_info_list import PaginatedNodeExtraInfoList
from ...types import UNSET, Response, Unset
def _get_kwargs(
*,
event_id: Union[Unset, float] = 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_id"] = event_id
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_registrations/options/extra_infos/",
"params": params,
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[PaginatedNodeExtraInfoList]:
if response.status_code == 200:
response_200 = PaginatedNodeExtraInfoList.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[PaginatedNodeExtraInfoList]:
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedNodeExtraInfoList]:
"""This view manages extra infos
It filters extra infos linked to groups which users have access to.
Args:
event_id (Union[Unset, float]):
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[PaginatedNodeExtraInfoList]
"""
kwargs = _get_kwargs(
event_id=event_id,
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedNodeExtraInfoList]:
"""This view manages extra infos
It filters extra infos linked to groups which users have access to.
Args:
event_id (Union[Unset, float]):
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:
PaginatedNodeExtraInfoList
"""
return sync_detailed(
client=client,
event_id=event_id,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
event_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedNodeExtraInfoList]:
"""This view manages extra infos
It filters extra infos linked to groups which users have access to.
Args:
event_id (Union[Unset, float]):
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[PaginatedNodeExtraInfoList]
"""
kwargs = _get_kwargs(
event_id=event_id,
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedNodeExtraInfoList]:
"""This view manages extra infos
It filters extra infos linked to groups which users have access to.
Args:
event_id (Union[Unset, float]):
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:
PaginatedNodeExtraInfoList
"""
return (
await asyncio_detailed(
client=client,
event_id=event_id,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
)
).parsed
@@ -0,0 +1,213 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node_extra_info import NodeExtraInfo
from ...models.patched_node_extra_info import PatchedNodeExtraInfo
from ...types import Response
def _get_kwargs(
id: int,
*,
body: Union[
PatchedNodeExtraInfo,
PatchedNodeExtraInfo,
PatchedNodeExtraInfo,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "patch",
"url": f"/api/v2/modules_registrations/options/extra_infos/{id}/",
}
if isinstance(body, PatchedNodeExtraInfo):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, PatchedNodeExtraInfo):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, PatchedNodeExtraInfo):
_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[NodeExtraInfo]:
if response.status_code == 200:
response_200 = NodeExtraInfo.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[NodeExtraInfo]:
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[
PatchedNodeExtraInfo,
PatchedNodeExtraInfo,
PatchedNodeExtraInfo,
],
) -> Response[NodeExtraInfo]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model
body (PatchedNodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model
body (PatchedNodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model
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[NodeExtraInfo]
"""
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[
PatchedNodeExtraInfo,
PatchedNodeExtraInfo,
PatchedNodeExtraInfo,
],
) -> Optional[NodeExtraInfo]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model
body (PatchedNodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model
body (PatchedNodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model
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:
NodeExtraInfo
"""
return sync_detailed(
id=id,
client=client,
body=body,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
body: Union[
PatchedNodeExtraInfo,
PatchedNodeExtraInfo,
PatchedNodeExtraInfo,
],
) -> Response[NodeExtraInfo]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model
body (PatchedNodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model
body (PatchedNodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model
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[NodeExtraInfo]
"""
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[
PatchedNodeExtraInfo,
PatchedNodeExtraInfo,
PatchedNodeExtraInfo,
],
) -> Optional[NodeExtraInfo]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model
body (PatchedNodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model
body (PatchedNodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model
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:
NodeExtraInfo
"""
return (
await asyncio_detailed(
id=id,
client=client,
body=body,
)
).parsed
@@ -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.node_extra_info import NodeExtraInfo
from ...types import Response
def _get_kwargs(
id: int,
) -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": f"/api/v2/modules_registrations/options/extra_infos/{id}/",
}
return _kwargs
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[NodeExtraInfo]:
if response.status_code == 200:
response_200 = NodeExtraInfo.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[NodeExtraInfo]:
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[NodeExtraInfo]:
"""This view manages extra infos
It filters extra infos linked to groups which users have access to.
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[NodeExtraInfo]
"""
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[NodeExtraInfo]:
"""This view manages extra infos
It filters extra infos linked to groups which users have access to.
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:
NodeExtraInfo
"""
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
) -> Response[NodeExtraInfo]:
"""This view manages extra infos
It filters extra infos linked to groups which users have access to.
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[NodeExtraInfo]
"""
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[NodeExtraInfo]:
"""This view manages extra infos
It filters extra infos linked to groups which users have access to.
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:
NodeExtraInfo
"""
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed
@@ -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.node_limit import NodeLimit
from ...types import Response
def _get_kwargs(
*,
body: Union[
NodeLimit,
NodeLimit,
NodeLimit,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": "/api/v2/modules_registrations/options/limits/",
}
if isinstance(body, NodeLimit):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, NodeLimit):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, NodeLimit):
_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[NodeLimit]:
if response.status_code == 201:
response_201 = NodeLimit.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[NodeLimit]:
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[
NodeLimit,
NodeLimit,
NodeLimit,
],
) -> Response[NodeLimit]:
"""This view manages limits
It filters limits linked to configurations, via `NodeLimitM2M` through table, which users have
access to.
Args:
body (NodeLimit): Serializer (read/write) for `NodeLimit` model
body (NodeLimit): Serializer (read/write) for `NodeLimit` model
body (NodeLimit): Serializer (read/write) for `NodeLimit` model
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[NodeLimit]
"""
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[
NodeLimit,
NodeLimit,
NodeLimit,
],
) -> Optional[NodeLimit]:
"""This view manages limits
It filters limits linked to configurations, via `NodeLimitM2M` through table, which users have
access to.
Args:
body (NodeLimit): Serializer (read/write) for `NodeLimit` model
body (NodeLimit): Serializer (read/write) for `NodeLimit` model
body (NodeLimit): Serializer (read/write) for `NodeLimit` model
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:
NodeLimit
"""
return sync_detailed(
client=client,
body=body,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
body: Union[
NodeLimit,
NodeLimit,
NodeLimit,
],
) -> Response[NodeLimit]:
"""This view manages limits
It filters limits linked to configurations, via `NodeLimitM2M` through table, which users have
access to.
Args:
body (NodeLimit): Serializer (read/write) for `NodeLimit` model
body (NodeLimit): Serializer (read/write) for `NodeLimit` model
body (NodeLimit): Serializer (read/write) for `NodeLimit` model
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[NodeLimit]
"""
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[
NodeLimit,
NodeLimit,
NodeLimit,
],
) -> Optional[NodeLimit]:
"""This view manages limits
It filters limits linked to configurations, via `NodeLimitM2M` through table, which users have
access to.
Args:
body (NodeLimit): Serializer (read/write) for `NodeLimit` model
body (NodeLimit): Serializer (read/write) for `NodeLimit` model
body (NodeLimit): Serializer (read/write) for `NodeLimit` model
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:
NodeLimit
"""
return (
await asyncio_detailed(
client=client,
body=body,
)
).parsed
@@ -0,0 +1,97 @@
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_registrations/options/limits/{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]:
"""This view manages limits
It filters limits linked to configurations, via `NodeLimitM2M` through table, which users have
access to.
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]:
"""This view manages limits
It filters limits linked to configurations, via `NodeLimitM2M` through table, which users have
access to.
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)
@@ -0,0 +1,245 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.paginated_node_limit_list import PaginatedNodeLimitList
from ...types import UNSET, Response, Unset
def _get_kwargs(
*,
event_id: Union[Unset, float] = UNSET,
node_configurations: Union[Unset, list[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_id"] = event_id
json_node_configurations: Union[Unset, list[int]] = UNSET
if not isinstance(node_configurations, Unset):
json_node_configurations = node_configurations
params["node_configurations"] = json_node_configurations
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_registrations/options/limits/",
"params": params,
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[PaginatedNodeLimitList]:
if response.status_code == 200:
response_200 = PaginatedNodeLimitList.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[PaginatedNodeLimitList]:
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_id: Union[Unset, float] = UNSET,
node_configurations: Union[Unset, list[int]] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedNodeLimitList]:
"""This view manages limits
It filters limits linked to configurations, via `NodeLimitM2M` through table, which users have
access to.
Args:
event_id (Union[Unset, float]):
node_configurations (Union[Unset, list[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[PaginatedNodeLimitList]
"""
kwargs = _get_kwargs(
event_id=event_id,
node_configurations=node_configurations,
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_id: Union[Unset, float] = UNSET,
node_configurations: Union[Unset, list[int]] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedNodeLimitList]:
"""This view manages limits
It filters limits linked to configurations, via `NodeLimitM2M` through table, which users have
access to.
Args:
event_id (Union[Unset, float]):
node_configurations (Union[Unset, list[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:
PaginatedNodeLimitList
"""
return sync_detailed(
client=client,
event_id=event_id,
node_configurations=node_configurations,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
event_id: Union[Unset, float] = UNSET,
node_configurations: Union[Unset, list[int]] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedNodeLimitList]:
"""This view manages limits
It filters limits linked to configurations, via `NodeLimitM2M` through table, which users have
access to.
Args:
event_id (Union[Unset, float]):
node_configurations (Union[Unset, list[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[PaginatedNodeLimitList]
"""
kwargs = _get_kwargs(
event_id=event_id,
node_configurations=node_configurations,
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_id: Union[Unset, float] = UNSET,
node_configurations: Union[Unset, list[int]] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedNodeLimitList]:
"""This view manages limits
It filters limits linked to configurations, via `NodeLimitM2M` through table, which users have
access to.
Args:
event_id (Union[Unset, float]):
node_configurations (Union[Unset, list[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:
PaginatedNodeLimitList
"""
return (
await asyncio_detailed(
client=client,
event_id=event_id,
node_configurations=node_configurations,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
)
).parsed
@@ -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.node_limit_m2m import NodeLimitM2M
from ...types import Response
def _get_kwargs(
*,
body: Union[
NodeLimitM2M,
NodeLimitM2M,
NodeLimitM2M,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": "/api/v2/modules_registrations/options/limits_m2m/",
}
if isinstance(body, NodeLimitM2M):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, NodeLimitM2M):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, NodeLimitM2M):
_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[NodeLimitM2M]:
if response.status_code == 201:
response_201 = NodeLimitM2M.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[NodeLimitM2M]:
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[
NodeLimitM2M,
NodeLimitM2M,
NodeLimitM2M,
],
) -> Response[NodeLimitM2M]:
"""This view manages node configuration/limits relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
body (NodeLimitM2M): Serializer (read/write) for `NodeLimitM2M` relation model
body (NodeLimitM2M): Serializer (read/write) for `NodeLimitM2M` relation model
body (NodeLimitM2M): Serializer (read/write) for `NodeLimitM2M` relation model
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[NodeLimitM2M]
"""
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[
NodeLimitM2M,
NodeLimitM2M,
NodeLimitM2M,
],
) -> Optional[NodeLimitM2M]:
"""This view manages node configuration/limits relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
body (NodeLimitM2M): Serializer (read/write) for `NodeLimitM2M` relation model
body (NodeLimitM2M): Serializer (read/write) for `NodeLimitM2M` relation model
body (NodeLimitM2M): Serializer (read/write) for `NodeLimitM2M` relation model
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:
NodeLimitM2M
"""
return sync_detailed(
client=client,
body=body,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
body: Union[
NodeLimitM2M,
NodeLimitM2M,
NodeLimitM2M,
],
) -> Response[NodeLimitM2M]:
"""This view manages node configuration/limits relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
body (NodeLimitM2M): Serializer (read/write) for `NodeLimitM2M` relation model
body (NodeLimitM2M): Serializer (read/write) for `NodeLimitM2M` relation model
body (NodeLimitM2M): Serializer (read/write) for `NodeLimitM2M` relation model
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[NodeLimitM2M]
"""
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[
NodeLimitM2M,
NodeLimitM2M,
NodeLimitM2M,
],
) -> Optional[NodeLimitM2M]:
"""This view manages node configuration/limits relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
body (NodeLimitM2M): Serializer (read/write) for `NodeLimitM2M` relation model
body (NodeLimitM2M): Serializer (read/write) for `NodeLimitM2M` relation model
body (NodeLimitM2M): Serializer (read/write) for `NodeLimitM2M` relation model
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:
NodeLimitM2M
"""
return (
await asyncio_detailed(
client=client,
body=body,
)
).parsed
@@ -0,0 +1,97 @@
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_registrations/options/limits_m2m/{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]:
"""This view manages node configuration/limits relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
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]:
"""This view manages node configuration/limits relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
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)
@@ -0,0 +1,256 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.paginated_node_limit_m2m_list import PaginatedNodeLimitM2MList
from ...types import UNSET, Response, Unset
def _get_kwargs(
*,
event_id: Union[Unset, float] = UNSET,
limit: Union[Unset, int] = UNSET,
node_configuration: 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_id"] = event_id
params["limit"] = limit
params["node_configuration"] = node_configuration
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_registrations/options/limits_m2m/",
"params": params,
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[PaginatedNodeLimitM2MList]:
if response.status_code == 200:
response_200 = PaginatedNodeLimitM2MList.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[PaginatedNodeLimitM2MList]:
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_id: Union[Unset, float] = UNSET,
limit: Union[Unset, int] = UNSET,
node_configuration: 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[PaginatedNodeLimitM2MList]:
"""This view manages node configuration/limits relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
event_id (Union[Unset, float]):
limit (Union[Unset, int]):
node_configuration (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[PaginatedNodeLimitM2MList]
"""
kwargs = _get_kwargs(
event_id=event_id,
limit=limit,
node_configuration=node_configuration,
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_id: Union[Unset, float] = UNSET,
limit: Union[Unset, int] = UNSET,
node_configuration: 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[PaginatedNodeLimitM2MList]:
"""This view manages node configuration/limits relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
event_id (Union[Unset, float]):
limit (Union[Unset, int]):
node_configuration (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:
PaginatedNodeLimitM2MList
"""
return sync_detailed(
client=client,
event_id=event_id,
limit=limit,
node_configuration=node_configuration,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
event_id: Union[Unset, float] = UNSET,
limit: Union[Unset, int] = UNSET,
node_configuration: 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[PaginatedNodeLimitM2MList]:
"""This view manages node configuration/limits relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
event_id (Union[Unset, float]):
limit (Union[Unset, int]):
node_configuration (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[PaginatedNodeLimitM2MList]
"""
kwargs = _get_kwargs(
event_id=event_id,
limit=limit,
node_configuration=node_configuration,
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_id: Union[Unset, float] = UNSET,
limit: Union[Unset, int] = UNSET,
node_configuration: 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[PaginatedNodeLimitM2MList]:
"""This view manages node configuration/limits relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
event_id (Union[Unset, float]):
limit (Union[Unset, int]):
node_configuration (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:
PaginatedNodeLimitM2MList
"""
return (
await asyncio_detailed(
client=client,
event_id=event_id,
limit=limit,
node_configuration=node_configuration,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
)
).parsed
@@ -0,0 +1,154 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node_limit_m2m import NodeLimitM2M
from ...types import Response
def _get_kwargs(
id: int,
) -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": f"/api/v2/modules_registrations/options/limits_m2m/{id}/",
}
return _kwargs
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[NodeLimitM2M]:
if response.status_code == 200:
response_200 = NodeLimitM2M.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[NodeLimitM2M]:
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[NodeLimitM2M]:
"""This view manages node configuration/limits relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
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[NodeLimitM2M]
"""
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[NodeLimitM2M]:
"""This view manages node configuration/limits relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
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:
NodeLimitM2M
"""
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
) -> Response[NodeLimitM2M]:
"""This view manages node configuration/limits relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
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[NodeLimitM2M]
"""
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[NodeLimitM2M]:
"""This view manages node configuration/limits relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
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:
NodeLimitM2M
"""
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed
@@ -0,0 +1,213 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node_limit import NodeLimit
from ...models.patched_node_limit import PatchedNodeLimit
from ...types import Response
def _get_kwargs(
id: int,
*,
body: Union[
PatchedNodeLimit,
PatchedNodeLimit,
PatchedNodeLimit,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "patch",
"url": f"/api/v2/modules_registrations/options/limits/{id}/",
}
if isinstance(body, PatchedNodeLimit):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, PatchedNodeLimit):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, PatchedNodeLimit):
_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[NodeLimit]:
if response.status_code == 200:
response_200 = NodeLimit.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[NodeLimit]:
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[
PatchedNodeLimit,
PatchedNodeLimit,
PatchedNodeLimit,
],
) -> Response[NodeLimit]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeLimit): Serializer (read/write) for `NodeLimit` model
body (PatchedNodeLimit): Serializer (read/write) for `NodeLimit` model
body (PatchedNodeLimit): Serializer (read/write) for `NodeLimit` model
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[NodeLimit]
"""
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[
PatchedNodeLimit,
PatchedNodeLimit,
PatchedNodeLimit,
],
) -> Optional[NodeLimit]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeLimit): Serializer (read/write) for `NodeLimit` model
body (PatchedNodeLimit): Serializer (read/write) for `NodeLimit` model
body (PatchedNodeLimit): Serializer (read/write) for `NodeLimit` model
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:
NodeLimit
"""
return sync_detailed(
id=id,
client=client,
body=body,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
body: Union[
PatchedNodeLimit,
PatchedNodeLimit,
PatchedNodeLimit,
],
) -> Response[NodeLimit]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeLimit): Serializer (read/write) for `NodeLimit` model
body (PatchedNodeLimit): Serializer (read/write) for `NodeLimit` model
body (PatchedNodeLimit): Serializer (read/write) for `NodeLimit` model
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[NodeLimit]
"""
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[
PatchedNodeLimit,
PatchedNodeLimit,
PatchedNodeLimit,
],
) -> Optional[NodeLimit]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeLimit): Serializer (read/write) for `NodeLimit` model
body (PatchedNodeLimit): Serializer (read/write) for `NodeLimit` model
body (PatchedNodeLimit): Serializer (read/write) for `NodeLimit` model
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:
NodeLimit
"""
return (
await asyncio_detailed(
id=id,
client=client,
body=body,
)
).parsed
@@ -0,0 +1,154 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node_limit import NodeLimit
from ...types import Response
def _get_kwargs(
id: int,
) -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": f"/api/v2/modules_registrations/options/limits/{id}/",
}
return _kwargs
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[NodeLimit]:
if response.status_code == 200:
response_200 = NodeLimit.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[NodeLimit]:
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[NodeLimit]:
"""This view manages limits
It filters limits linked to configurations, via `NodeLimitM2M` through table, which users have
access to.
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[NodeLimit]
"""
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[NodeLimit]:
"""This view manages limits
It filters limits linked to configurations, via `NodeLimitM2M` through table, which users have
access to.
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:
NodeLimit
"""
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
) -> Response[NodeLimit]:
"""This view manages limits
It filters limits linked to configurations, via `NodeLimitM2M` through table, which users have
access to.
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[NodeLimit]
"""
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[NodeLimit]:
"""This view manages limits
It filters limits linked to configurations, via `NodeLimitM2M` through table, which users have
access to.
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:
NodeLimit
"""
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed
@@ -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_registration_options_active_module import ModuleRegistrationOptionsActiveModule
from ...types import Response
def _get_kwargs(
*,
body: Union[
ModuleRegistrationOptionsActiveModule,
ModuleRegistrationOptionsActiveModule,
ModuleRegistrationOptionsActiveModule,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": "/api/v2/modules_registrations/options/modules/",
}
if isinstance(body, ModuleRegistrationOptionsActiveModule):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, ModuleRegistrationOptionsActiveModule):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, ModuleRegistrationOptionsActiveModule):
_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[ModuleRegistrationOptionsActiveModule]:
if response.status_code == 201:
response_201 = ModuleRegistrationOptionsActiveModule.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[ModuleRegistrationOptionsActiveModule]:
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[
ModuleRegistrationOptionsActiveModule,
ModuleRegistrationOptionsActiveModule,
ModuleRegistrationOptionsActiveModule,
],
) -> Response[ModuleRegistrationOptionsActiveModule]:
"""ViewSet of model `ActiveModule` linked to `ModuleRegistrationOptions`.
Args:
body (ModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked to
`ModuleRegistrationOptions`
body (ModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked to
`ModuleRegistrationOptions`
body (ModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked to
`ModuleRegistrationOptions`
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[ModuleRegistrationOptionsActiveModule]
"""
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[
ModuleRegistrationOptionsActiveModule,
ModuleRegistrationOptionsActiveModule,
ModuleRegistrationOptionsActiveModule,
],
) -> Optional[ModuleRegistrationOptionsActiveModule]:
"""ViewSet of model `ActiveModule` linked to `ModuleRegistrationOptions`.
Args:
body (ModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked to
`ModuleRegistrationOptions`
body (ModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked to
`ModuleRegistrationOptions`
body (ModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked to
`ModuleRegistrationOptions`
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:
ModuleRegistrationOptionsActiveModule
"""
return sync_detailed(
client=client,
body=body,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
body: Union[
ModuleRegistrationOptionsActiveModule,
ModuleRegistrationOptionsActiveModule,
ModuleRegistrationOptionsActiveModule,
],
) -> Response[ModuleRegistrationOptionsActiveModule]:
"""ViewSet of model `ActiveModule` linked to `ModuleRegistrationOptions`.
Args:
body (ModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked to
`ModuleRegistrationOptions`
body (ModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked to
`ModuleRegistrationOptions`
body (ModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked to
`ModuleRegistrationOptions`
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[ModuleRegistrationOptionsActiveModule]
"""
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[
ModuleRegistrationOptionsActiveModule,
ModuleRegistrationOptionsActiveModule,
ModuleRegistrationOptionsActiveModule,
],
) -> Optional[ModuleRegistrationOptionsActiveModule]:
"""ViewSet of model `ActiveModule` linked to `ModuleRegistrationOptions`.
Args:
body (ModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked to
`ModuleRegistrationOptions`
body (ModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked to
`ModuleRegistrationOptions`
body (ModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked to
`ModuleRegistrationOptions`
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:
ModuleRegistrationOptionsActiveModule
"""
return (
await asyncio_detailed(
client=client,
body=body,
)
).parsed
@@ -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_registration_options_active_module_list import (
PaginatedModuleRegistrationOptionsActiveModuleList,
)
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_registrations/options/modules/",
"params": params,
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[PaginatedModuleRegistrationOptionsActiveModuleList]:
if response.status_code == 200:
response_200 = PaginatedModuleRegistrationOptionsActiveModuleList.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[PaginatedModuleRegistrationOptionsActiveModuleList]:
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[PaginatedModuleRegistrationOptionsActiveModuleList]:
"""ViewSet of model `ActiveModule` linked to `ModuleRegistrationOptions`.
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[PaginatedModuleRegistrationOptionsActiveModuleList]
"""
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[PaginatedModuleRegistrationOptionsActiveModuleList]:
"""ViewSet of model `ActiveModule` linked to `ModuleRegistrationOptions`.
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:
PaginatedModuleRegistrationOptionsActiveModuleList
"""
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[PaginatedModuleRegistrationOptionsActiveModuleList]:
"""ViewSet of model `ActiveModule` linked to `ModuleRegistrationOptions`.
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[PaginatedModuleRegistrationOptionsActiveModuleList]
"""
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[PaginatedModuleRegistrationOptionsActiveModuleList]:
"""ViewSet of model `ActiveModule` linked to `ModuleRegistrationOptions`.
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:
PaginatedModuleRegistrationOptionsActiveModuleList
"""
return (
await asyncio_detailed(
client=client,
event=event,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
)
).parsed
@@ -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_registration_options_active_module import ModuleRegistrationOptionsActiveModule
from ...models.patched_module_registration_options_active_module import PatchedModuleRegistrationOptionsActiveModule
from ...types import Response
def _get_kwargs(
id: int,
*,
body: Union[
PatchedModuleRegistrationOptionsActiveModule,
PatchedModuleRegistrationOptionsActiveModule,
PatchedModuleRegistrationOptionsActiveModule,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "patch",
"url": f"/api/v2/modules_registrations/options/modules/{id}/",
}
if isinstance(body, PatchedModuleRegistrationOptionsActiveModule):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, PatchedModuleRegistrationOptionsActiveModule):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, PatchedModuleRegistrationOptionsActiveModule):
_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[ModuleRegistrationOptionsActiveModule]:
if response.status_code == 200:
response_200 = ModuleRegistrationOptionsActiveModule.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[ModuleRegistrationOptionsActiveModule]:
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[
PatchedModuleRegistrationOptionsActiveModule,
PatchedModuleRegistrationOptionsActiveModule,
PatchedModuleRegistrationOptionsActiveModule,
],
) -> Response[ModuleRegistrationOptionsActiveModule]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked
to `ModuleRegistrationOptions`
body (PatchedModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked
to `ModuleRegistrationOptions`
body (PatchedModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked
to `ModuleRegistrationOptions`
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[ModuleRegistrationOptionsActiveModule]
"""
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[
PatchedModuleRegistrationOptionsActiveModule,
PatchedModuleRegistrationOptionsActiveModule,
PatchedModuleRegistrationOptionsActiveModule,
],
) -> Optional[ModuleRegistrationOptionsActiveModule]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked
to `ModuleRegistrationOptions`
body (PatchedModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked
to `ModuleRegistrationOptions`
body (PatchedModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked
to `ModuleRegistrationOptions`
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:
ModuleRegistrationOptionsActiveModule
"""
return sync_detailed(
id=id,
client=client,
body=body,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
body: Union[
PatchedModuleRegistrationOptionsActiveModule,
PatchedModuleRegistrationOptionsActiveModule,
PatchedModuleRegistrationOptionsActiveModule,
],
) -> Response[ModuleRegistrationOptionsActiveModule]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked
to `ModuleRegistrationOptions`
body (PatchedModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked
to `ModuleRegistrationOptions`
body (PatchedModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked
to `ModuleRegistrationOptions`
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[ModuleRegistrationOptionsActiveModule]
"""
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[
PatchedModuleRegistrationOptionsActiveModule,
PatchedModuleRegistrationOptionsActiveModule,
PatchedModuleRegistrationOptionsActiveModule,
],
) -> Optional[ModuleRegistrationOptionsActiveModule]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked
to `ModuleRegistrationOptions`
body (PatchedModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked
to `ModuleRegistrationOptions`
body (PatchedModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked
to `ModuleRegistrationOptions`
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:
ModuleRegistrationOptionsActiveModule
"""
return (
await asyncio_detailed(
id=id,
client=client,
body=body,
)
).parsed
@@ -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_registration_options_active_module import ModuleRegistrationOptionsActiveModule
from ...types import Response
def _get_kwargs(
id: int,
) -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": f"/api/v2/modules_registrations/options/modules/{id}/",
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[ModuleRegistrationOptionsActiveModule]:
if response.status_code == 200:
response_200 = ModuleRegistrationOptionsActiveModule.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[ModuleRegistrationOptionsActiveModule]:
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[ModuleRegistrationOptionsActiveModule]:
"""ViewSet of model `ActiveModule` linked to `ModuleRegistrationOptions`.
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[ModuleRegistrationOptionsActiveModule]
"""
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[ModuleRegistrationOptionsActiveModule]:
"""ViewSet of model `ActiveModule` linked to `ModuleRegistrationOptions`.
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:
ModuleRegistrationOptionsActiveModule
"""
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
) -> Response[ModuleRegistrationOptionsActiveModule]:
"""ViewSet of model `ActiveModule` linked to `ModuleRegistrationOptions`.
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[ModuleRegistrationOptionsActiveModule]
"""
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[ModuleRegistrationOptionsActiveModule]:
"""ViewSet of model `ActiveModule` linked to `ModuleRegistrationOptions`.
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:
ModuleRegistrationOptionsActiveModule
"""
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed
@@ -0,0 +1,191 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node_cart_configuration import NodeCartConfiguration
from ...types import Response
def _get_kwargs(
*,
body: Union[
NodeCartConfiguration,
NodeCartConfiguration,
NodeCartConfiguration,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": "/api/v2/modules_registrations/options/node_cart_configurations/",
}
if isinstance(body, NodeCartConfiguration):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, NodeCartConfiguration):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, NodeCartConfiguration):
_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[NodeCartConfiguration]:
if response.status_code == 201:
response_201 = NodeCartConfiguration.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[NodeCartConfiguration]:
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[
NodeCartConfiguration,
NodeCartConfiguration,
NodeCartConfiguration,
],
) -> Response[NodeCartConfiguration]:
"""
Args:
body (NodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration model
body (NodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration model
body (NodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration model
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[NodeCartConfiguration]
"""
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[
NodeCartConfiguration,
NodeCartConfiguration,
NodeCartConfiguration,
],
) -> Optional[NodeCartConfiguration]:
"""
Args:
body (NodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration model
body (NodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration model
body (NodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration model
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:
NodeCartConfiguration
"""
return sync_detailed(
client=client,
body=body,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
body: Union[
NodeCartConfiguration,
NodeCartConfiguration,
NodeCartConfiguration,
],
) -> Response[NodeCartConfiguration]:
"""
Args:
body (NodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration model
body (NodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration model
body (NodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration model
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[NodeCartConfiguration]
"""
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[
NodeCartConfiguration,
NodeCartConfiguration,
NodeCartConfiguration,
],
) -> Optional[NodeCartConfiguration]:
"""
Args:
body (NodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration model
body (NodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration model
body (NodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration model
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:
NodeCartConfiguration
"""
return (
await asyncio_detailed(
client=client,
body=body,
)
).parsed
@@ -0,0 +1,91 @@
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_registrations/options/node_cart_configurations/{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]:
"""
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]:
"""
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)
@@ -0,0 +1,214 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.paginated_node_cart_configuration_list import PaginatedNodeCartConfigurationList
from ...types import UNSET, Response, Unset
def _get_kwargs(
*,
event_id: Union[Unset, float] = 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_id"] = event_id
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_registrations/options/node_cart_configurations/",
"params": params,
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[PaginatedNodeCartConfigurationList]:
if response.status_code == 200:
response_200 = PaginatedNodeCartConfigurationList.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[PaginatedNodeCartConfigurationList]:
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedNodeCartConfigurationList]:
"""
Args:
event_id (Union[Unset, float]):
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[PaginatedNodeCartConfigurationList]
"""
kwargs = _get_kwargs(
event_id=event_id,
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedNodeCartConfigurationList]:
"""
Args:
event_id (Union[Unset, float]):
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:
PaginatedNodeCartConfigurationList
"""
return sync_detailed(
client=client,
event_id=event_id,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
event_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedNodeCartConfigurationList]:
"""
Args:
event_id (Union[Unset, float]):
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[PaginatedNodeCartConfigurationList]
"""
kwargs = _get_kwargs(
event_id=event_id,
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedNodeCartConfigurationList]:
"""
Args:
event_id (Union[Unset, float]):
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:
PaginatedNodeCartConfigurationList
"""
return (
await asyncio_detailed(
client=client,
event_id=event_id,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
)
).parsed
@@ -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.node_cart_configuration import NodeCartConfiguration
from ...models.patched_node_cart_configuration import PatchedNodeCartConfiguration
from ...types import Response
def _get_kwargs(
id: int,
*,
body: Union[
PatchedNodeCartConfiguration,
PatchedNodeCartConfiguration,
PatchedNodeCartConfiguration,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "patch",
"url": f"/api/v2/modules_registrations/options/node_cart_configurations/{id}/",
}
if isinstance(body, PatchedNodeCartConfiguration):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, PatchedNodeCartConfiguration):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, PatchedNodeCartConfiguration):
_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[NodeCartConfiguration]:
if response.status_code == 200:
response_200 = NodeCartConfiguration.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[NodeCartConfiguration]:
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[
PatchedNodeCartConfiguration,
PatchedNodeCartConfiguration,
PatchedNodeCartConfiguration,
],
) -> Response[NodeCartConfiguration]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration
model
body (PatchedNodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration
model
body (PatchedNodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration
model
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[NodeCartConfiguration]
"""
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[
PatchedNodeCartConfiguration,
PatchedNodeCartConfiguration,
PatchedNodeCartConfiguration,
],
) -> Optional[NodeCartConfiguration]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration
model
body (PatchedNodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration
model
body (PatchedNodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration
model
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:
NodeCartConfiguration
"""
return sync_detailed(
id=id,
client=client,
body=body,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
body: Union[
PatchedNodeCartConfiguration,
PatchedNodeCartConfiguration,
PatchedNodeCartConfiguration,
],
) -> Response[NodeCartConfiguration]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration
model
body (PatchedNodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration
model
body (PatchedNodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration
model
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[NodeCartConfiguration]
"""
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[
PatchedNodeCartConfiguration,
PatchedNodeCartConfiguration,
PatchedNodeCartConfiguration,
],
) -> Optional[NodeCartConfiguration]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration
model
body (PatchedNodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration
model
body (PatchedNodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration
model
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:
NodeCartConfiguration
"""
return (
await asyncio_detailed(
id=id,
client=client,
body=body,
)
).parsed
@@ -0,0 +1,146 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node_cart_configuration import NodeCartConfiguration
from ...types import Response
def _get_kwargs(
id: int,
) -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": f"/api/v2/modules_registrations/options/node_cart_configurations/{id}/",
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[NodeCartConfiguration]:
if response.status_code == 200:
response_200 = NodeCartConfiguration.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[NodeCartConfiguration]:
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[NodeCartConfiguration]:
"""
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[NodeCartConfiguration]
"""
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[NodeCartConfiguration]:
"""
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:
NodeCartConfiguration
"""
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
) -> Response[NodeCartConfiguration]:
"""
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[NodeCartConfiguration]
"""
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[NodeCartConfiguration]:
"""
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:
NodeCartConfiguration
"""
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed
@@ -0,0 +1,191 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node_configuration import NodeConfiguration
from ...types import Response
def _get_kwargs(
*,
body: Union[
NodeConfiguration,
NodeConfiguration,
NodeConfiguration,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": "/api/v2/modules_registrations/options/node_configurations/",
}
if isinstance(body, NodeConfiguration):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, NodeConfiguration):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, NodeConfiguration):
_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[NodeConfiguration]:
if response.status_code == 201:
response_201 = NodeConfiguration.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[NodeConfiguration]:
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[
NodeConfiguration,
NodeConfiguration,
NodeConfiguration,
],
) -> Response[NodeConfiguration]:
"""
Args:
body (NodeConfiguration): Serializer (read/write) for NodeConfiguration model
body (NodeConfiguration): Serializer (read/write) for NodeConfiguration model
body (NodeConfiguration): Serializer (read/write) for NodeConfiguration model
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[NodeConfiguration]
"""
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[
NodeConfiguration,
NodeConfiguration,
NodeConfiguration,
],
) -> Optional[NodeConfiguration]:
"""
Args:
body (NodeConfiguration): Serializer (read/write) for NodeConfiguration model
body (NodeConfiguration): Serializer (read/write) for NodeConfiguration model
body (NodeConfiguration): Serializer (read/write) for NodeConfiguration model
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:
NodeConfiguration
"""
return sync_detailed(
client=client,
body=body,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
body: Union[
NodeConfiguration,
NodeConfiguration,
NodeConfiguration,
],
) -> Response[NodeConfiguration]:
"""
Args:
body (NodeConfiguration): Serializer (read/write) for NodeConfiguration model
body (NodeConfiguration): Serializer (read/write) for NodeConfiguration model
body (NodeConfiguration): Serializer (read/write) for NodeConfiguration model
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[NodeConfiguration]
"""
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[
NodeConfiguration,
NodeConfiguration,
NodeConfiguration,
],
) -> Optional[NodeConfiguration]:
"""
Args:
body (NodeConfiguration): Serializer (read/write) for NodeConfiguration model
body (NodeConfiguration): Serializer (read/write) for NodeConfiguration model
body (NodeConfiguration): Serializer (read/write) for NodeConfiguration model
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:
NodeConfiguration
"""
return (
await asyncio_detailed(
client=client,
body=body,
)
).parsed
@@ -0,0 +1,91 @@
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_registrations/options/node_configurations/{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]:
"""
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]:
"""
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)
@@ -0,0 +1,214 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.paginated_node_configuration_list import PaginatedNodeConfigurationList
from ...types import UNSET, Response, Unset
def _get_kwargs(
*,
event_id: Union[Unset, float] = 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_id"] = event_id
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_registrations/options/node_configurations/",
"params": params,
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[PaginatedNodeConfigurationList]:
if response.status_code == 200:
response_200 = PaginatedNodeConfigurationList.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[PaginatedNodeConfigurationList]:
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedNodeConfigurationList]:
"""
Args:
event_id (Union[Unset, float]):
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[PaginatedNodeConfigurationList]
"""
kwargs = _get_kwargs(
event_id=event_id,
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedNodeConfigurationList]:
"""
Args:
event_id (Union[Unset, float]):
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:
PaginatedNodeConfigurationList
"""
return sync_detailed(
client=client,
event_id=event_id,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
event_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedNodeConfigurationList]:
"""
Args:
event_id (Union[Unset, float]):
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[PaginatedNodeConfigurationList]
"""
kwargs = _get_kwargs(
event_id=event_id,
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedNodeConfigurationList]:
"""
Args:
event_id (Union[Unset, float]):
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:
PaginatedNodeConfigurationList
"""
return (
await asyncio_detailed(
client=client,
event_id=event_id,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
)
).parsed
@@ -0,0 +1,217 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node_configuration import NodeConfiguration
from ...models.patched_node_configuration import PatchedNodeConfiguration
from ...types import Response
def _get_kwargs(
id: int,
*,
body: Union[
PatchedNodeConfiguration,
PatchedNodeConfiguration,
PatchedNodeConfiguration,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "patch",
"url": f"/api/v2/modules_registrations/options/node_configurations/{id}/",
}
if isinstance(body, PatchedNodeConfiguration):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, PatchedNodeConfiguration):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, PatchedNodeConfiguration):
_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[NodeConfiguration]:
if response.status_code == 200:
response_200 = NodeConfiguration.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[NodeConfiguration]:
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[
PatchedNodeConfiguration,
PatchedNodeConfiguration,
PatchedNodeConfiguration,
],
) -> Response[NodeConfiguration]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeConfiguration): Serializer (read/write) for NodeConfiguration model
body (PatchedNodeConfiguration): Serializer (read/write) for NodeConfiguration model
body (PatchedNodeConfiguration): Serializer (read/write) for NodeConfiguration model
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[NodeConfiguration]
"""
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[
PatchedNodeConfiguration,
PatchedNodeConfiguration,
PatchedNodeConfiguration,
],
) -> Optional[NodeConfiguration]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeConfiguration): Serializer (read/write) for NodeConfiguration model
body (PatchedNodeConfiguration): Serializer (read/write) for NodeConfiguration model
body (PatchedNodeConfiguration): Serializer (read/write) for NodeConfiguration model
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:
NodeConfiguration
"""
return sync_detailed(
id=id,
client=client,
body=body,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
body: Union[
PatchedNodeConfiguration,
PatchedNodeConfiguration,
PatchedNodeConfiguration,
],
) -> Response[NodeConfiguration]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeConfiguration): Serializer (read/write) for NodeConfiguration model
body (PatchedNodeConfiguration): Serializer (read/write) for NodeConfiguration model
body (PatchedNodeConfiguration): Serializer (read/write) for NodeConfiguration model
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[NodeConfiguration]
"""
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[
PatchedNodeConfiguration,
PatchedNodeConfiguration,
PatchedNodeConfiguration,
],
) -> Optional[NodeConfiguration]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeConfiguration): Serializer (read/write) for NodeConfiguration model
body (PatchedNodeConfiguration): Serializer (read/write) for NodeConfiguration model
body (PatchedNodeConfiguration): Serializer (read/write) for NodeConfiguration model
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:
NodeConfiguration
"""
return (
await asyncio_detailed(
id=id,
client=client,
body=body,
)
).parsed
@@ -0,0 +1,146 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node_configuration import NodeConfiguration
from ...types import Response
def _get_kwargs(
id: int,
) -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": f"/api/v2/modules_registrations/options/node_configurations/{id}/",
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[NodeConfiguration]:
if response.status_code == 200:
response_200 = NodeConfiguration.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[NodeConfiguration]:
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[NodeConfiguration]:
"""
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[NodeConfiguration]
"""
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[NodeConfiguration]:
"""
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:
NodeConfiguration
"""
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
) -> Response[NodeConfiguration]:
"""
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[NodeConfiguration]
"""
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[NodeConfiguration]:
"""
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:
NodeConfiguration
"""
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed
@@ -0,0 +1,200 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node import Node
from ...types import Response
def _get_kwargs(
id: int,
*,
body: Union[
Node,
Node,
Node,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": f"/api/v2/modules_registrations/options/nodes/{id}/actions/delete_cart_configurations/",
}
if isinstance(body, Node):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, Node):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, Node):
_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[Node]:
if response.status_code == 200:
response_200 = Node.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[Node]:
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[
Node,
Node,
Node,
],
) -> Response[Node]:
"""
Args:
id (int):
body (Node): Serializer for Node model
body (Node): Serializer for Node model
body (Node): Serializer for Node model
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[Node]
"""
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[
Node,
Node,
Node,
],
) -> Optional[Node]:
"""
Args:
id (int):
body (Node): Serializer for Node model
body (Node): Serializer for Node model
body (Node): Serializer for Node model
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:
Node
"""
return sync_detailed(
id=id,
client=client,
body=body,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
body: Union[
Node,
Node,
Node,
],
) -> Response[Node]:
"""
Args:
id (int):
body (Node): Serializer for Node model
body (Node): Serializer for Node model
body (Node): Serializer for Node model
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[Node]
"""
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[
Node,
Node,
Node,
],
) -> Optional[Node]:
"""
Args:
id (int):
body (Node): Serializer for Node model
body (Node): Serializer for Node model
body (Node): Serializer for Node model
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:
Node
"""
return (
await asyncio_detailed(
id=id,
client=client,
body=body,
)
).parsed
@@ -0,0 +1,200 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node import Node
from ...types import Response
def _get_kwargs(
id: int,
*,
body: Union[
Node,
Node,
Node,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": f"/api/v2/modules_registrations/options/nodes/{id}/actions/ensure_cart_configurations/",
}
if isinstance(body, Node):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, Node):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, Node):
_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[Node]:
if response.status_code == 200:
response_200 = Node.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[Node]:
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[
Node,
Node,
Node,
],
) -> Response[Node]:
"""
Args:
id (int):
body (Node): Serializer for Node model
body (Node): Serializer for Node model
body (Node): Serializer for Node model
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[Node]
"""
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[
Node,
Node,
Node,
],
) -> Optional[Node]:
"""
Args:
id (int):
body (Node): Serializer for Node model
body (Node): Serializer for Node model
body (Node): Serializer for Node model
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:
Node
"""
return sync_detailed(
id=id,
client=client,
body=body,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
body: Union[
Node,
Node,
Node,
],
) -> Response[Node]:
"""
Args:
id (int):
body (Node): Serializer for Node model
body (Node): Serializer for Node model
body (Node): Serializer for Node model
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[Node]
"""
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[
Node,
Node,
Node,
],
) -> Optional[Node]:
"""
Args:
id (int):
body (Node): Serializer for Node model
body (Node): Serializer for Node model
body (Node): Serializer for Node model
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:
Node
"""
return (
await asyncio_detailed(
id=id,
client=client,
body=body,
)
).parsed
@@ -0,0 +1,187 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node import Node
from ...types import Response
def _get_kwargs(
*,
body: Union[
Node,
Node,
Node,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": "/api/v2/modules_registrations/options/nodes/",
}
if isinstance(body, Node):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, Node):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, Node):
_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[Node]:
if response.status_code == 201:
response_201 = Node.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[Node]:
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[
Node,
Node,
Node,
],
) -> Response[Node]:
"""
Args:
body (Node): Serializer for Node model
body (Node): Serializer for Node model
body (Node): Serializer for Node model
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[Node]
"""
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[
Node,
Node,
Node,
],
) -> Optional[Node]:
"""
Args:
body (Node): Serializer for Node model
body (Node): Serializer for Node model
body (Node): Serializer for Node model
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:
Node
"""
return sync_detailed(
client=client,
body=body,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
body: Union[
Node,
Node,
Node,
],
) -> Response[Node]:
"""
Args:
body (Node): Serializer for Node model
body (Node): Serializer for Node model
body (Node): Serializer for Node model
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[Node]
"""
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[
Node,
Node,
Node,
],
) -> Optional[Node]:
"""
Args:
body (Node): Serializer for Node model
body (Node): Serializer for Node model
body (Node): Serializer for Node model
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:
Node
"""
return (
await asyncio_detailed(
client=client,
body=body,
)
).parsed
@@ -0,0 +1,91 @@
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_registrations/options/nodes/{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]:
"""
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]:
"""
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)
@@ -0,0 +1,214 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.paginated_node_list import PaginatedNodeList
from ...types import UNSET, Response, Unset
def _get_kwargs(
*,
event_id: Union[Unset, float] = 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_id"] = event_id
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_registrations/options/nodes/",
"params": params,
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[PaginatedNodeList]:
if response.status_code == 200:
response_200 = PaginatedNodeList.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[PaginatedNodeList]:
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedNodeList]:
"""
Args:
event_id (Union[Unset, float]):
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[PaginatedNodeList]
"""
kwargs = _get_kwargs(
event_id=event_id,
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedNodeList]:
"""
Args:
event_id (Union[Unset, float]):
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:
PaginatedNodeList
"""
return sync_detailed(
client=client,
event_id=event_id,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
event_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedNodeList]:
"""
Args:
event_id (Union[Unset, float]):
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[PaginatedNodeList]
"""
kwargs = _get_kwargs(
event_id=event_id,
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedNodeList]:
"""
Args:
event_id (Union[Unset, float]):
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:
PaginatedNodeList
"""
return (
await asyncio_detailed(
client=client,
event_id=event_id,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
)
).parsed
@@ -0,0 +1,213 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node import Node
from ...models.patched_node import PatchedNode
from ...types import Response
def _get_kwargs(
id: int,
*,
body: Union[
PatchedNode,
PatchedNode,
PatchedNode,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "patch",
"url": f"/api/v2/modules_registrations/options/nodes/{id}/",
}
if isinstance(body, PatchedNode):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, PatchedNode):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, PatchedNode):
_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[Node]:
if response.status_code == 200:
response_200 = Node.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[Node]:
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[
PatchedNode,
PatchedNode,
PatchedNode,
],
) -> Response[Node]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNode): Serializer for Node model
body (PatchedNode): Serializer for Node model
body (PatchedNode): Serializer for Node model
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[Node]
"""
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[
PatchedNode,
PatchedNode,
PatchedNode,
],
) -> Optional[Node]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNode): Serializer for Node model
body (PatchedNode): Serializer for Node model
body (PatchedNode): Serializer for Node model
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:
Node
"""
return sync_detailed(
id=id,
client=client,
body=body,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
body: Union[
PatchedNode,
PatchedNode,
PatchedNode,
],
) -> Response[Node]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNode): Serializer for Node model
body (PatchedNode): Serializer for Node model
body (PatchedNode): Serializer for Node model
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[Node]
"""
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[
PatchedNode,
PatchedNode,
PatchedNode,
],
) -> Optional[Node]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNode): Serializer for Node model
body (PatchedNode): Serializer for Node model
body (PatchedNode): Serializer for Node model
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:
Node
"""
return (
await asyncio_detailed(
id=id,
client=client,
body=body,
)
).parsed
@@ -0,0 +1,142 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node import Node
from ...types import Response
def _get_kwargs(
id: int,
) -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": f"/api/v2/modules_registrations/options/nodes/{id}/",
}
return _kwargs
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Node]:
if response.status_code == 200:
response_200 = Node.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[Node]:
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[Node]:
"""
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[Node]
"""
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[Node]:
"""
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:
Node
"""
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
) -> Response[Node]:
"""
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[Node]
"""
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[Node]:
"""
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:
Node
"""
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed
@@ -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.node_price_rule import NodePriceRule
from ...types import Response
def _get_kwargs(
*,
body: Union[
NodePriceRule,
NodePriceRule,
NodePriceRule,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": "/api/v2/modules_registrations/options/price_rules/",
}
if isinstance(body, NodePriceRule):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, NodePriceRule):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, NodePriceRule):
_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[NodePriceRule]:
if response.status_code == 201:
response_201 = NodePriceRule.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[NodePriceRule]:
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[
NodePriceRule,
NodePriceRule,
NodePriceRule,
],
) -> Response[NodePriceRule]:
"""This view manages price rules
It filters price rules linked to configurations, via `NodePriceRuleM2M` through table, which users
have access to.
Args:
body (NodePriceRule): Serializer (read/write) for `NodePriceRule` model
body (NodePriceRule): Serializer (read/write) for `NodePriceRule` model
body (NodePriceRule): Serializer (read/write) for `NodePriceRule` model
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[NodePriceRule]
"""
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[
NodePriceRule,
NodePriceRule,
NodePriceRule,
],
) -> Optional[NodePriceRule]:
"""This view manages price rules
It filters price rules linked to configurations, via `NodePriceRuleM2M` through table, which users
have access to.
Args:
body (NodePriceRule): Serializer (read/write) for `NodePriceRule` model
body (NodePriceRule): Serializer (read/write) for `NodePriceRule` model
body (NodePriceRule): Serializer (read/write) for `NodePriceRule` model
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:
NodePriceRule
"""
return sync_detailed(
client=client,
body=body,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
body: Union[
NodePriceRule,
NodePriceRule,
NodePriceRule,
],
) -> Response[NodePriceRule]:
"""This view manages price rules
It filters price rules linked to configurations, via `NodePriceRuleM2M` through table, which users
have access to.
Args:
body (NodePriceRule): Serializer (read/write) for `NodePriceRule` model
body (NodePriceRule): Serializer (read/write) for `NodePriceRule` model
body (NodePriceRule): Serializer (read/write) for `NodePriceRule` model
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[NodePriceRule]
"""
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[
NodePriceRule,
NodePriceRule,
NodePriceRule,
],
) -> Optional[NodePriceRule]:
"""This view manages price rules
It filters price rules linked to configurations, via `NodePriceRuleM2M` through table, which users
have access to.
Args:
body (NodePriceRule): Serializer (read/write) for `NodePriceRule` model
body (NodePriceRule): Serializer (read/write) for `NodePriceRule` model
body (NodePriceRule): Serializer (read/write) for `NodePriceRule` model
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:
NodePriceRule
"""
return (
await asyncio_detailed(
client=client,
body=body,
)
).parsed
@@ -0,0 +1,97 @@
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_registrations/options/price_rules/{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]:
"""This view manages price rules
It filters price rules linked to configurations, via `NodePriceRuleM2M` through table, which users
have access to.
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]:
"""This view manages price rules
It filters price rules linked to configurations, via `NodePriceRuleM2M` through table, which users
have access to.
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)
@@ -0,0 +1,245 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.paginated_node_price_rule_list import PaginatedNodePriceRuleList
from ...types import UNSET, Response, Unset
def _get_kwargs(
*,
event_id: Union[Unset, float] = UNSET,
node_configurations: Union[Unset, list[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_id"] = event_id
json_node_configurations: Union[Unset, list[int]] = UNSET
if not isinstance(node_configurations, Unset):
json_node_configurations = node_configurations
params["node_configurations"] = json_node_configurations
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_registrations/options/price_rules/",
"params": params,
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[PaginatedNodePriceRuleList]:
if response.status_code == 200:
response_200 = PaginatedNodePriceRuleList.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[PaginatedNodePriceRuleList]:
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_id: Union[Unset, float] = UNSET,
node_configurations: Union[Unset, list[int]] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedNodePriceRuleList]:
"""This view manages price rules
It filters price rules linked to configurations, via `NodePriceRuleM2M` through table, which users
have access to.
Args:
event_id (Union[Unset, float]):
node_configurations (Union[Unset, list[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[PaginatedNodePriceRuleList]
"""
kwargs = _get_kwargs(
event_id=event_id,
node_configurations=node_configurations,
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_id: Union[Unset, float] = UNSET,
node_configurations: Union[Unset, list[int]] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedNodePriceRuleList]:
"""This view manages price rules
It filters price rules linked to configurations, via `NodePriceRuleM2M` through table, which users
have access to.
Args:
event_id (Union[Unset, float]):
node_configurations (Union[Unset, list[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:
PaginatedNodePriceRuleList
"""
return sync_detailed(
client=client,
event_id=event_id,
node_configurations=node_configurations,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
event_id: Union[Unset, float] = UNSET,
node_configurations: Union[Unset, list[int]] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedNodePriceRuleList]:
"""This view manages price rules
It filters price rules linked to configurations, via `NodePriceRuleM2M` through table, which users
have access to.
Args:
event_id (Union[Unset, float]):
node_configurations (Union[Unset, list[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[PaginatedNodePriceRuleList]
"""
kwargs = _get_kwargs(
event_id=event_id,
node_configurations=node_configurations,
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_id: Union[Unset, float] = UNSET,
node_configurations: Union[Unset, list[int]] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedNodePriceRuleList]:
"""This view manages price rules
It filters price rules linked to configurations, via `NodePriceRuleM2M` through table, which users
have access to.
Args:
event_id (Union[Unset, float]):
node_configurations (Union[Unset, list[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:
PaginatedNodePriceRuleList
"""
return (
await asyncio_detailed(
client=client,
event_id=event_id,
node_configurations=node_configurations,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
)
).parsed
@@ -0,0 +1,203 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node_price_rule_m2m import NodePriceRuleM2M
from ...types import Response
def _get_kwargs(
*,
body: Union[
NodePriceRuleM2M,
NodePriceRuleM2M,
NodePriceRuleM2M,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": "/api/v2/modules_registrations/options/price_rules_m2m/",
}
if isinstance(body, NodePriceRuleM2M):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, NodePriceRuleM2M):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, NodePriceRuleM2M):
_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[NodePriceRuleM2M]:
if response.status_code == 201:
response_201 = NodePriceRuleM2M.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[NodePriceRuleM2M]:
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[
NodePriceRuleM2M,
NodePriceRuleM2M,
NodePriceRuleM2M,
],
) -> Response[NodePriceRuleM2M]:
"""This view manages node configuration/price rules relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
body (NodePriceRuleM2M): Serializer (read/write) for `NodePriceRuleM2M` relation model
body (NodePriceRuleM2M): Serializer (read/write) for `NodePriceRuleM2M` relation model
body (NodePriceRuleM2M): Serializer (read/write) for `NodePriceRuleM2M` relation model
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[NodePriceRuleM2M]
"""
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[
NodePriceRuleM2M,
NodePriceRuleM2M,
NodePriceRuleM2M,
],
) -> Optional[NodePriceRuleM2M]:
"""This view manages node configuration/price rules relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
body (NodePriceRuleM2M): Serializer (read/write) for `NodePriceRuleM2M` relation model
body (NodePriceRuleM2M): Serializer (read/write) for `NodePriceRuleM2M` relation model
body (NodePriceRuleM2M): Serializer (read/write) for `NodePriceRuleM2M` relation model
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:
NodePriceRuleM2M
"""
return sync_detailed(
client=client,
body=body,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
body: Union[
NodePriceRuleM2M,
NodePriceRuleM2M,
NodePriceRuleM2M,
],
) -> Response[NodePriceRuleM2M]:
"""This view manages node configuration/price rules relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
body (NodePriceRuleM2M): Serializer (read/write) for `NodePriceRuleM2M` relation model
body (NodePriceRuleM2M): Serializer (read/write) for `NodePriceRuleM2M` relation model
body (NodePriceRuleM2M): Serializer (read/write) for `NodePriceRuleM2M` relation model
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[NodePriceRuleM2M]
"""
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[
NodePriceRuleM2M,
NodePriceRuleM2M,
NodePriceRuleM2M,
],
) -> Optional[NodePriceRuleM2M]:
"""This view manages node configuration/price rules relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
body (NodePriceRuleM2M): Serializer (read/write) for `NodePriceRuleM2M` relation model
body (NodePriceRuleM2M): Serializer (read/write) for `NodePriceRuleM2M` relation model
body (NodePriceRuleM2M): Serializer (read/write) for `NodePriceRuleM2M` relation model
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:
NodePriceRuleM2M
"""
return (
await asyncio_detailed(
client=client,
body=body,
)
).parsed
@@ -0,0 +1,97 @@
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_registrations/options/price_rules_m2m/{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]:
"""This view manages node configuration/price rules relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
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]:
"""This view manages node configuration/price rules relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
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)
@@ -0,0 +1,256 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.paginated_node_price_rule_m2m_list import PaginatedNodePriceRuleM2MList
from ...types import UNSET, Response, Unset
def _get_kwargs(
*,
event_id: Union[Unset, float] = UNSET,
node_configuration: Union[Unset, int] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
price_rule: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> dict[str, Any]:
params: dict[str, Any] = {}
params["event_id"] = event_id
params["node_configuration"] = node_configuration
params["o"] = o
params["offset"] = offset
params["page_limit"] = page_limit
params["price_rule"] = price_rule
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_registrations/options/price_rules_m2m/",
"params": params,
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[PaginatedNodePriceRuleM2MList]:
if response.status_code == 200:
response_200 = PaginatedNodePriceRuleM2MList.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[PaginatedNodePriceRuleM2MList]:
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_id: Union[Unset, float] = UNSET,
node_configuration: Union[Unset, int] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
price_rule: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedNodePriceRuleM2MList]:
"""This view manages node configuration/price rules relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
event_id (Union[Unset, float]):
node_configuration (Union[Unset, int]):
o (Union[Unset, str]):
offset (Union[Unset, int]):
page_limit (Union[Unset, int]):
price_rule (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[PaginatedNodePriceRuleM2MList]
"""
kwargs = _get_kwargs(
event_id=event_id,
node_configuration=node_configuration,
o=o,
offset=offset,
page_limit=page_limit,
price_rule=price_rule,
q=q,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
*,
client: AuthenticatedClient,
event_id: Union[Unset, float] = UNSET,
node_configuration: Union[Unset, int] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
price_rule: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedNodePriceRuleM2MList]:
"""This view manages node configuration/price rules relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
event_id (Union[Unset, float]):
node_configuration (Union[Unset, int]):
o (Union[Unset, str]):
offset (Union[Unset, int]):
page_limit (Union[Unset, int]):
price_rule (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:
PaginatedNodePriceRuleM2MList
"""
return sync_detailed(
client=client,
event_id=event_id,
node_configuration=node_configuration,
o=o,
offset=offset,
page_limit=page_limit,
price_rule=price_rule,
q=q,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
event_id: Union[Unset, float] = UNSET,
node_configuration: Union[Unset, int] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
price_rule: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedNodePriceRuleM2MList]:
"""This view manages node configuration/price rules relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
event_id (Union[Unset, float]):
node_configuration (Union[Unset, int]):
o (Union[Unset, str]):
offset (Union[Unset, int]):
page_limit (Union[Unset, int]):
price_rule (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[PaginatedNodePriceRuleM2MList]
"""
kwargs = _get_kwargs(
event_id=event_id,
node_configuration=node_configuration,
o=o,
offset=offset,
page_limit=page_limit,
price_rule=price_rule,
q=q,
)
response = await client.get_async_httpx_client().request(**kwargs)
return _build_response(client=client, response=response)
async def asyncio(
*,
client: AuthenticatedClient,
event_id: Union[Unset, float] = UNSET,
node_configuration: Union[Unset, int] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
price_rule: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedNodePriceRuleM2MList]:
"""This view manages node configuration/price rules relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
Args:
event_id (Union[Unset, float]):
node_configuration (Union[Unset, int]):
o (Union[Unset, str]):
offset (Union[Unset, int]):
page_limit (Union[Unset, int]):
price_rule (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:
PaginatedNodePriceRuleM2MList
"""
return (
await asyncio_detailed(
client=client,
event_id=event_id,
node_configuration=node_configuration,
o=o,
offset=offset,
page_limit=page_limit,
price_rule=price_rule,
q=q,
)
).parsed
@@ -0,0 +1,158 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node_price_rule_m2m import NodePriceRuleM2M
from ...types import Response
def _get_kwargs(
id: int,
) -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": f"/api/v2/modules_registrations/options/price_rules_m2m/{id}/",
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[NodePriceRuleM2M]:
if response.status_code == 200:
response_200 = NodePriceRuleM2M.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[NodePriceRuleM2M]:
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[NodePriceRuleM2M]:
"""This view manages node configuration/price rules relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
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[NodePriceRuleM2M]
"""
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[NodePriceRuleM2M]:
"""This view manages node configuration/price rules relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
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:
NodePriceRuleM2M
"""
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
) -> Response[NodePriceRuleM2M]:
"""This view manages node configuration/price rules relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
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[NodePriceRuleM2M]
"""
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[NodePriceRuleM2M]:
"""This view manages node configuration/price rules relation
PUT and PATCH methods are not supported.
It filters relation linked to configurations which users have access to.
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:
NodePriceRuleM2M
"""
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed
@@ -0,0 +1,213 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node_price_rule import NodePriceRule
from ...models.patched_node_price_rule import PatchedNodePriceRule
from ...types import Response
def _get_kwargs(
id: int,
*,
body: Union[
PatchedNodePriceRule,
PatchedNodePriceRule,
PatchedNodePriceRule,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "patch",
"url": f"/api/v2/modules_registrations/options/price_rules/{id}/",
}
if isinstance(body, PatchedNodePriceRule):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, PatchedNodePriceRule):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, PatchedNodePriceRule):
_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[NodePriceRule]:
if response.status_code == 200:
response_200 = NodePriceRule.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[NodePriceRule]:
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[
PatchedNodePriceRule,
PatchedNodePriceRule,
PatchedNodePriceRule,
],
) -> Response[NodePriceRule]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodePriceRule): Serializer (read/write) for `NodePriceRule` model
body (PatchedNodePriceRule): Serializer (read/write) for `NodePriceRule` model
body (PatchedNodePriceRule): Serializer (read/write) for `NodePriceRule` model
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[NodePriceRule]
"""
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[
PatchedNodePriceRule,
PatchedNodePriceRule,
PatchedNodePriceRule,
],
) -> Optional[NodePriceRule]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodePriceRule): Serializer (read/write) for `NodePriceRule` model
body (PatchedNodePriceRule): Serializer (read/write) for `NodePriceRule` model
body (PatchedNodePriceRule): Serializer (read/write) for `NodePriceRule` model
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:
NodePriceRule
"""
return sync_detailed(
id=id,
client=client,
body=body,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
body: Union[
PatchedNodePriceRule,
PatchedNodePriceRule,
PatchedNodePriceRule,
],
) -> Response[NodePriceRule]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodePriceRule): Serializer (read/write) for `NodePriceRule` model
body (PatchedNodePriceRule): Serializer (read/write) for `NodePriceRule` model
body (PatchedNodePriceRule): Serializer (read/write) for `NodePriceRule` model
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[NodePriceRule]
"""
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[
PatchedNodePriceRule,
PatchedNodePriceRule,
PatchedNodePriceRule,
],
) -> Optional[NodePriceRule]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodePriceRule): Serializer (read/write) for `NodePriceRule` model
body (PatchedNodePriceRule): Serializer (read/write) for `NodePriceRule` model
body (PatchedNodePriceRule): Serializer (read/write) for `NodePriceRule` model
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:
NodePriceRule
"""
return (
await asyncio_detailed(
id=id,
client=client,
body=body,
)
).parsed
@@ -0,0 +1,154 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node_price_rule import NodePriceRule
from ...types import Response
def _get_kwargs(
id: int,
) -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": f"/api/v2/modules_registrations/options/price_rules/{id}/",
}
return _kwargs
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[NodePriceRule]:
if response.status_code == 200:
response_200 = NodePriceRule.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[NodePriceRule]:
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[NodePriceRule]:
"""This view manages price rules
It filters price rules linked to configurations, via `NodePriceRuleM2M` through table, which users
have access to.
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[NodePriceRule]
"""
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[NodePriceRule]:
"""This view manages price rules
It filters price rules linked to configurations, via `NodePriceRuleM2M` through table, which users
have access to.
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:
NodePriceRule
"""
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
) -> Response[NodePriceRule]:
"""This view manages price rules
It filters price rules linked to configurations, via `NodePriceRuleM2M` through table, which users
have access to.
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[NodePriceRule]
"""
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[NodePriceRule]:
"""This view manages price rules
It filters price rules linked to configurations, via `NodePriceRuleM2M` through table, which users
have access to.
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:
NodePriceRule
"""
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed
@@ -0,0 +1,187 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.promotion_code import PromotionCode
from ...types import Response
def _get_kwargs(
*,
body: Union[
PromotionCode,
PromotionCode,
PromotionCode,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": "/api/v2/modules_registrations/options/promotion_codes/",
}
if isinstance(body, PromotionCode):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, PromotionCode):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, PromotionCode):
_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[PromotionCode]:
if response.status_code == 201:
response_201 = PromotionCode.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[PromotionCode]:
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[
PromotionCode,
PromotionCode,
PromotionCode,
],
) -> Response[PromotionCode]:
"""
Args:
body (PromotionCode): Serializer for PromotionCode model
body (PromotionCode): Serializer for PromotionCode model
body (PromotionCode): Serializer for PromotionCode model
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[PromotionCode]
"""
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[
PromotionCode,
PromotionCode,
PromotionCode,
],
) -> Optional[PromotionCode]:
"""
Args:
body (PromotionCode): Serializer for PromotionCode model
body (PromotionCode): Serializer for PromotionCode model
body (PromotionCode): Serializer for PromotionCode model
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:
PromotionCode
"""
return sync_detailed(
client=client,
body=body,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
body: Union[
PromotionCode,
PromotionCode,
PromotionCode,
],
) -> Response[PromotionCode]:
"""
Args:
body (PromotionCode): Serializer for PromotionCode model
body (PromotionCode): Serializer for PromotionCode model
body (PromotionCode): Serializer for PromotionCode model
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[PromotionCode]
"""
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[
PromotionCode,
PromotionCode,
PromotionCode,
],
) -> Optional[PromotionCode]:
"""
Args:
body (PromotionCode): Serializer for PromotionCode model
body (PromotionCode): Serializer for PromotionCode model
body (PromotionCode): Serializer for PromotionCode model
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:
PromotionCode
"""
return (
await asyncio_detailed(
client=client,
body=body,
)
).parsed
@@ -0,0 +1,91 @@
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_registrations/options/promotion_codes/{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]:
"""
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]:
"""
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)
@@ -0,0 +1,214 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.paginated_promotion_code_list import PaginatedPromotionCodeList
from ...types import UNSET, Response, Unset
def _get_kwargs(
*,
event_id: Union[Unset, float] = 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_id"] = event_id
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_registrations/options/promotion_codes/",
"params": params,
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[PaginatedPromotionCodeList]:
if response.status_code == 200:
response_200 = PaginatedPromotionCodeList.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[PaginatedPromotionCodeList]:
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedPromotionCodeList]:
"""
Args:
event_id (Union[Unset, float]):
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[PaginatedPromotionCodeList]
"""
kwargs = _get_kwargs(
event_id=event_id,
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedPromotionCodeList]:
"""
Args:
event_id (Union[Unset, float]):
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:
PaginatedPromotionCodeList
"""
return sync_detailed(
client=client,
event_id=event_id,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
event_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedPromotionCodeList]:
"""
Args:
event_id (Union[Unset, float]):
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[PaginatedPromotionCodeList]
"""
kwargs = _get_kwargs(
event_id=event_id,
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedPromotionCodeList]:
"""
Args:
event_id (Union[Unset, float]):
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:
PaginatedPromotionCodeList
"""
return (
await asyncio_detailed(
client=client,
event_id=event_id,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
)
).parsed
@@ -0,0 +1,213 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.patched_promotion_code import PatchedPromotionCode
from ...models.promotion_code import PromotionCode
from ...types import Response
def _get_kwargs(
id: int,
*,
body: Union[
PatchedPromotionCode,
PatchedPromotionCode,
PatchedPromotionCode,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "patch",
"url": f"/api/v2/modules_registrations/options/promotion_codes/{id}/",
}
if isinstance(body, PatchedPromotionCode):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, PatchedPromotionCode):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, PatchedPromotionCode):
_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[PromotionCode]:
if response.status_code == 200:
response_200 = PromotionCode.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[PromotionCode]:
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[
PatchedPromotionCode,
PatchedPromotionCode,
PatchedPromotionCode,
],
) -> Response[PromotionCode]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedPromotionCode): Serializer for PromotionCode model
body (PatchedPromotionCode): Serializer for PromotionCode model
body (PatchedPromotionCode): Serializer for PromotionCode model
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[PromotionCode]
"""
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[
PatchedPromotionCode,
PatchedPromotionCode,
PatchedPromotionCode,
],
) -> Optional[PromotionCode]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedPromotionCode): Serializer for PromotionCode model
body (PatchedPromotionCode): Serializer for PromotionCode model
body (PatchedPromotionCode): Serializer for PromotionCode model
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:
PromotionCode
"""
return sync_detailed(
id=id,
client=client,
body=body,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
body: Union[
PatchedPromotionCode,
PatchedPromotionCode,
PatchedPromotionCode,
],
) -> Response[PromotionCode]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedPromotionCode): Serializer for PromotionCode model
body (PatchedPromotionCode): Serializer for PromotionCode model
body (PatchedPromotionCode): Serializer for PromotionCode model
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[PromotionCode]
"""
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[
PatchedPromotionCode,
PatchedPromotionCode,
PatchedPromotionCode,
],
) -> Optional[PromotionCode]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedPromotionCode): Serializer for PromotionCode model
body (PatchedPromotionCode): Serializer for PromotionCode model
body (PatchedPromotionCode): Serializer for PromotionCode model
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:
PromotionCode
"""
return (
await asyncio_detailed(
id=id,
client=client,
body=body,
)
).parsed
@@ -0,0 +1,142 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.promotion_code import PromotionCode
from ...types import Response
def _get_kwargs(
id: int,
) -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": f"/api/v2/modules_registrations/options/promotion_codes/{id}/",
}
return _kwargs
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[PromotionCode]:
if response.status_code == 200:
response_200 = PromotionCode.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[PromotionCode]:
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[PromotionCode]:
"""
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[PromotionCode]
"""
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[PromotionCode]:
"""
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:
PromotionCode
"""
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
) -> Response[PromotionCode]:
"""
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[PromotionCode]
"""
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[PromotionCode]:
"""
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:
PromotionCode
"""
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed
@@ -0,0 +1,187 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.statement import Statement
from ...types import Response
def _get_kwargs(
*,
body: Union[
Statement,
Statement,
Statement,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": "/api/v2/modules_registrations/options/statements/",
}
if isinstance(body, Statement):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, Statement):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, Statement):
_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[Statement]:
if response.status_code == 201:
response_201 = Statement.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[Statement]:
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[
Statement,
Statement,
Statement,
],
) -> Response[Statement]:
"""
Args:
body (Statement): Serializer for the Statement model
body (Statement): Serializer for the Statement model
body (Statement): Serializer for the Statement model
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[Statement]
"""
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[
Statement,
Statement,
Statement,
],
) -> Optional[Statement]:
"""
Args:
body (Statement): Serializer for the Statement model
body (Statement): Serializer for the Statement model
body (Statement): Serializer for the Statement model
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:
Statement
"""
return sync_detailed(
client=client,
body=body,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
body: Union[
Statement,
Statement,
Statement,
],
) -> Response[Statement]:
"""
Args:
body (Statement): Serializer for the Statement model
body (Statement): Serializer for the Statement model
body (Statement): Serializer for the Statement model
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[Statement]
"""
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[
Statement,
Statement,
Statement,
],
) -> Optional[Statement]:
"""
Args:
body (Statement): Serializer for the Statement model
body (Statement): Serializer for the Statement model
body (Statement): Serializer for the Statement model
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:
Statement
"""
return (
await asyncio_detailed(
client=client,
body=body,
)
).parsed
@@ -0,0 +1,91 @@
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_registrations/options/statements/{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]:
"""
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]:
"""
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)
@@ -0,0 +1,214 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.paginated_statement_list import PaginatedStatementList
from ...types import UNSET, Response, Unset
def _get_kwargs(
*,
event_id: Union[Unset, float] = 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_id"] = event_id
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_registrations/options/statements/",
"params": params,
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[PaginatedStatementList]:
if response.status_code == 200:
response_200 = PaginatedStatementList.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[PaginatedStatementList]:
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedStatementList]:
"""
Args:
event_id (Union[Unset, float]):
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[PaginatedStatementList]
"""
kwargs = _get_kwargs(
event_id=event_id,
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedStatementList]:
"""
Args:
event_id (Union[Unset, float]):
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:
PaginatedStatementList
"""
return sync_detailed(
client=client,
event_id=event_id,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
event_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedStatementList]:
"""
Args:
event_id (Union[Unset, float]):
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[PaginatedStatementList]
"""
kwargs = _get_kwargs(
event_id=event_id,
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_id: Union[Unset, float] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedStatementList]:
"""
Args:
event_id (Union[Unset, float]):
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:
PaginatedStatementList
"""
return (
await asyncio_detailed(
client=client,
event_id=event_id,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
)
).parsed
@@ -0,0 +1,213 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.patched_statement import PatchedStatement
from ...models.statement import Statement
from ...types import Response
def _get_kwargs(
id: int,
*,
body: Union[
PatchedStatement,
PatchedStatement,
PatchedStatement,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "patch",
"url": f"/api/v2/modules_registrations/options/statements/{id}/",
}
if isinstance(body, PatchedStatement):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, PatchedStatement):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, PatchedStatement):
_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[Statement]:
if response.status_code == 200:
response_200 = Statement.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[Statement]:
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[
PatchedStatement,
PatchedStatement,
PatchedStatement,
],
) -> Response[Statement]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedStatement): Serializer for the Statement model
body (PatchedStatement): Serializer for the Statement model
body (PatchedStatement): Serializer for the Statement model
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[Statement]
"""
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[
PatchedStatement,
PatchedStatement,
PatchedStatement,
],
) -> Optional[Statement]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedStatement): Serializer for the Statement model
body (PatchedStatement): Serializer for the Statement model
body (PatchedStatement): Serializer for the Statement model
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:
Statement
"""
return sync_detailed(
id=id,
client=client,
body=body,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
body: Union[
PatchedStatement,
PatchedStatement,
PatchedStatement,
],
) -> Response[Statement]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedStatement): Serializer for the Statement model
body (PatchedStatement): Serializer for the Statement model
body (PatchedStatement): Serializer for the Statement model
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[Statement]
"""
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[
PatchedStatement,
PatchedStatement,
PatchedStatement,
],
) -> Optional[Statement]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedStatement): Serializer for the Statement model
body (PatchedStatement): Serializer for the Statement model
body (PatchedStatement): Serializer for the Statement model
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:
Statement
"""
return (
await asyncio_detailed(
id=id,
client=client,
body=body,
)
).parsed
@@ -0,0 +1,142 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.statement import Statement
from ...types import Response
def _get_kwargs(
id: int,
) -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": f"/api/v2/modules_registrations/options/statements/{id}/",
}
return _kwargs
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Statement]:
if response.status_code == 200:
response_200 = Statement.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[Statement]:
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[Statement]:
"""
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[Statement]
"""
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[Statement]:
"""
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:
Statement
"""
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
) -> Response[Statement]:
"""
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[Statement]
"""
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[Statement]:
"""
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:
Statement
"""
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed
@@ -0,0 +1,195 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node_tag import NodeTag
from ...types import Response
def _get_kwargs(
*,
body: Union[
NodeTag,
NodeTag,
NodeTag,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": "/api/v2/modules_registrations/options/tags/",
}
if isinstance(body, NodeTag):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, NodeTag):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, NodeTag):
_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[NodeTag]:
if response.status_code == 201:
response_201 = NodeTag.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[NodeTag]:
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[
NodeTag,
NodeTag,
NodeTag,
],
) -> Response[NodeTag]:
"""This view manages node tags
It filters node tags linked to configurations which users have access to.
Args:
body (NodeTag): Serializer (read/write) for `NodeTag` model
body (NodeTag): Serializer (read/write) for `NodeTag` model
body (NodeTag): Serializer (read/write) for `NodeTag` model
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[NodeTag]
"""
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[
NodeTag,
NodeTag,
NodeTag,
],
) -> Optional[NodeTag]:
"""This view manages node tags
It filters node tags linked to configurations which users have access to.
Args:
body (NodeTag): Serializer (read/write) for `NodeTag` model
body (NodeTag): Serializer (read/write) for `NodeTag` model
body (NodeTag): Serializer (read/write) for `NodeTag` model
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:
NodeTag
"""
return sync_detailed(
client=client,
body=body,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
body: Union[
NodeTag,
NodeTag,
NodeTag,
],
) -> Response[NodeTag]:
"""This view manages node tags
It filters node tags linked to configurations which users have access to.
Args:
body (NodeTag): Serializer (read/write) for `NodeTag` model
body (NodeTag): Serializer (read/write) for `NodeTag` model
body (NodeTag): Serializer (read/write) for `NodeTag` model
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[NodeTag]
"""
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[
NodeTag,
NodeTag,
NodeTag,
],
) -> Optional[NodeTag]:
"""This view manages node tags
It filters node tags linked to configurations which users have access to.
Args:
body (NodeTag): Serializer (read/write) for `NodeTag` model
body (NodeTag): Serializer (read/write) for `NodeTag` model
body (NodeTag): Serializer (read/write) for `NodeTag` model
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:
NodeTag
"""
return (
await asyncio_detailed(
client=client,
body=body,
)
).parsed
@@ -0,0 +1,95 @@
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_registrations/options/tags/{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]:
"""This view manages node tags
It filters node tags linked to configurations which users have access to.
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]:
"""This view manages node tags
It filters node tags linked to configurations which users have access to.
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)
@@ -0,0 +1,241 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.paginated_node_tag_list import PaginatedNodeTagList
from ...types import UNSET, Response, Unset
def _get_kwargs(
*,
event_id: Union[Unset, float] = UNSET,
node_configuration: Union[Unset, list[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_id"] = event_id
json_node_configuration: Union[Unset, list[int]] = UNSET
if not isinstance(node_configuration, Unset):
json_node_configuration = node_configuration
params["node_configuration"] = json_node_configuration
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_registrations/options/tags/",
"params": params,
}
return _kwargs
def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[PaginatedNodeTagList]:
if response.status_code == 200:
response_200 = PaginatedNodeTagList.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[PaginatedNodeTagList]:
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_id: Union[Unset, float] = UNSET,
node_configuration: Union[Unset, list[int]] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedNodeTagList]:
"""This view manages node tags
It filters node tags linked to configurations which users have access to.
Args:
event_id (Union[Unset, float]):
node_configuration (Union[Unset, list[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[PaginatedNodeTagList]
"""
kwargs = _get_kwargs(
event_id=event_id,
node_configuration=node_configuration,
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_id: Union[Unset, float] = UNSET,
node_configuration: Union[Unset, list[int]] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedNodeTagList]:
"""This view manages node tags
It filters node tags linked to configurations which users have access to.
Args:
event_id (Union[Unset, float]):
node_configuration (Union[Unset, list[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:
PaginatedNodeTagList
"""
return sync_detailed(
client=client,
event_id=event_id,
node_configuration=node_configuration,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient,
event_id: Union[Unset, float] = UNSET,
node_configuration: Union[Unset, list[int]] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Response[PaginatedNodeTagList]:
"""This view manages node tags
It filters node tags linked to configurations which users have access to.
Args:
event_id (Union[Unset, float]):
node_configuration (Union[Unset, list[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[PaginatedNodeTagList]
"""
kwargs = _get_kwargs(
event_id=event_id,
node_configuration=node_configuration,
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_id: Union[Unset, float] = UNSET,
node_configuration: Union[Unset, list[int]] = UNSET,
o: Union[Unset, str] = UNSET,
offset: Union[Unset, int] = UNSET,
page_limit: Union[Unset, int] = UNSET,
q: Union[Unset, str] = UNSET,
) -> Optional[PaginatedNodeTagList]:
"""This view manages node tags
It filters node tags linked to configurations which users have access to.
Args:
event_id (Union[Unset, float]):
node_configuration (Union[Unset, list[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:
PaginatedNodeTagList
"""
return (
await asyncio_detailed(
client=client,
event_id=event_id,
node_configuration=node_configuration,
o=o,
offset=offset,
page_limit=page_limit,
q=q,
)
).parsed
@@ -0,0 +1,213 @@
from http import HTTPStatus
from typing import Any, Optional, Union
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.node_tag import NodeTag
from ...models.patched_node_tag import PatchedNodeTag
from ...types import Response
def _get_kwargs(
id: int,
*,
body: Union[
PatchedNodeTag,
PatchedNodeTag,
PatchedNodeTag,
],
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "patch",
"url": f"/api/v2/modules_registrations/options/tags/{id}/",
}
if isinstance(body, PatchedNodeTag):
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
if isinstance(body, PatchedNodeTag):
_kwargs["data"] = body.to_dict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
if isinstance(body, PatchedNodeTag):
_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[NodeTag]:
if response.status_code == 200:
response_200 = NodeTag.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[NodeTag]:
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[
PatchedNodeTag,
PatchedNodeTag,
PatchedNodeTag,
],
) -> Response[NodeTag]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeTag): Serializer (read/write) for `NodeTag` model
body (PatchedNodeTag): Serializer (read/write) for `NodeTag` model
body (PatchedNodeTag): Serializer (read/write) for `NodeTag` model
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[NodeTag]
"""
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[
PatchedNodeTag,
PatchedNodeTag,
PatchedNodeTag,
],
) -> Optional[NodeTag]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeTag): Serializer (read/write) for `NodeTag` model
body (PatchedNodeTag): Serializer (read/write) for `NodeTag` model
body (PatchedNodeTag): Serializer (read/write) for `NodeTag` model
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:
NodeTag
"""
return sync_detailed(
id=id,
client=client,
body=body,
).parsed
async def asyncio_detailed(
id: int,
*,
client: AuthenticatedClient,
body: Union[
PatchedNodeTag,
PatchedNodeTag,
PatchedNodeTag,
],
) -> Response[NodeTag]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeTag): Serializer (read/write) for `NodeTag` model
body (PatchedNodeTag): Serializer (read/write) for `NodeTag` model
body (PatchedNodeTag): Serializer (read/write) for `NodeTag` model
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[NodeTag]
"""
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[
PatchedNodeTag,
PatchedNodeTag,
PatchedNodeTag,
],
) -> Optional[NodeTag]:
"""Partial update (PATCH) definition
Returns:
response: the serialized data
Args:
id (int):
body (PatchedNodeTag): Serializer (read/write) for `NodeTag` model
body (PatchedNodeTag): Serializer (read/write) for `NodeTag` model
body (PatchedNodeTag): Serializer (read/write) for `NodeTag` model
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:
NodeTag
"""
return (
await asyncio_detailed(
id=id,
client=client,
body=body,
)
).parsed

Some files were not shown because too many files have changed in this diff Show More