refactor: add polylan-aandt generated client

This commit is contained in:
2026-09-16 15:36:51 +02:00
parent fabf06e6d4
commit 9ec9a54649
73 changed files with 7000 additions and 125 deletions
@@ -0,0 +1 @@
"""Contains methods for accessing the API"""
@@ -0,0 +1 @@
"""Contains endpoint functions for accessing the API"""
@@ -0,0 +1,134 @@
from http import HTTPStatus
from typing import Any
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.aandt_api_apibot_get_response_200 import AandtApiApibotGetResponse200
from ...models.aandt_api_apibot_get_response_401 import AandtApiApibotGetResponse401
from ...types import Response
def _get_kwargs() -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": "/apibot",
}
return _kwargs
def _parse_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> AandtApiApibotGetResponse200 | AandtApiApibotGetResponse401 | None:
if response.status_code == 200:
response_200 = AandtApiApibotGetResponse200.from_dict(response.json())
return response_200
if response.status_code == 401:
response_401 = AandtApiApibotGetResponse401.from_dict(response.text)
return response_401
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> Response[AandtApiApibotGetResponse200 | AandtApiApibotGetResponse401]:
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 | Client,
) -> Response[AandtApiApibotGetResponse200 | AandtApiApibotGetResponse401]:
"""Get the AAndT's apibot activation state and display name
Raises:
errors.UnexpectedStatus: If the server 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[AandtApiApibotGetResponse200 | AandtApiApibotGetResponse401]
"""
kwargs = _get_kwargs()
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
*,
client: AuthenticatedClient | Client,
) -> AandtApiApibotGetResponse200 | AandtApiApibotGetResponse401 | None:
"""Get the AAndT's apibot activation state and display name
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
AandtApiApibotGetResponse200 | AandtApiApibotGetResponse401
"""
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient | Client,
) -> Response[AandtApiApibotGetResponse200 | AandtApiApibotGetResponse401]:
"""Get the AAndT's apibot activation state and display name
Raises:
errors.UnexpectedStatus: If the server 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[AandtApiApibotGetResponse200 | AandtApiApibotGetResponse401]
"""
kwargs = _get_kwargs()
response = await client.get_async_httpx_client().request(**kwargs)
return _build_response(client=client, response=response)
async def asyncio(
*,
client: AuthenticatedClient | Client,
) -> AandtApiApibotGetResponse200 | AandtApiApibotGetResponse401 | None:
"""Get the AAndT's apibot activation state and display name
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
AandtApiApibotGetResponse200 | AandtApiApibotGetResponse401
"""
return (
await asyncio_detailed(
client=client,
)
).parsed
@@ -0,0 +1,174 @@
from http import HTTPStatus
from typing import Any
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.aandt_api_apibot_set_body import AandtApiApibotSetBody
from ...models.aandt_api_apibot_set_response_401 import AandtApiApibotSetResponse401
from ...models.success_response import SuccessResponse
from ...types import Response
def _get_kwargs(
*,
body: AandtApiApibotSetBody,
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": "/apibot",
}
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
_kwargs["headers"] = headers
return _kwargs
def _parse_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> AandtApiApibotSetResponse401 | SuccessResponse | None:
if response.status_code == 200:
response_200 = SuccessResponse.from_dict(response.json())
return response_200
if response.status_code == 401:
response_401 = AandtApiApibotSetResponse401.from_dict(response.text)
return response_401
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> Response[AandtApiApibotSetResponse401 | SuccessResponse]:
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 | Client,
body: AandtApiApibotSetBody,
) -> Response[AandtApiApibotSetResponse401 | SuccessResponse]:
"""Set the AAndT's apibot activation state and/or display name
Broadcasts the update over Zuperpush after saving.
Args:
body (AandtApiApibotSetBody):
Raises:
errors.UnexpectedStatus: If the server 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[AandtApiApibotSetResponse401 | SuccessResponse]
"""
kwargs = _get_kwargs(
body=body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
*,
client: AuthenticatedClient | Client,
body: AandtApiApibotSetBody,
) -> AandtApiApibotSetResponse401 | SuccessResponse | None:
"""Set the AAndT's apibot activation state and/or display name
Broadcasts the update over Zuperpush after saving.
Args:
body (AandtApiApibotSetBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
AandtApiApibotSetResponse401 | SuccessResponse
"""
return sync_detailed(
client=client,
body=body,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient | Client,
body: AandtApiApibotSetBody,
) -> Response[AandtApiApibotSetResponse401 | SuccessResponse]:
"""Set the AAndT's apibot activation state and/or display name
Broadcasts the update over Zuperpush after saving.
Args:
body (AandtApiApibotSetBody):
Raises:
errors.UnexpectedStatus: If the server 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[AandtApiApibotSetResponse401 | SuccessResponse]
"""
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 | Client,
body: AandtApiApibotSetBody,
) -> AandtApiApibotSetResponse401 | SuccessResponse | None:
"""Set the AAndT's apibot activation state and/or display name
Broadcasts the update over Zuperpush after saving.
Args:
body (AandtApiApibotSetBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
AandtApiApibotSetResponse401 | SuccessResponse
"""
return (
await asyncio_detailed(
client=client,
body=body,
)
).parsed
@@ -0,0 +1,142 @@
from http import HTTPStatus
from typing import Any
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.aandt_api_infos_response_200 import AandtApiInfosResponse200
from ...models.aandt_api_infos_response_401 import AandtApiInfosResponse401
from ...types import Response
def _get_kwargs() -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": "/",
}
return _kwargs
def _parse_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> AandtApiInfosResponse200 | AandtApiInfosResponse401 | None:
if response.status_code == 200:
response_200 = AandtApiInfosResponse200.from_dict(response.json())
return response_200
if response.status_code == 401:
response_401 = AandtApiInfosResponse401.from_dict(response.text)
return response_401
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> Response[AandtApiInfosResponse200 | AandtApiInfosResponse401]:
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 | Client,
) -> Response[AandtApiInfosResponse200 | AandtApiInfosResponse401]:
"""Get general information about the AAndT
Read-only. AAndT is resolved from the bearer token.
Raises:
errors.UnexpectedStatus: If the server 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[AandtApiInfosResponse200 | AandtApiInfosResponse401]
"""
kwargs = _get_kwargs()
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
*,
client: AuthenticatedClient | Client,
) -> AandtApiInfosResponse200 | AandtApiInfosResponse401 | None:
"""Get general information about the AAndT
Read-only. AAndT is resolved from the bearer token.
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
AandtApiInfosResponse200 | AandtApiInfosResponse401
"""
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient | Client,
) -> Response[AandtApiInfosResponse200 | AandtApiInfosResponse401]:
"""Get general information about the AAndT
Read-only. AAndT is resolved from the bearer token.
Raises:
errors.UnexpectedStatus: If the server 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[AandtApiInfosResponse200 | AandtApiInfosResponse401]
"""
kwargs = _get_kwargs()
response = await client.get_async_httpx_client().request(**kwargs)
return _build_response(client=client, response=response)
async def asyncio(
*,
client: AuthenticatedClient | Client,
) -> AandtApiInfosResponse200 | AandtApiInfosResponse401 | None:
"""Get general information about the AAndT
Read-only. AAndT is resolved from the bearer token.
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
AandtApiInfosResponse200 | AandtApiInfosResponse401
"""
return (
await asyncio_detailed(
client=client,
)
).parsed
@@ -0,0 +1,166 @@
from http import HTTPStatus
from typing import Any
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.aandt_api_log_body import AandtApiLogBody
from ...models.aandt_api_log_response_401 import AandtApiLogResponse401
from ...models.success_response import SuccessResponse
from ...types import Response
def _get_kwargs(
*,
body: AandtApiLogBody,
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": "/log",
}
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
_kwargs["headers"] = headers
return _kwargs
def _parse_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> AandtApiLogResponse401 | SuccessResponse | None:
if response.status_code == 200:
response_200 = SuccessResponse.from_dict(response.json())
return response_200
if response.status_code == 401:
response_401 = AandtApiLogResponse401.from_dict(response.text)
return response_401
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> Response[AandtApiLogResponse401 | SuccessResponse]:
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 | Client,
body: AandtApiLogBody,
) -> Response[AandtApiLogResponse401 | SuccessResponse]:
"""Add a log entry to the AAndT's log (prefixed with "API:")
Args:
body (AandtApiLogBody):
Raises:
errors.UnexpectedStatus: If the server 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[AandtApiLogResponse401 | SuccessResponse]
"""
kwargs = _get_kwargs(
body=body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
*,
client: AuthenticatedClient | Client,
body: AandtApiLogBody,
) -> AandtApiLogResponse401 | SuccessResponse | None:
"""Add a log entry to the AAndT's log (prefixed with "API:")
Args:
body (AandtApiLogBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
AandtApiLogResponse401 | SuccessResponse
"""
return sync_detailed(
client=client,
body=body,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient | Client,
body: AandtApiLogBody,
) -> Response[AandtApiLogResponse401 | SuccessResponse]:
"""Add a log entry to the AAndT's log (prefixed with "API:")
Args:
body (AandtApiLogBody):
Raises:
errors.UnexpectedStatus: If the server 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[AandtApiLogResponse401 | SuccessResponse]
"""
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 | Client,
body: AandtApiLogBody,
) -> AandtApiLogResponse401 | SuccessResponse | None:
"""Add a log entry to the AAndT's log (prefixed with "API:")
Args:
body (AandtApiLogBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
AandtApiLogResponse401 | SuccessResponse
"""
return (
await asyncio_detailed(
client=client,
body=body,
)
).parsed
@@ -0,0 +1,190 @@
from http import HTTPStatus
from typing import Any
from urllib.parse import quote
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.aandt_api_match_messages_get_response_200 import (
AandtApiMatchMessagesGetResponse200,
)
from ...models.aandt_api_match_messages_get_response_401 import (
AandtApiMatchMessagesGetResponse401,
)
from ...types import Response
def _get_kwargs(
pk: int,
) -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": "/match/{pk}/messages".format(
pk=quote(str(pk), safe=""),
),
}
return _kwargs
def _parse_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> (
AandtApiMatchMessagesGetResponse200
| AandtApiMatchMessagesGetResponse401
| str
| None
):
if response.status_code == 200:
response_200 = AandtApiMatchMessagesGetResponse200.from_dict(response.json())
return response_200
if response.status_code == 401:
response_401 = AandtApiMatchMessagesGetResponse401.from_dict(response.text)
return response_401
if response.status_code == 404:
response_404 = response.text
return response_404
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> Response[
AandtApiMatchMessagesGetResponse200 | AandtApiMatchMessagesGetResponse401 | str
]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
pk: int,
*,
client: AuthenticatedClient | Client,
) -> Response[
AandtApiMatchMessagesGetResponse200 | AandtApiMatchMessagesGetResponse401 | str
]:
"""Get a match's bot messages (all/players/admin)
Args:
pk (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[AandtApiMatchMessagesGetResponse200 | AandtApiMatchMessagesGetResponse401 | str]
"""
kwargs = _get_kwargs(
pk=pk,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
pk: int,
*,
client: AuthenticatedClient | Client,
) -> (
AandtApiMatchMessagesGetResponse200
| AandtApiMatchMessagesGetResponse401
| str
| None
):
"""Get a match's bot messages (all/players/admin)
Args:
pk (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:
AandtApiMatchMessagesGetResponse200 | AandtApiMatchMessagesGetResponse401 | str
"""
return sync_detailed(
pk=pk,
client=client,
).parsed
async def asyncio_detailed(
pk: int,
*,
client: AuthenticatedClient | Client,
) -> Response[
AandtApiMatchMessagesGetResponse200 | AandtApiMatchMessagesGetResponse401 | str
]:
"""Get a match's bot messages (all/players/admin)
Args:
pk (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[AandtApiMatchMessagesGetResponse200 | AandtApiMatchMessagesGetResponse401 | str]
"""
kwargs = _get_kwargs(
pk=pk,
)
response = await client.get_async_httpx_client().request(**kwargs)
return _build_response(client=client, response=response)
async def asyncio(
pk: int,
*,
client: AuthenticatedClient | Client,
) -> (
AandtApiMatchMessagesGetResponse200
| AandtApiMatchMessagesGetResponse401
| str
| None
):
"""Get a match's bot messages (all/players/admin)
Args:
pk (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:
AandtApiMatchMessagesGetResponse200 | AandtApiMatchMessagesGetResponse401 | str
"""
return (
await asyncio_detailed(
pk=pk,
client=client,
)
).parsed
@@ -0,0 +1,200 @@
from http import HTTPStatus
from typing import Any
from urllib.parse import quote
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.aandt_api_match_messages_set_body import AandtApiMatchMessagesSetBody
from ...models.aandt_api_match_messages_set_response_401 import (
AandtApiMatchMessagesSetResponse401,
)
from ...models.success_response import SuccessResponse
from ...types import Response
def _get_kwargs(
pk: int,
*,
body: AandtApiMatchMessagesSetBody,
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": "/match/{pk}/messages".format(
pk=quote(str(pk), safe=""),
),
}
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
_kwargs["headers"] = headers
return _kwargs
def _parse_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> AandtApiMatchMessagesSetResponse401 | SuccessResponse | str | None:
if response.status_code == 200:
response_200 = SuccessResponse.from_dict(response.json())
return response_200
if response.status_code == 401:
response_401 = AandtApiMatchMessagesSetResponse401.from_dict(response.text)
return response_401
if response.status_code == 404:
response_404 = response.text
return response_404
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> Response[AandtApiMatchMessagesSetResponse401 | SuccessResponse | str]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
pk: int,
*,
client: AuthenticatedClient | Client,
body: AandtApiMatchMessagesSetBody,
) -> Response[AandtApiMatchMessagesSetResponse401 | SuccessResponse | str]:
"""Set one or more of a match's bot messages
Any of `all`, `players`, `admin` may be omitted; only the keys present in the body are updated.
Triggers a Zuperpush update.
Args:
pk (int):
body (AandtApiMatchMessagesSetBody):
Raises:
errors.UnexpectedStatus: If the server 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[AandtApiMatchMessagesSetResponse401 | SuccessResponse | str]
"""
kwargs = _get_kwargs(
pk=pk,
body=body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
pk: int,
*,
client: AuthenticatedClient | Client,
body: AandtApiMatchMessagesSetBody,
) -> AandtApiMatchMessagesSetResponse401 | SuccessResponse | str | None:
"""Set one or more of a match's bot messages
Any of `all`, `players`, `admin` may be omitted; only the keys present in the body are updated.
Triggers a Zuperpush update.
Args:
pk (int):
body (AandtApiMatchMessagesSetBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
AandtApiMatchMessagesSetResponse401 | SuccessResponse | str
"""
return sync_detailed(
pk=pk,
client=client,
body=body,
).parsed
async def asyncio_detailed(
pk: int,
*,
client: AuthenticatedClient | Client,
body: AandtApiMatchMessagesSetBody,
) -> Response[AandtApiMatchMessagesSetResponse401 | SuccessResponse | str]:
"""Set one or more of a match's bot messages
Any of `all`, `players`, `admin` may be omitted; only the keys present in the body are updated.
Triggers a Zuperpush update.
Args:
pk (int):
body (AandtApiMatchMessagesSetBody):
Raises:
errors.UnexpectedStatus: If the server 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[AandtApiMatchMessagesSetResponse401 | SuccessResponse | str]
"""
kwargs = _get_kwargs(
pk=pk,
body=body,
)
response = await client.get_async_httpx_client().request(**kwargs)
return _build_response(client=client, response=response)
async def asyncio(
pk: int,
*,
client: AuthenticatedClient | Client,
body: AandtApiMatchMessagesSetBody,
) -> AandtApiMatchMessagesSetResponse401 | SuccessResponse | str | None:
"""Set one or more of a match's bot messages
Any of `all`, `players`, `admin` may be omitted; only the keys present in the body are updated.
Triggers a Zuperpush update.
Args:
pk (int):
body (AandtApiMatchMessagesSetBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
AandtApiMatchMessagesSetResponse401 | SuccessResponse | str
"""
return (
await asyncio_detailed(
pk=pk,
client=client,
body=body,
)
).parsed
@@ -0,0 +1,190 @@
from http import HTTPStatus
from typing import Any
from urllib.parse import quote
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.aandt_api_match_metadata_get_response_200 import (
AandtApiMatchMetadataGetResponse200,
)
from ...models.aandt_api_match_metadata_get_response_401 import (
AandtApiMatchMetadataGetResponse401,
)
from ...types import Response
def _get_kwargs(
pk: int,
) -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": "/match/{pk}/metadata".format(
pk=quote(str(pk), safe=""),
),
}
return _kwargs
def _parse_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> (
AandtApiMatchMetadataGetResponse200
| AandtApiMatchMetadataGetResponse401
| str
| None
):
if response.status_code == 200:
response_200 = AandtApiMatchMetadataGetResponse200.from_dict(response.json())
return response_200
if response.status_code == 401:
response_401 = AandtApiMatchMetadataGetResponse401.from_dict(response.text)
return response_401
if response.status_code == 404:
response_404 = response.text
return response_404
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> Response[
AandtApiMatchMetadataGetResponse200 | AandtApiMatchMetadataGetResponse401 | str
]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
pk: int,
*,
client: AuthenticatedClient | Client,
) -> Response[
AandtApiMatchMetadataGetResponse200 | AandtApiMatchMetadataGetResponse401 | str
]:
"""Get a match's bot metadata
Args:
pk (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[AandtApiMatchMetadataGetResponse200 | AandtApiMatchMetadataGetResponse401 | str]
"""
kwargs = _get_kwargs(
pk=pk,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
pk: int,
*,
client: AuthenticatedClient | Client,
) -> (
AandtApiMatchMetadataGetResponse200
| AandtApiMatchMetadataGetResponse401
| str
| None
):
"""Get a match's bot metadata
Args:
pk (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:
AandtApiMatchMetadataGetResponse200 | AandtApiMatchMetadataGetResponse401 | str
"""
return sync_detailed(
pk=pk,
client=client,
).parsed
async def asyncio_detailed(
pk: int,
*,
client: AuthenticatedClient | Client,
) -> Response[
AandtApiMatchMetadataGetResponse200 | AandtApiMatchMetadataGetResponse401 | str
]:
"""Get a match's bot metadata
Args:
pk (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[AandtApiMatchMetadataGetResponse200 | AandtApiMatchMetadataGetResponse401 | str]
"""
kwargs = _get_kwargs(
pk=pk,
)
response = await client.get_async_httpx_client().request(**kwargs)
return _build_response(client=client, response=response)
async def asyncio(
pk: int,
*,
client: AuthenticatedClient | Client,
) -> (
AandtApiMatchMetadataGetResponse200
| AandtApiMatchMetadataGetResponse401
| str
| None
):
"""Get a match's bot metadata
Args:
pk (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:
AandtApiMatchMetadataGetResponse200 | AandtApiMatchMetadataGetResponse401 | str
"""
return (
await asyncio_detailed(
pk=pk,
client=client,
)
).parsed
@@ -0,0 +1,188 @@
from http import HTTPStatus
from typing import Any
from urllib.parse import quote
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.aandt_api_match_metadata_set_body import AandtApiMatchMetadataSetBody
from ...models.aandt_api_match_metadata_set_response_401 import (
AandtApiMatchMetadataSetResponse401,
)
from ...models.success_response import SuccessResponse
from ...types import Response
def _get_kwargs(
pk: int,
*,
body: AandtApiMatchMetadataSetBody,
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": "/match/{pk}/metadata".format(
pk=quote(str(pk), safe=""),
),
}
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
_kwargs["headers"] = headers
return _kwargs
def _parse_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> AandtApiMatchMetadataSetResponse401 | SuccessResponse | str | None:
if response.status_code == 200:
response_200 = SuccessResponse.from_dict(response.json())
return response_200
if response.status_code == 401:
response_401 = AandtApiMatchMetadataSetResponse401.from_dict(response.text)
return response_401
if response.status_code == 404:
response_404 = response.text
return response_404
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> Response[AandtApiMatchMetadataSetResponse401 | SuccessResponse | str]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
pk: int,
*,
client: AuthenticatedClient | Client,
body: AandtApiMatchMetadataSetBody,
) -> Response[AandtApiMatchMetadataSetResponse401 | SuccessResponse | str]:
"""Set a match's bot metadata
Args:
pk (int):
body (AandtApiMatchMetadataSetBody):
Raises:
errors.UnexpectedStatus: If the server 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[AandtApiMatchMetadataSetResponse401 | SuccessResponse | str]
"""
kwargs = _get_kwargs(
pk=pk,
body=body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
pk: int,
*,
client: AuthenticatedClient | Client,
body: AandtApiMatchMetadataSetBody,
) -> AandtApiMatchMetadataSetResponse401 | SuccessResponse | str | None:
"""Set a match's bot metadata
Args:
pk (int):
body (AandtApiMatchMetadataSetBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
AandtApiMatchMetadataSetResponse401 | SuccessResponse | str
"""
return sync_detailed(
pk=pk,
client=client,
body=body,
).parsed
async def asyncio_detailed(
pk: int,
*,
client: AuthenticatedClient | Client,
body: AandtApiMatchMetadataSetBody,
) -> Response[AandtApiMatchMetadataSetResponse401 | SuccessResponse | str]:
"""Set a match's bot metadata
Args:
pk (int):
body (AandtApiMatchMetadataSetBody):
Raises:
errors.UnexpectedStatus: If the server 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[AandtApiMatchMetadataSetResponse401 | SuccessResponse | str]
"""
kwargs = _get_kwargs(
pk=pk,
body=body,
)
response = await client.get_async_httpx_client().request(**kwargs)
return _build_response(client=client, response=response)
async def asyncio(
pk: int,
*,
client: AuthenticatedClient | Client,
body: AandtApiMatchMetadataSetBody,
) -> AandtApiMatchMetadataSetResponse401 | SuccessResponse | str | None:
"""Set a match's bot metadata
Args:
pk (int):
body (AandtApiMatchMetadataSetBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
AandtApiMatchMetadataSetResponse401 | SuccessResponse | str
"""
return (
await asyncio_detailed(
pk=pk,
client=client,
body=body,
)
).parsed
@@ -0,0 +1,231 @@
from http import HTTPStatus
from typing import Any
from urllib.parse import quote
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.aandt_api_match_submit_results_body import AandtApiMatchSubmitResultsBody
from ...models.aandt_api_match_submit_results_response_200 import (
AandtApiMatchSubmitResultsResponse200,
)
from ...models.aandt_api_match_submit_results_response_401 import (
AandtApiMatchSubmitResultsResponse401,
)
from ...types import Response
def _get_kwargs(
pk: int,
*,
body: AandtApiMatchSubmitResultsBody,
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": "/match/{pk}/sumbit_results".format(
pk=quote(str(pk), safe=""),
),
}
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
_kwargs["headers"] = headers
return _kwargs
def _parse_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> (
AandtApiMatchSubmitResultsResponse200
| AandtApiMatchSubmitResultsResponse401
| str
| None
):
if response.status_code == 200:
response_200 = AandtApiMatchSubmitResultsResponse200.from_dict(response.json())
return response_200
if response.status_code == 401:
response_401 = AandtApiMatchSubmitResultsResponse401.from_dict(response.text)
return response_401
if response.status_code == 404:
response_404 = response.text
return response_404
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> Response[
AandtApiMatchSubmitResultsResponse200 | AandtApiMatchSubmitResultsResponse401 | str
]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
pk: int,
*,
client: AuthenticatedClient | Client,
body: AandtApiMatchSubmitResultsBody,
) -> Response[
AandtApiMatchSubmitResultsResponse200 | AandtApiMatchSubmitResultsResponse401 | str
]:
"""Submit results for the match's current round
`round` must equal the match's current round (`Matsch.cRound()`), otherwise the request is rejected.
`results` maps a MatschHasPlayerOrTeam pk (string key) to that participant's score for the round
(omitted participants default to 0 if `usePoints`, else 1). Advances/finishes the match and pushes
live updates.
Args:
pk (int):
body (AandtApiMatchSubmitResultsBody):
Raises:
errors.UnexpectedStatus: If the server 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[AandtApiMatchSubmitResultsResponse200 | AandtApiMatchSubmitResultsResponse401 | str]
"""
kwargs = _get_kwargs(
pk=pk,
body=body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
pk: int,
*,
client: AuthenticatedClient | Client,
body: AandtApiMatchSubmitResultsBody,
) -> (
AandtApiMatchSubmitResultsResponse200
| AandtApiMatchSubmitResultsResponse401
| str
| None
):
"""Submit results for the match's current round
`round` must equal the match's current round (`Matsch.cRound()`), otherwise the request is rejected.
`results` maps a MatschHasPlayerOrTeam pk (string key) to that participant's score for the round
(omitted participants default to 0 if `usePoints`, else 1). Advances/finishes the match and pushes
live updates.
Args:
pk (int):
body (AandtApiMatchSubmitResultsBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
AandtApiMatchSubmitResultsResponse200 | AandtApiMatchSubmitResultsResponse401 | str
"""
return sync_detailed(
pk=pk,
client=client,
body=body,
).parsed
async def asyncio_detailed(
pk: int,
*,
client: AuthenticatedClient | Client,
body: AandtApiMatchSubmitResultsBody,
) -> Response[
AandtApiMatchSubmitResultsResponse200 | AandtApiMatchSubmitResultsResponse401 | str
]:
"""Submit results for the match's current round
`round` must equal the match's current round (`Matsch.cRound()`), otherwise the request is rejected.
`results` maps a MatschHasPlayerOrTeam pk (string key) to that participant's score for the round
(omitted participants default to 0 if `usePoints`, else 1). Advances/finishes the match and pushes
live updates.
Args:
pk (int):
body (AandtApiMatchSubmitResultsBody):
Raises:
errors.UnexpectedStatus: If the server 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[AandtApiMatchSubmitResultsResponse200 | AandtApiMatchSubmitResultsResponse401 | str]
"""
kwargs = _get_kwargs(
pk=pk,
body=body,
)
response = await client.get_async_httpx_client().request(**kwargs)
return _build_response(client=client, response=response)
async def asyncio(
pk: int,
*,
client: AuthenticatedClient | Client,
body: AandtApiMatchSubmitResultsBody,
) -> (
AandtApiMatchSubmitResultsResponse200
| AandtApiMatchSubmitResultsResponse401
| str
| None
):
"""Submit results for the match's current round
`round` must equal the match's current round (`Matsch.cRound()`), otherwise the request is rejected.
`results` maps a MatschHasPlayerOrTeam pk (string key) to that participant's score for the round
(omitted participants default to 0 if `usePoints`, else 1). Advances/finishes the match and pushes
live updates.
Args:
pk (int):
body (AandtApiMatchSubmitResultsBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
AandtApiMatchSubmitResultsResponse200 | AandtApiMatchSubmitResultsResponse401 | str
"""
return (
await asyncio_detailed(
pk=pk,
client=client,
body=body,
)
).parsed
@@ -0,0 +1,134 @@
from http import HTTPStatus
from typing import Any
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.aandt_api_matches_response_200 import AandtApiMatchesResponse200
from ...models.aandt_api_matches_response_401 import AandtApiMatchesResponse401
from ...types import Response
def _get_kwargs() -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": "/matches",
}
return _kwargs
def _parse_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> AandtApiMatchesResponse200 | AandtApiMatchesResponse401 | None:
if response.status_code == 200:
response_200 = AandtApiMatchesResponse200.from_dict(response.json())
return response_200
if response.status_code == 401:
response_401 = AandtApiMatchesResponse401.from_dict(response.text)
return response_401
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> Response[AandtApiMatchesResponse200 | AandtApiMatchesResponse401]:
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 | Client,
) -> Response[AandtApiMatchesResponse200 | AandtApiMatchesResponse401]:
"""List all matches of the AAndT with their rounds/results
Raises:
errors.UnexpectedStatus: If the server 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[AandtApiMatchesResponse200 | AandtApiMatchesResponse401]
"""
kwargs = _get_kwargs()
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
*,
client: AuthenticatedClient | Client,
) -> AandtApiMatchesResponse200 | AandtApiMatchesResponse401 | None:
"""List all matches of the AAndT with their rounds/results
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
AandtApiMatchesResponse200 | AandtApiMatchesResponse401
"""
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient | Client,
) -> Response[AandtApiMatchesResponse200 | AandtApiMatchesResponse401]:
"""List all matches of the AAndT with their rounds/results
Raises:
errors.UnexpectedStatus: If the server 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[AandtApiMatchesResponse200 | AandtApiMatchesResponse401]
"""
kwargs = _get_kwargs()
response = await client.get_async_httpx_client().request(**kwargs)
return _build_response(client=client, response=response)
async def asyncio(
*,
client: AuthenticatedClient | Client,
) -> AandtApiMatchesResponse200 | AandtApiMatchesResponse401 | None:
"""List all matches of the AAndT with their rounds/results
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
AandtApiMatchesResponse200 | AandtApiMatchesResponse401
"""
return (
await asyncio_detailed(
client=client,
)
).parsed
@@ -0,0 +1,134 @@
from http import HTTPStatus
from typing import Any
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.aandt_api_members_response_200 import AandtApiMembersResponse200
from ...models.aandt_api_members_response_401 import AandtApiMembersResponse401
from ...types import Response
def _get_kwargs() -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": "/members",
}
return _kwargs
def _parse_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> AandtApiMembersResponse200 | AandtApiMembersResponse401 | None:
if response.status_code == 200:
response_200 = AandtApiMembersResponse200.from_dict(response.json())
return response_200
if response.status_code == 401:
response_401 = AandtApiMembersResponse401.from_dict(response.text)
return response_401
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> Response[AandtApiMembersResponse200 | AandtApiMembersResponse401]:
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 | Client,
) -> Response[AandtApiMembersResponse200 | AandtApiMembersResponse401]:
"""List the AAndT's registered members (users or teams)
Raises:
errors.UnexpectedStatus: If the server 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[AandtApiMembersResponse200 | AandtApiMembersResponse401]
"""
kwargs = _get_kwargs()
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
*,
client: AuthenticatedClient | Client,
) -> AandtApiMembersResponse200 | AandtApiMembersResponse401 | None:
"""List the AAndT's registered members (users or teams)
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
AandtApiMembersResponse200 | AandtApiMembersResponse401
"""
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient | Client,
) -> Response[AandtApiMembersResponse200 | AandtApiMembersResponse401]:
"""List the AAndT's registered members (users or teams)
Raises:
errors.UnexpectedStatus: If the server 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[AandtApiMembersResponse200 | AandtApiMembersResponse401]
"""
kwargs = _get_kwargs()
response = await client.get_async_httpx_client().request(**kwargs)
return _build_response(client=client, response=response)
async def asyncio(
*,
client: AuthenticatedClient | Client,
) -> AandtApiMembersResponse200 | AandtApiMembersResponse401 | None:
"""List the AAndT's registered members (users or teams)
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
AandtApiMembersResponse200 | AandtApiMembersResponse401
"""
return (
await asyncio_detailed(
client=client,
)
).parsed
@@ -0,0 +1,134 @@
from http import HTTPStatus
from typing import Any
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.aandt_api_message_get_response_200 import AandtApiMessageGetResponse200
from ...models.aandt_api_message_get_response_401 import AandtApiMessageGetResponse401
from ...types import Response
def _get_kwargs() -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": "/message",
}
return _kwargs
def _parse_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> AandtApiMessageGetResponse200 | AandtApiMessageGetResponse401 | None:
if response.status_code == 200:
response_200 = AandtApiMessageGetResponse200.from_dict(response.json())
return response_200
if response.status_code == 401:
response_401 = AandtApiMessageGetResponse401.from_dict(response.text)
return response_401
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> Response[AandtApiMessageGetResponse200 | AandtApiMessageGetResponse401]:
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 | Client,
) -> Response[AandtApiMessageGetResponse200 | AandtApiMessageGetResponse401]:
"""Get the AAndT's apibot page message
Raises:
errors.UnexpectedStatus: If the server 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[AandtApiMessageGetResponse200 | AandtApiMessageGetResponse401]
"""
kwargs = _get_kwargs()
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
*,
client: AuthenticatedClient | Client,
) -> AandtApiMessageGetResponse200 | AandtApiMessageGetResponse401 | None:
"""Get the AAndT's apibot page message
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
AandtApiMessageGetResponse200 | AandtApiMessageGetResponse401
"""
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient | Client,
) -> Response[AandtApiMessageGetResponse200 | AandtApiMessageGetResponse401]:
"""Get the AAndT's apibot page message
Raises:
errors.UnexpectedStatus: If the server 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[AandtApiMessageGetResponse200 | AandtApiMessageGetResponse401]
"""
kwargs = _get_kwargs()
response = await client.get_async_httpx_client().request(**kwargs)
return _build_response(client=client, response=response)
async def asyncio(
*,
client: AuthenticatedClient | Client,
) -> AandtApiMessageGetResponse200 | AandtApiMessageGetResponse401 | None:
"""Get the AAndT's apibot page message
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
AandtApiMessageGetResponse200 | AandtApiMessageGetResponse401
"""
return (
await asyncio_detailed(
client=client,
)
).parsed
@@ -0,0 +1,174 @@
from http import HTTPStatus
from typing import Any
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.aandt_api_message_set_body import AandtApiMessageSetBody
from ...models.aandt_api_message_set_response_401 import AandtApiMessageSetResponse401
from ...models.success_response import SuccessResponse
from ...types import Response
def _get_kwargs(
*,
body: AandtApiMessageSetBody,
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": "/message",
}
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
_kwargs["headers"] = headers
return _kwargs
def _parse_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> AandtApiMessageSetResponse401 | SuccessResponse | None:
if response.status_code == 200:
response_200 = SuccessResponse.from_dict(response.json())
return response_200
if response.status_code == 401:
response_401 = AandtApiMessageSetResponse401.from_dict(response.text)
return response_401
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> Response[AandtApiMessageSetResponse401 | SuccessResponse]:
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 | Client,
body: AandtApiMessageSetBody,
) -> Response[AandtApiMessageSetResponse401 | SuccessResponse]:
"""Set the AAndT's apibot page message
Broadcasts the update over Zuperpush after saving.
Args:
body (AandtApiMessageSetBody):
Raises:
errors.UnexpectedStatus: If the server 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[AandtApiMessageSetResponse401 | SuccessResponse]
"""
kwargs = _get_kwargs(
body=body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
*,
client: AuthenticatedClient | Client,
body: AandtApiMessageSetBody,
) -> AandtApiMessageSetResponse401 | SuccessResponse | None:
"""Set the AAndT's apibot page message
Broadcasts the update over Zuperpush after saving.
Args:
body (AandtApiMessageSetBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
AandtApiMessageSetResponse401 | SuccessResponse
"""
return sync_detailed(
client=client,
body=body,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient | Client,
body: AandtApiMessageSetBody,
) -> Response[AandtApiMessageSetResponse401 | SuccessResponse]:
"""Set the AAndT's apibot page message
Broadcasts the update over Zuperpush after saving.
Args:
body (AandtApiMessageSetBody):
Raises:
errors.UnexpectedStatus: If the server 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[AandtApiMessageSetResponse401 | SuccessResponse]
"""
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 | Client,
body: AandtApiMessageSetBody,
) -> AandtApiMessageSetResponse401 | SuccessResponse | None:
"""Set the AAndT's apibot page message
Broadcasts the update over Zuperpush after saving.
Args:
body (AandtApiMessageSetBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
AandtApiMessageSetResponse401 | SuccessResponse
"""
return (
await asyncio_detailed(
client=client,
body=body,
)
).parsed
@@ -0,0 +1,134 @@
from http import HTTPStatus
from typing import Any
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.aandt_api_metadata_get_response_200 import AandtApiMetadataGetResponse200
from ...models.aandt_api_metadata_get_response_401 import AandtApiMetadataGetResponse401
from ...types import Response
def _get_kwargs() -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": "/metadata",
}
return _kwargs
def _parse_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> AandtApiMetadataGetResponse200 | AandtApiMetadataGetResponse401 | None:
if response.status_code == 200:
response_200 = AandtApiMetadataGetResponse200.from_dict(response.json())
return response_200
if response.status_code == 401:
response_401 = AandtApiMetadataGetResponse401.from_dict(response.text)
return response_401
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> Response[AandtApiMetadataGetResponse200 | AandtApiMetadataGetResponse401]:
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 | Client,
) -> Response[AandtApiMetadataGetResponse200 | AandtApiMetadataGetResponse401]:
"""Get the AAndT's bot metadata
Raises:
errors.UnexpectedStatus: If the server 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[AandtApiMetadataGetResponse200 | AandtApiMetadataGetResponse401]
"""
kwargs = _get_kwargs()
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
*,
client: AuthenticatedClient | Client,
) -> AandtApiMetadataGetResponse200 | AandtApiMetadataGetResponse401 | None:
"""Get the AAndT's bot metadata
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
AandtApiMetadataGetResponse200 | AandtApiMetadataGetResponse401
"""
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient | Client,
) -> Response[AandtApiMetadataGetResponse200 | AandtApiMetadataGetResponse401]:
"""Get the AAndT's bot metadata
Raises:
errors.UnexpectedStatus: If the server 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[AandtApiMetadataGetResponse200 | AandtApiMetadataGetResponse401]
"""
kwargs = _get_kwargs()
response = await client.get_async_httpx_client().request(**kwargs)
return _build_response(client=client, response=response)
async def asyncio(
*,
client: AuthenticatedClient | Client,
) -> AandtApiMetadataGetResponse200 | AandtApiMetadataGetResponse401 | None:
"""Get the AAndT's bot metadata
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
AandtApiMetadataGetResponse200 | AandtApiMetadataGetResponse401
"""
return (
await asyncio_detailed(
client=client,
)
).parsed
@@ -0,0 +1,166 @@
from http import HTTPStatus
from typing import Any
import httpx
from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.aandt_api_metadata_set_body import AandtApiMetadataSetBody
from ...models.aandt_api_metadata_set_response_401 import AandtApiMetadataSetResponse401
from ...models.success_response import SuccessResponse
from ...types import Response
def _get_kwargs(
*,
body: AandtApiMetadataSetBody,
) -> dict[str, Any]:
headers: dict[str, Any] = {}
_kwargs: dict[str, Any] = {
"method": "post",
"url": "/metadata",
}
_kwargs["json"] = body.to_dict()
headers["Content-Type"] = "application/json"
_kwargs["headers"] = headers
return _kwargs
def _parse_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> AandtApiMetadataSetResponse401 | SuccessResponse | None:
if response.status_code == 200:
response_200 = SuccessResponse.from_dict(response.json())
return response_200
if response.status_code == 401:
response_401 = AandtApiMetadataSetResponse401.from_dict(response.text)
return response_401
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None
def _build_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> Response[AandtApiMetadataSetResponse401 | SuccessResponse]:
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 | Client,
body: AandtApiMetadataSetBody,
) -> Response[AandtApiMetadataSetResponse401 | SuccessResponse]:
"""Set the AAndT's bot metadata
Args:
body (AandtApiMetadataSetBody):
Raises:
errors.UnexpectedStatus: If the server 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[AandtApiMetadataSetResponse401 | SuccessResponse]
"""
kwargs = _get_kwargs(
body=body,
)
response = client.get_httpx_client().request(
**kwargs,
)
return _build_response(client=client, response=response)
def sync(
*,
client: AuthenticatedClient | Client,
body: AandtApiMetadataSetBody,
) -> AandtApiMetadataSetResponse401 | SuccessResponse | None:
"""Set the AAndT's bot metadata
Args:
body (AandtApiMetadataSetBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
AandtApiMetadataSetResponse401 | SuccessResponse
"""
return sync_detailed(
client=client,
body=body,
).parsed
async def asyncio_detailed(
*,
client: AuthenticatedClient | Client,
body: AandtApiMetadataSetBody,
) -> Response[AandtApiMetadataSetResponse401 | SuccessResponse]:
"""Set the AAndT's bot metadata
Args:
body (AandtApiMetadataSetBody):
Raises:
errors.UnexpectedStatus: If the server 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[AandtApiMetadataSetResponse401 | SuccessResponse]
"""
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 | Client,
body: AandtApiMetadataSetBody,
) -> AandtApiMetadataSetResponse401 | SuccessResponse | None:
"""Set the AAndT's bot metadata
Args:
body (AandtApiMetadataSetBody):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
AandtApiMetadataSetResponse401 | SuccessResponse
"""
return (
await asyncio_detailed(
client=client,
body=body,
)
).parsed