dungeoncoder 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dungeoncoder/__init__.py +4 -0
- dungeoncoder/__main__.py +254 -0
- dungeoncoder/_api_config.py +6 -0
- dungeoncoder/_generated/__init__.py +8 -0
- dungeoncoder/_generated/api/__init__.py +1 -0
- dungeoncoder/_generated/api/game/__init__.py +1 -0
- dungeoncoder/_generated/api/game/get_statistics.py +158 -0
- dungeoncoder/_generated/api/game/get_version.py +166 -0
- dungeoncoder/_generated/api/hero/__init__.py +1 -0
- dungeoncoder/_generated/api/hero/ask_oracle.py +192 -0
- dungeoncoder/_generated/api/hero/configure.py +207 -0
- dungeoncoder/_generated/api/hero/drop.py +207 -0
- dungeoncoder/_generated/api/hero/get_inventory.py +188 -0
- dungeoncoder/_generated/api/hero/get_items_at_position.py +188 -0
- dungeoncoder/_generated/api/hero/interact.py +188 -0
- dungeoncoder/_generated/api/hero/is_abyss_in_front.py +188 -0
- dungeoncoder/_generated/api/hero/is_at_goal.py +192 -0
- dungeoncoder/_generated/api/hero/is_collision_in_front.py +188 -0
- dungeoncoder/_generated/api/hero/is_enemy_in_front.py +188 -0
- dungeoncoder/_generated/api/hero/is_facing_north.py +188 -0
- dungeoncoder/_generated/api/hero/is_switch_in_front.py +188 -0
- dungeoncoder/_generated/api/hero/is_torch_in_front.py +188 -0
- dungeoncoder/_generated/api/hero/move.py +188 -0
- dungeoncoder/_generated/api/hero/peek_item_value.py +211 -0
- dungeoncoder/_generated/api/hero/pickup.py +207 -0
- dungeoncoder/_generated/api/hero/read_item_value.py +188 -0
- dungeoncoder/_generated/api/hero/sense_goal.py +192 -0
- dungeoncoder/_generated/api/hero/set_pace.py +207 -0
- dungeoncoder/_generated/api/hero/turn_left.py +188 -0
- dungeoncoder/_generated/api/level/__init__.py +1 -0
- dungeoncoder/_generated/api/level/load_level.py +190 -0
- dungeoncoder/_generated/api/level/reset_level.py +158 -0
- dungeoncoder/_generated/client.py +271 -0
- dungeoncoder/_generated/errors.py +14 -0
- dungeoncoder/_generated/models/__init__.py +47 -0
- dungeoncoder/_generated/models/api_error_response.py +98 -0
- dungeoncoder/_generated/models/api_error_response_status.py +7 -0
- dungeoncoder/_generated/models/boolean_result.py +96 -0
- dungeoncoder/_generated/models/boolean_result_status.py +7 -0
- dungeoncoder/_generated/models/configure_params.py +84 -0
- dungeoncoder/_generated/models/distance_param.py +76 -0
- dungeoncoder/_generated/models/name_param.py +76 -0
- dungeoncoder/_generated/models/nullable_integer_result.py +104 -0
- dungeoncoder/_generated/models/nullable_integer_result_status.py +7 -0
- dungeoncoder/_generated/models/nullable_string_result.py +104 -0
- dungeoncoder/_generated/models/nullable_string_result_status.py +7 -0
- dungeoncoder/_generated/models/pace_params.py +76 -0
- dungeoncoder/_generated/models/statistics.py +217 -0
- dungeoncoder/_generated/models/statistics_result.py +104 -0
- dungeoncoder/_generated/models/statistics_result_status.py +7 -0
- dungeoncoder/_generated/models/string_array_result.py +100 -0
- dungeoncoder/_generated/models/string_array_result_status.py +7 -0
- dungeoncoder/_generated/models/tiled_level.py +67 -0
- dungeoncoder/_generated/models/version_result.py +104 -0
- dungeoncoder/_generated/models/version_result_result.py +84 -0
- dungeoncoder/_generated/models/version_result_status.py +7 -0
- dungeoncoder/_generated/types.py +53 -0
- dungeoncoder/asciimap.py +824 -0
- dungeoncoder/dungeoncoder.py +482 -0
- dungeoncoder/generator.py +213 -0
- dungeoncoder/packs/gelaende.json +1 -0
- dungeoncoder/packs/items.json +67 -0
- dungeoncoder/packs/station.json +1 -0
- dungeoncoder/packs/studio.json +1 -0
- dungeoncoder/packs/tilesets.json +1 -0
- dungeoncoder/packs/werkstatt.json +1 -0
- dungeoncoder/replay.py +80 -0
- dungeoncoder/requirements.txt +2 -0
- dungeoncoder/sim.py +792 -0
- dungeoncoder/testing.py +63 -0
- dungeoncoder/trace.py +92 -0
- dungeoncoder/variants.py +112 -0
- dungeoncoder-0.2.0.dist-info/METADATA +37 -0
- dungeoncoder-0.2.0.dist-info/RECORD +77 -0
- dungeoncoder-0.2.0.dist-info/WHEEL +5 -0
- dungeoncoder-0.2.0.dist-info/licenses/LICENSE.txt +25 -0
- dungeoncoder-0.2.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, cast
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...types import Response, UNSET
|
|
9
|
+
from ... import errors
|
|
10
|
+
|
|
11
|
+
from ...models.api_error_response import ApiErrorResponse
|
|
12
|
+
from ...models.boolean_result import BooleanResult
|
|
13
|
+
from ...types import UNSET, Unset
|
|
14
|
+
from typing import cast
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def _get_kwargs(
|
|
19
|
+
*,
|
|
20
|
+
hero: int | Unset = UNSET,
|
|
21
|
+
|
|
22
|
+
) -> dict[str, Any]:
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
params: dict[str, Any] = {}
|
|
28
|
+
|
|
29
|
+
params["hero"] = hero
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
_kwargs: dict[str, Any] = {
|
|
36
|
+
"method": "get",
|
|
37
|
+
"url": "/hero/is_enemy_in_front",
|
|
38
|
+
"params": params,
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
return _kwargs
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> ApiErrorResponse | BooleanResult | None:
|
|
47
|
+
if response.status_code == 200:
|
|
48
|
+
response_200 = BooleanResult.from_dict(response.json())
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
return response_200
|
|
53
|
+
|
|
54
|
+
if response.status_code == 500:
|
|
55
|
+
response_500 = ApiErrorResponse.from_dict(response.json())
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
return response_500
|
|
60
|
+
|
|
61
|
+
if client.raise_on_unexpected_status:
|
|
62
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
63
|
+
else:
|
|
64
|
+
return None
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[ApiErrorResponse | BooleanResult]:
|
|
68
|
+
return Response(
|
|
69
|
+
status_code=HTTPStatus(response.status_code),
|
|
70
|
+
content=response.content,
|
|
71
|
+
headers=response.headers,
|
|
72
|
+
parsed=_parse_response(client=client, response=response),
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def sync_detailed(
|
|
77
|
+
*,
|
|
78
|
+
client: AuthenticatedClient | Client,
|
|
79
|
+
hero: int | Unset = UNSET,
|
|
80
|
+
|
|
81
|
+
) -> Response[ApiErrorResponse | BooleanResult]:
|
|
82
|
+
""" Whether a guard stands on the tile in front of the hero.
|
|
83
|
+
|
|
84
|
+
Args:
|
|
85
|
+
hero (int | Unset):
|
|
86
|
+
|
|
87
|
+
Raises:
|
|
88
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
89
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
90
|
+
|
|
91
|
+
Returns:
|
|
92
|
+
Response[ApiErrorResponse | BooleanResult]
|
|
93
|
+
"""
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
kwargs = _get_kwargs(
|
|
97
|
+
hero=hero,
|
|
98
|
+
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
response = client.get_httpx_client().request(
|
|
102
|
+
**kwargs,
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
return _build_response(client=client, response=response)
|
|
106
|
+
|
|
107
|
+
def sync(
|
|
108
|
+
*,
|
|
109
|
+
client: AuthenticatedClient | Client,
|
|
110
|
+
hero: int | Unset = UNSET,
|
|
111
|
+
|
|
112
|
+
) -> ApiErrorResponse | BooleanResult | None:
|
|
113
|
+
""" Whether a guard stands on the tile in front of the hero.
|
|
114
|
+
|
|
115
|
+
Args:
|
|
116
|
+
hero (int | Unset):
|
|
117
|
+
|
|
118
|
+
Raises:
|
|
119
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
120
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
121
|
+
|
|
122
|
+
Returns:
|
|
123
|
+
ApiErrorResponse | BooleanResult
|
|
124
|
+
"""
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
return sync_detailed(
|
|
128
|
+
client=client,
|
|
129
|
+
hero=hero,
|
|
130
|
+
|
|
131
|
+
).parsed
|
|
132
|
+
|
|
133
|
+
async def asyncio_detailed(
|
|
134
|
+
*,
|
|
135
|
+
client: AuthenticatedClient | Client,
|
|
136
|
+
hero: int | Unset = UNSET,
|
|
137
|
+
|
|
138
|
+
) -> Response[ApiErrorResponse | BooleanResult]:
|
|
139
|
+
""" Whether a guard stands on the tile in front of the hero.
|
|
140
|
+
|
|
141
|
+
Args:
|
|
142
|
+
hero (int | Unset):
|
|
143
|
+
|
|
144
|
+
Raises:
|
|
145
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
146
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
147
|
+
|
|
148
|
+
Returns:
|
|
149
|
+
Response[ApiErrorResponse | BooleanResult]
|
|
150
|
+
"""
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
kwargs = _get_kwargs(
|
|
154
|
+
hero=hero,
|
|
155
|
+
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
response = await client.get_async_httpx_client().request(
|
|
159
|
+
**kwargs
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
return _build_response(client=client, response=response)
|
|
163
|
+
|
|
164
|
+
async def asyncio(
|
|
165
|
+
*,
|
|
166
|
+
client: AuthenticatedClient | Client,
|
|
167
|
+
hero: int | Unset = UNSET,
|
|
168
|
+
|
|
169
|
+
) -> ApiErrorResponse | BooleanResult | None:
|
|
170
|
+
""" Whether a guard stands on the tile in front of the hero.
|
|
171
|
+
|
|
172
|
+
Args:
|
|
173
|
+
hero (int | Unset):
|
|
174
|
+
|
|
175
|
+
Raises:
|
|
176
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
177
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
178
|
+
|
|
179
|
+
Returns:
|
|
180
|
+
ApiErrorResponse | BooleanResult
|
|
181
|
+
"""
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
return (await asyncio_detailed(
|
|
185
|
+
client=client,
|
|
186
|
+
hero=hero,
|
|
187
|
+
|
|
188
|
+
)).parsed
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, cast
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...types import Response, UNSET
|
|
9
|
+
from ... import errors
|
|
10
|
+
|
|
11
|
+
from ...models.api_error_response import ApiErrorResponse
|
|
12
|
+
from ...models.boolean_result import BooleanResult
|
|
13
|
+
from ...types import UNSET, Unset
|
|
14
|
+
from typing import cast
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def _get_kwargs(
|
|
19
|
+
*,
|
|
20
|
+
hero: int | Unset = UNSET,
|
|
21
|
+
|
|
22
|
+
) -> dict[str, Any]:
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
params: dict[str, Any] = {}
|
|
28
|
+
|
|
29
|
+
params["hero"] = hero
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
_kwargs: dict[str, Any] = {
|
|
36
|
+
"method": "get",
|
|
37
|
+
"url": "/hero/is_facing_north",
|
|
38
|
+
"params": params,
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
return _kwargs
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> ApiErrorResponse | BooleanResult | None:
|
|
47
|
+
if response.status_code == 200:
|
|
48
|
+
response_200 = BooleanResult.from_dict(response.json())
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
return response_200
|
|
53
|
+
|
|
54
|
+
if response.status_code == 500:
|
|
55
|
+
response_500 = ApiErrorResponse.from_dict(response.json())
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
return response_500
|
|
60
|
+
|
|
61
|
+
if client.raise_on_unexpected_status:
|
|
62
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
63
|
+
else:
|
|
64
|
+
return None
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[ApiErrorResponse | BooleanResult]:
|
|
68
|
+
return Response(
|
|
69
|
+
status_code=HTTPStatus(response.status_code),
|
|
70
|
+
content=response.content,
|
|
71
|
+
headers=response.headers,
|
|
72
|
+
parsed=_parse_response(client=client, response=response),
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def sync_detailed(
|
|
77
|
+
*,
|
|
78
|
+
client: AuthenticatedClient | Client,
|
|
79
|
+
hero: int | Unset = UNSET,
|
|
80
|
+
|
|
81
|
+
) -> Response[ApiErrorResponse | BooleanResult]:
|
|
82
|
+
""" Whether the hero currently faces north.
|
|
83
|
+
|
|
84
|
+
Args:
|
|
85
|
+
hero (int | Unset):
|
|
86
|
+
|
|
87
|
+
Raises:
|
|
88
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
89
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
90
|
+
|
|
91
|
+
Returns:
|
|
92
|
+
Response[ApiErrorResponse | BooleanResult]
|
|
93
|
+
"""
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
kwargs = _get_kwargs(
|
|
97
|
+
hero=hero,
|
|
98
|
+
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
response = client.get_httpx_client().request(
|
|
102
|
+
**kwargs,
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
return _build_response(client=client, response=response)
|
|
106
|
+
|
|
107
|
+
def sync(
|
|
108
|
+
*,
|
|
109
|
+
client: AuthenticatedClient | Client,
|
|
110
|
+
hero: int | Unset = UNSET,
|
|
111
|
+
|
|
112
|
+
) -> ApiErrorResponse | BooleanResult | None:
|
|
113
|
+
""" Whether the hero currently faces north.
|
|
114
|
+
|
|
115
|
+
Args:
|
|
116
|
+
hero (int | Unset):
|
|
117
|
+
|
|
118
|
+
Raises:
|
|
119
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
120
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
121
|
+
|
|
122
|
+
Returns:
|
|
123
|
+
ApiErrorResponse | BooleanResult
|
|
124
|
+
"""
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
return sync_detailed(
|
|
128
|
+
client=client,
|
|
129
|
+
hero=hero,
|
|
130
|
+
|
|
131
|
+
).parsed
|
|
132
|
+
|
|
133
|
+
async def asyncio_detailed(
|
|
134
|
+
*,
|
|
135
|
+
client: AuthenticatedClient | Client,
|
|
136
|
+
hero: int | Unset = UNSET,
|
|
137
|
+
|
|
138
|
+
) -> Response[ApiErrorResponse | BooleanResult]:
|
|
139
|
+
""" Whether the hero currently faces north.
|
|
140
|
+
|
|
141
|
+
Args:
|
|
142
|
+
hero (int | Unset):
|
|
143
|
+
|
|
144
|
+
Raises:
|
|
145
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
146
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
147
|
+
|
|
148
|
+
Returns:
|
|
149
|
+
Response[ApiErrorResponse | BooleanResult]
|
|
150
|
+
"""
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
kwargs = _get_kwargs(
|
|
154
|
+
hero=hero,
|
|
155
|
+
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
response = await client.get_async_httpx_client().request(
|
|
159
|
+
**kwargs
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
return _build_response(client=client, response=response)
|
|
163
|
+
|
|
164
|
+
async def asyncio(
|
|
165
|
+
*,
|
|
166
|
+
client: AuthenticatedClient | Client,
|
|
167
|
+
hero: int | Unset = UNSET,
|
|
168
|
+
|
|
169
|
+
) -> ApiErrorResponse | BooleanResult | None:
|
|
170
|
+
""" Whether the hero currently faces north.
|
|
171
|
+
|
|
172
|
+
Args:
|
|
173
|
+
hero (int | Unset):
|
|
174
|
+
|
|
175
|
+
Raises:
|
|
176
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
177
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
178
|
+
|
|
179
|
+
Returns:
|
|
180
|
+
ApiErrorResponse | BooleanResult
|
|
181
|
+
"""
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
return (await asyncio_detailed(
|
|
185
|
+
client=client,
|
|
186
|
+
hero=hero,
|
|
187
|
+
|
|
188
|
+
)).parsed
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, cast
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...types import Response, UNSET
|
|
9
|
+
from ... import errors
|
|
10
|
+
|
|
11
|
+
from ...models.api_error_response import ApiErrorResponse
|
|
12
|
+
from ...models.boolean_result import BooleanResult
|
|
13
|
+
from ...types import UNSET, Unset
|
|
14
|
+
from typing import cast
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def _get_kwargs(
|
|
19
|
+
*,
|
|
20
|
+
hero: int | Unset = UNSET,
|
|
21
|
+
|
|
22
|
+
) -> dict[str, Any]:
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
params: dict[str, Any] = {}
|
|
28
|
+
|
|
29
|
+
params["hero"] = hero
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
_kwargs: dict[str, Any] = {
|
|
36
|
+
"method": "get",
|
|
37
|
+
"url": "/hero/is_switch_in_front",
|
|
38
|
+
"params": params,
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
return _kwargs
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> ApiErrorResponse | BooleanResult | None:
|
|
47
|
+
if response.status_code == 200:
|
|
48
|
+
response_200 = BooleanResult.from_dict(response.json())
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
return response_200
|
|
53
|
+
|
|
54
|
+
if response.status_code == 500:
|
|
55
|
+
response_500 = ApiErrorResponse.from_dict(response.json())
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
return response_500
|
|
60
|
+
|
|
61
|
+
if client.raise_on_unexpected_status:
|
|
62
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
63
|
+
else:
|
|
64
|
+
return None
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[ApiErrorResponse | BooleanResult]:
|
|
68
|
+
return Response(
|
|
69
|
+
status_code=HTTPStatus(response.status_code),
|
|
70
|
+
content=response.content,
|
|
71
|
+
headers=response.headers,
|
|
72
|
+
parsed=_parse_response(client=client, response=response),
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def sync_detailed(
|
|
77
|
+
*,
|
|
78
|
+
client: AuthenticatedClient | Client,
|
|
79
|
+
hero: int | Unset = UNSET,
|
|
80
|
+
|
|
81
|
+
) -> Response[ApiErrorResponse | BooleanResult]:
|
|
82
|
+
""" Whether a switch is on the tile in front of the hero.
|
|
83
|
+
|
|
84
|
+
Args:
|
|
85
|
+
hero (int | Unset):
|
|
86
|
+
|
|
87
|
+
Raises:
|
|
88
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
89
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
90
|
+
|
|
91
|
+
Returns:
|
|
92
|
+
Response[ApiErrorResponse | BooleanResult]
|
|
93
|
+
"""
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
kwargs = _get_kwargs(
|
|
97
|
+
hero=hero,
|
|
98
|
+
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
response = client.get_httpx_client().request(
|
|
102
|
+
**kwargs,
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
return _build_response(client=client, response=response)
|
|
106
|
+
|
|
107
|
+
def sync(
|
|
108
|
+
*,
|
|
109
|
+
client: AuthenticatedClient | Client,
|
|
110
|
+
hero: int | Unset = UNSET,
|
|
111
|
+
|
|
112
|
+
) -> ApiErrorResponse | BooleanResult | None:
|
|
113
|
+
""" Whether a switch is on the tile in front of the hero.
|
|
114
|
+
|
|
115
|
+
Args:
|
|
116
|
+
hero (int | Unset):
|
|
117
|
+
|
|
118
|
+
Raises:
|
|
119
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
120
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
121
|
+
|
|
122
|
+
Returns:
|
|
123
|
+
ApiErrorResponse | BooleanResult
|
|
124
|
+
"""
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
return sync_detailed(
|
|
128
|
+
client=client,
|
|
129
|
+
hero=hero,
|
|
130
|
+
|
|
131
|
+
).parsed
|
|
132
|
+
|
|
133
|
+
async def asyncio_detailed(
|
|
134
|
+
*,
|
|
135
|
+
client: AuthenticatedClient | Client,
|
|
136
|
+
hero: int | Unset = UNSET,
|
|
137
|
+
|
|
138
|
+
) -> Response[ApiErrorResponse | BooleanResult]:
|
|
139
|
+
""" Whether a switch is on the tile in front of the hero.
|
|
140
|
+
|
|
141
|
+
Args:
|
|
142
|
+
hero (int | Unset):
|
|
143
|
+
|
|
144
|
+
Raises:
|
|
145
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
146
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
147
|
+
|
|
148
|
+
Returns:
|
|
149
|
+
Response[ApiErrorResponse | BooleanResult]
|
|
150
|
+
"""
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
kwargs = _get_kwargs(
|
|
154
|
+
hero=hero,
|
|
155
|
+
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
response = await client.get_async_httpx_client().request(
|
|
159
|
+
**kwargs
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
return _build_response(client=client, response=response)
|
|
163
|
+
|
|
164
|
+
async def asyncio(
|
|
165
|
+
*,
|
|
166
|
+
client: AuthenticatedClient | Client,
|
|
167
|
+
hero: int | Unset = UNSET,
|
|
168
|
+
|
|
169
|
+
) -> ApiErrorResponse | BooleanResult | None:
|
|
170
|
+
""" Whether a switch is on the tile in front of the hero.
|
|
171
|
+
|
|
172
|
+
Args:
|
|
173
|
+
hero (int | Unset):
|
|
174
|
+
|
|
175
|
+
Raises:
|
|
176
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
177
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
178
|
+
|
|
179
|
+
Returns:
|
|
180
|
+
ApiErrorResponse | BooleanResult
|
|
181
|
+
"""
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
return (await asyncio_detailed(
|
|
185
|
+
client=client,
|
|
186
|
+
hero=hero,
|
|
187
|
+
|
|
188
|
+
)).parsed
|