Skip to content

Commit b4def04

Browse files
committed
proto and version bump
1 parent 6ceb9e1 commit b4def04

File tree

14 files changed

+854
-1
lines changed

14 files changed

+854
-1
lines changed

fishjam/_openapi_client/api/default/__init__.py

Whitespace-only changes.
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
from http import HTTPStatus
2+
from typing import Any, Dict, Optional, Union, cast
3+
4+
import httpx
5+
6+
from ... import errors
7+
from ...client import AuthenticatedClient, Client
8+
from ...models.error import Error
9+
from ...types import Response
10+
11+
12+
def _get_kwargs() -> Dict[str, Any]:
13+
return {
14+
"method": "post",
15+
"url": "/admin/shutdown/drain",
16+
}
17+
18+
19+
def _parse_response(
20+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
21+
) -> Optional[Union[Any, Error]]:
22+
if response.status_code == HTTPStatus.OK:
23+
response_200 = cast(Any, None)
24+
return response_200
25+
if response.status_code == HTTPStatus.UNAUTHORIZED:
26+
response_401 = Error.from_dict(response.json())
27+
28+
return response_401
29+
if client.raise_on_unexpected_status:
30+
raise errors.UnexpectedStatus(response.status_code, response.content)
31+
else:
32+
return None
33+
34+
35+
def _build_response(
36+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
37+
) -> Response[Union[Any, Error]]:
38+
return Response(
39+
status_code=HTTPStatus(response.status_code),
40+
content=response.content,
41+
headers=response.headers,
42+
parsed=_parse_response(client=client, response=response),
43+
)
44+
45+
46+
def sync_detailed(
47+
*,
48+
client: AuthenticatedClient,
49+
) -> Response[Union[Any, Error]]:
50+
"""Marks node as draining, making it the last in the load balancing order.
51+
52+
Raises:
53+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
54+
httpx.TimeoutException: If the request takes longer than Client.timeout.
55+
56+
Returns:
57+
Response[Union[Any, Error]]
58+
"""
59+
60+
kwargs = _get_kwargs()
61+
62+
response = client.get_httpx_client().request(
63+
**kwargs,
64+
)
65+
66+
return _build_response(client=client, response=response)
67+
68+
69+
def sync(
70+
*,
71+
client: AuthenticatedClient,
72+
) -> Optional[Union[Any, Error]]:
73+
"""Marks node as draining, making it the last in the load balancing order.
74+
75+
Raises:
76+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
77+
httpx.TimeoutException: If the request takes longer than Client.timeout.
78+
79+
Returns:
80+
Union[Any, Error]
81+
"""
82+
83+
return sync_detailed(
84+
client=client,
85+
).parsed
86+
87+
88+
async def asyncio_detailed(
89+
*,
90+
client: AuthenticatedClient,
91+
) -> Response[Union[Any, Error]]:
92+
"""Marks node as draining, making it the last in the load balancing order.
93+
94+
Raises:
95+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
96+
httpx.TimeoutException: If the request takes longer than Client.timeout.
97+
98+
Returns:
99+
Response[Union[Any, Error]]
100+
"""
101+
102+
kwargs = _get_kwargs()
103+
104+
response = await client.get_async_httpx_client().request(**kwargs)
105+
106+
return _build_response(client=client, response=response)
107+
108+
109+
async def asyncio(
110+
*,
111+
client: AuthenticatedClient,
112+
) -> Optional[Union[Any, Error]]:
113+
"""Marks node as draining, making it the last in the load balancing order.
114+
115+
Raises:
116+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
117+
httpx.TimeoutException: If the request takes longer than Client.timeout.
118+
119+
Returns:
120+
Union[Any, Error]
121+
"""
122+
123+
return (
124+
await asyncio_detailed(
125+
client=client,
126+
)
127+
).parsed
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
from http import HTTPStatus
2+
from typing import Any, Dict, Optional, Union
3+
4+
import httpx
5+
6+
from ... import errors
7+
from ...client import AuthenticatedClient, Client
8+
from ...models.error import Error
9+
from ...models.shutdown_status_response import ShutdownStatusResponse
10+
from ...types import Response
11+
12+
13+
def _get_kwargs() -> Dict[str, Any]:
14+
return {
15+
"method": "get",
16+
"url": "/admin/shutdown/status",
17+
}
18+
19+
20+
def _parse_response(
21+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
22+
) -> Optional[Union[Error, ShutdownStatusResponse]]:
23+
if response.status_code == HTTPStatus.OK:
24+
response_200 = ShutdownStatusResponse.from_dict(response.json())
25+
26+
return response_200
27+
if response.status_code == HTTPStatus.UNAUTHORIZED:
28+
response_401 = Error.from_dict(response.json())
29+
30+
return response_401
31+
if client.raise_on_unexpected_status:
32+
raise errors.UnexpectedStatus(response.status_code, response.content)
33+
else:
34+
return None
35+
36+
37+
def _build_response(
38+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
39+
) -> Response[Union[Error, ShutdownStatusResponse]]:
40+
return Response(
41+
status_code=HTTPStatus(response.status_code),
42+
content=response.content,
43+
headers=response.headers,
44+
parsed=_parse_response(client=client, response=response),
45+
)
46+
47+
48+
def sync_detailed(
49+
*,
50+
client: AuthenticatedClient,
51+
) -> Response[Union[Error, ShutdownStatusResponse]]:
52+
"""Returns status information for the shutdown process of Fishjam.
53+
54+
Raises:
55+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
56+
httpx.TimeoutException: If the request takes longer than Client.timeout.
57+
58+
Returns:
59+
Response[Union[Error, ShutdownStatusResponse]]
60+
"""
61+
62+
kwargs = _get_kwargs()
63+
64+
response = client.get_httpx_client().request(
65+
**kwargs,
66+
)
67+
68+
return _build_response(client=client, response=response)
69+
70+
71+
def sync(
72+
*,
73+
client: AuthenticatedClient,
74+
) -> Optional[Union[Error, ShutdownStatusResponse]]:
75+
"""Returns status information for the shutdown process of Fishjam.
76+
77+
Raises:
78+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
79+
httpx.TimeoutException: If the request takes longer than Client.timeout.
80+
81+
Returns:
82+
Union[Error, ShutdownStatusResponse]
83+
"""
84+
85+
return sync_detailed(
86+
client=client,
87+
).parsed
88+
89+
90+
async def asyncio_detailed(
91+
*,
92+
client: AuthenticatedClient,
93+
) -> Response[Union[Error, ShutdownStatusResponse]]:
94+
"""Returns status information for the shutdown process of Fishjam.
95+
96+
Raises:
97+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
98+
httpx.TimeoutException: If the request takes longer than Client.timeout.
99+
100+
Returns:
101+
Response[Union[Error, ShutdownStatusResponse]]
102+
"""
103+
104+
kwargs = _get_kwargs()
105+
106+
response = await client.get_async_httpx_client().request(**kwargs)
107+
108+
return _build_response(client=client, response=response)
109+
110+
111+
async def asyncio(
112+
*,
113+
client: AuthenticatedClient,
114+
) -> Optional[Union[Error, ShutdownStatusResponse]]:
115+
"""Returns status information for the shutdown process of Fishjam.
116+
117+
Raises:
118+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
119+
httpx.TimeoutException: If the request takes longer than Client.timeout.
120+
121+
Returns:
122+
Union[Error, ShutdownStatusResponse]
123+
"""
124+
125+
return (
126+
await asyncio_detailed(
127+
client=client,
128+
)
129+
).parsed

fishjam/_openapi_client/api/health/__init__.py

Whitespace-only changes.
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
from http import HTTPStatus
2+
from typing import Any, Dict, Optional, Union
3+
4+
import httpx
5+
6+
from ... import errors
7+
from ...client import AuthenticatedClient, Client
8+
from ...models.error import Error
9+
from ...models.healthcheck_response import HealthcheckResponse
10+
from ...types import Response
11+
12+
13+
def _get_kwargs() -> Dict[str, Any]:
14+
return {
15+
"method": "get",
16+
"url": "/admin/health",
17+
}
18+
19+
20+
def _parse_response(
21+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
22+
) -> Optional[Union[Error, HealthcheckResponse]]:
23+
if response.status_code == HTTPStatus.OK:
24+
response_200 = HealthcheckResponse.from_dict(response.json())
25+
26+
return response_200
27+
if response.status_code == HTTPStatus.UNAUTHORIZED:
28+
response_401 = Error.from_dict(response.json())
29+
30+
return response_401
31+
if client.raise_on_unexpected_status:
32+
raise errors.UnexpectedStatus(response.status_code, response.content)
33+
else:
34+
return None
35+
36+
37+
def _build_response(
38+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
39+
) -> Response[Union[Error, HealthcheckResponse]]:
40+
return Response(
41+
status_code=HTTPStatus(response.status_code),
42+
content=response.content,
43+
headers=response.headers,
44+
parsed=_parse_response(client=client, response=response),
45+
)
46+
47+
48+
def sync_detailed(
49+
*,
50+
client: AuthenticatedClient,
51+
) -> Response[Union[Error, HealthcheckResponse]]:
52+
"""Describes the health of Fishjam
53+
54+
Raises:
55+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
56+
httpx.TimeoutException: If the request takes longer than Client.timeout.
57+
58+
Returns:
59+
Response[Union[Error, HealthcheckResponse]]
60+
"""
61+
62+
kwargs = _get_kwargs()
63+
64+
response = client.get_httpx_client().request(
65+
**kwargs,
66+
)
67+
68+
return _build_response(client=client, response=response)
69+
70+
71+
def sync(
72+
*,
73+
client: AuthenticatedClient,
74+
) -> Optional[Union[Error, HealthcheckResponse]]:
75+
"""Describes the health of Fishjam
76+
77+
Raises:
78+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
79+
httpx.TimeoutException: If the request takes longer than Client.timeout.
80+
81+
Returns:
82+
Union[Error, HealthcheckResponse]
83+
"""
84+
85+
return sync_detailed(
86+
client=client,
87+
).parsed
88+
89+
90+
async def asyncio_detailed(
91+
*,
92+
client: AuthenticatedClient,
93+
) -> Response[Union[Error, HealthcheckResponse]]:
94+
"""Describes the health of Fishjam
95+
96+
Raises:
97+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
98+
httpx.TimeoutException: If the request takes longer than Client.timeout.
99+
100+
Returns:
101+
Response[Union[Error, HealthcheckResponse]]
102+
"""
103+
104+
kwargs = _get_kwargs()
105+
106+
response = await client.get_async_httpx_client().request(**kwargs)
107+
108+
return _build_response(client=client, response=response)
109+
110+
111+
async def asyncio(
112+
*,
113+
client: AuthenticatedClient,
114+
) -> Optional[Union[Error, HealthcheckResponse]]:
115+
"""Describes the health of Fishjam
116+
117+
Raises:
118+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
119+
httpx.TimeoutException: If the request takes longer than Client.timeout.
120+
121+
Returns:
122+
Union[Error, HealthcheckResponse]
123+
"""
124+
125+
return (
126+
await asyncio_detailed(
127+
client=client,
128+
)
129+
).parsed

fishjam/_openapi_client/api/user/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)