policyengine-api-simulation-client 0.20251210.56__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.
- policyengine_api_simulation_client/__init__.py +8 -0
- policyengine_api_simulation_client/api/__init__.py +1 -0
- policyengine_api_simulation_client/api/default/__init__.py +1 -0
- policyengine_api_simulation_client/api/default/alive_ping_alive_get.py +139 -0
- policyengine_api_simulation_client/api/default/ping_ping_post.py +174 -0
- policyengine_api_simulation_client/api/default/simulate_simulate_economy_comparison_post.py +166 -0
- policyengine_api_simulation_client/api/default/started_ping_started_get.py +129 -0
- policyengine_api_simulation_client/client.py +268 -0
- policyengine_api_simulation_client/errors.py +16 -0
- policyengine_api_simulation_client/models/__init__.py +109 -0
- policyengine_api_simulation_client/models/age_group_baseline_reform_values.py +91 -0
- policyengine_api_simulation_client/models/baseline_reform_values.py +69 -0
- policyengine_api_simulation_client/models/budgetary_impact.py +101 -0
- policyengine_api_simulation_client/models/cliff_impact.py +75 -0
- policyengine_api_simulation_client/models/cliff_impact_in_simulation.py +69 -0
- policyengine_api_simulation_client/models/decile_impact.py +77 -0
- policyengine_api_simulation_client/models/decile_impact_average.py +46 -0
- policyengine_api_simulation_client/models/decile_impact_relative.py +46 -0
- policyengine_api_simulation_client/models/economy_comparison.py +338 -0
- policyengine_api_simulation_client/models/economy_comparison_detailed_budget_type_0.py +59 -0
- policyengine_api_simulation_client/models/gender_baseline_reform_values.py +75 -0
- policyengine_api_simulation_client/models/health_status.py +83 -0
- policyengine_api_simulation_client/models/hours_response.py +93 -0
- policyengine_api_simulation_client/models/http_validation_error.py +79 -0
- policyengine_api_simulation_client/models/inequality_impact.py +83 -0
- policyengine_api_simulation_client/models/intra_decile_impact.py +77 -0
- policyengine_api_simulation_client/models/intra_decile_impact_all.py +46 -0
- policyengine_api_simulation_client/models/intra_decile_impact_deciles.py +53 -0
- policyengine_api_simulation_client/models/intra_wealth_decile_impact_with_values.py +77 -0
- policyengine_api_simulation_client/models/intra_wealth_decile_impact_with_values_all.py +46 -0
- policyengine_api_simulation_client/models/intra_wealth_decile_impact_with_values_deciles.py +53 -0
- policyengine_api_simulation_client/models/labor_supply_response.py +119 -0
- policyengine_api_simulation_client/models/labor_supply_response_decile.py +63 -0
- policyengine_api_simulation_client/models/labor_supply_response_decile_additional_property.py +65 -0
- policyengine_api_simulation_client/models/labor_supply_response_decile_additional_property_additional_property.py +46 -0
- policyengine_api_simulation_client/models/labor_supply_response_relative_lsr.py +46 -0
- policyengine_api_simulation_client/models/parameter_change_dict.py +53 -0
- policyengine_api_simulation_client/models/parametric_reform.py +80 -0
- policyengine_api_simulation_client/models/ping_request.py +61 -0
- policyengine_api_simulation_client/models/ping_response.py +61 -0
- policyengine_api_simulation_client/models/poverty_gender_breakdown.py +75 -0
- policyengine_api_simulation_client/models/poverty_impact.py +75 -0
- policyengine_api_simulation_client/models/poverty_racial_breakdown_with_values.py +67 -0
- policyengine_api_simulation_client/models/probe_status.py +91 -0
- policyengine_api_simulation_client/models/program_specific_impact.py +77 -0
- policyengine_api_simulation_client/models/racial_baseline_reform_values.py +91 -0
- policyengine_api_simulation_client/models/simulation_options.py +309 -0
- policyengine_api_simulation_client/models/simulation_options_country.py +9 -0
- policyengine_api_simulation_client/models/simulation_options_data_type_1.py +46 -0
- policyengine_api_simulation_client/models/simulation_options_scope.py +9 -0
- policyengine_api_simulation_client/models/system_status.py +91 -0
- policyengine_api_simulation_client/models/uk_constituency_breakdown_by_constituency.py +85 -0
- policyengine_api_simulation_client/models/uk_constituency_breakdown_with_values.py +85 -0
- policyengine_api_simulation_client/models/uk_constituency_breakdown_with_values_by_constituency.py +59 -0
- policyengine_api_simulation_client/models/uk_constituency_breakdown_with_values_outcomes_by_region.py +67 -0
- policyengine_api_simulation_client/models/uk_constituency_breakdown_with_values_outcomes_by_region_additional_property.py +46 -0
- policyengine_api_simulation_client/models/validation_error.py +90 -0
- policyengine_api_simulation_client/models/wealth_decile_impact_with_values.py +77 -0
- policyengine_api_simulation_client/models/wealth_decile_impact_with_values_average.py +46 -0
- policyengine_api_simulation_client/models/wealth_decile_impact_with_values_relative.py +46 -0
- policyengine_api_simulation_client/py.typed +1 -0
- policyengine_api_simulation_client/types.py +54 -0
- policyengine_api_simulation_client-0.20251210.56.dist-info/METADATA +141 -0
- policyengine_api_simulation_client-0.20251210.56.dist-info/RECORD +65 -0
- policyengine_api_simulation_client-0.20251210.56.dist-info/WHEEL +4 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains methods for accessing the API"""
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains endpoint functions for accessing the API"""
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.health_status import HealthStatus
|
|
9
|
+
from ...types import Response
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _get_kwargs() -> dict[str, Any]:
|
|
13
|
+
_kwargs: dict[str, Any] = {
|
|
14
|
+
"method": "get",
|
|
15
|
+
"url": "/ping/alive",
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return _kwargs
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> HealthStatus | None:
|
|
22
|
+
if response.status_code == 200:
|
|
23
|
+
response_200 = HealthStatus.from_dict(response.json())
|
|
24
|
+
|
|
25
|
+
return response_200
|
|
26
|
+
|
|
27
|
+
if client.raise_on_unexpected_status:
|
|
28
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
29
|
+
else:
|
|
30
|
+
return None
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[HealthStatus]:
|
|
34
|
+
return Response(
|
|
35
|
+
status_code=HTTPStatus(response.status_code),
|
|
36
|
+
content=response.content,
|
|
37
|
+
headers=response.headers,
|
|
38
|
+
parsed=_parse_response(client=client, response=response),
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def sync_detailed(
|
|
43
|
+
*,
|
|
44
|
+
client: AuthenticatedClient | Client,
|
|
45
|
+
) -> Response[HealthStatus]:
|
|
46
|
+
"""Alive
|
|
47
|
+
|
|
48
|
+
Check if the service is healthy. This will always return
|
|
49
|
+
data, but will return a 503 response code if the service is
|
|
50
|
+
unhealthy.
|
|
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[HealthStatus]
|
|
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 | Client,
|
|
72
|
+
) -> HealthStatus | None:
|
|
73
|
+
"""Alive
|
|
74
|
+
|
|
75
|
+
Check if the service is healthy. This will always return
|
|
76
|
+
data, but will return a 503 response code if the service is
|
|
77
|
+
unhealthy.
|
|
78
|
+
|
|
79
|
+
Raises:
|
|
80
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
81
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
82
|
+
|
|
83
|
+
Returns:
|
|
84
|
+
HealthStatus
|
|
85
|
+
"""
|
|
86
|
+
|
|
87
|
+
return sync_detailed(
|
|
88
|
+
client=client,
|
|
89
|
+
).parsed
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
async def asyncio_detailed(
|
|
93
|
+
*,
|
|
94
|
+
client: AuthenticatedClient | Client,
|
|
95
|
+
) -> Response[HealthStatus]:
|
|
96
|
+
"""Alive
|
|
97
|
+
|
|
98
|
+
Check if the service is healthy. This will always return
|
|
99
|
+
data, but will return a 503 response code if the service is
|
|
100
|
+
unhealthy.
|
|
101
|
+
|
|
102
|
+
Raises:
|
|
103
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
104
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
105
|
+
|
|
106
|
+
Returns:
|
|
107
|
+
Response[HealthStatus]
|
|
108
|
+
"""
|
|
109
|
+
|
|
110
|
+
kwargs = _get_kwargs()
|
|
111
|
+
|
|
112
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
113
|
+
|
|
114
|
+
return _build_response(client=client, response=response)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
async def asyncio(
|
|
118
|
+
*,
|
|
119
|
+
client: AuthenticatedClient | Client,
|
|
120
|
+
) -> HealthStatus | None:
|
|
121
|
+
"""Alive
|
|
122
|
+
|
|
123
|
+
Check if the service is healthy. This will always return
|
|
124
|
+
data, but will return a 503 response code if the service is
|
|
125
|
+
unhealthy.
|
|
126
|
+
|
|
127
|
+
Raises:
|
|
128
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
129
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
130
|
+
|
|
131
|
+
Returns:
|
|
132
|
+
HealthStatus
|
|
133
|
+
"""
|
|
134
|
+
|
|
135
|
+
return (
|
|
136
|
+
await asyncio_detailed(
|
|
137
|
+
client=client,
|
|
138
|
+
)
|
|
139
|
+
).parsed
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
9
|
+
from ...models.ping_request import PingRequest
|
|
10
|
+
from ...models.ping_response import PingResponse
|
|
11
|
+
from ...types import Response
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
*,
|
|
16
|
+
body: PingRequest,
|
|
17
|
+
) -> dict[str, Any]:
|
|
18
|
+
headers: dict[str, Any] = {}
|
|
19
|
+
|
|
20
|
+
_kwargs: dict[str, Any] = {
|
|
21
|
+
"method": "post",
|
|
22
|
+
"url": "/ping",
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
_kwargs["json"] = body.to_dict()
|
|
26
|
+
|
|
27
|
+
headers["Content-Type"] = "application/json"
|
|
28
|
+
|
|
29
|
+
_kwargs["headers"] = headers
|
|
30
|
+
return _kwargs
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _parse_response(
|
|
34
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
35
|
+
) -> HTTPValidationError | PingResponse | None:
|
|
36
|
+
if response.status_code == 200:
|
|
37
|
+
response_200 = PingResponse.from_dict(response.json())
|
|
38
|
+
|
|
39
|
+
return response_200
|
|
40
|
+
|
|
41
|
+
if response.status_code == 422:
|
|
42
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
43
|
+
|
|
44
|
+
return response_422
|
|
45
|
+
|
|
46
|
+
if client.raise_on_unexpected_status:
|
|
47
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
48
|
+
else:
|
|
49
|
+
return None
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def _build_response(
|
|
53
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
54
|
+
) -> Response[HTTPValidationError | PingResponse]:
|
|
55
|
+
return Response(
|
|
56
|
+
status_code=HTTPStatus(response.status_code),
|
|
57
|
+
content=response.content,
|
|
58
|
+
headers=response.headers,
|
|
59
|
+
parsed=_parse_response(client=client, response=response),
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def sync_detailed(
|
|
64
|
+
*,
|
|
65
|
+
client: AuthenticatedClient | Client,
|
|
66
|
+
body: PingRequest,
|
|
67
|
+
) -> Response[HTTPValidationError | PingResponse]:
|
|
68
|
+
"""Ping
|
|
69
|
+
|
|
70
|
+
Verify the api is able to recieve and process unauthenticated requests.
|
|
71
|
+
|
|
72
|
+
Args:
|
|
73
|
+
body (PingRequest):
|
|
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
|
+
Response[HTTPValidationError | PingResponse]
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
kwargs = _get_kwargs(
|
|
84
|
+
body=body,
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
response = client.get_httpx_client().request(
|
|
88
|
+
**kwargs,
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
return _build_response(client=client, response=response)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def sync(
|
|
95
|
+
*,
|
|
96
|
+
client: AuthenticatedClient | Client,
|
|
97
|
+
body: PingRequest,
|
|
98
|
+
) -> HTTPValidationError | PingResponse | None:
|
|
99
|
+
"""Ping
|
|
100
|
+
|
|
101
|
+
Verify the api is able to recieve and process unauthenticated requests.
|
|
102
|
+
|
|
103
|
+
Args:
|
|
104
|
+
body (PingRequest):
|
|
105
|
+
|
|
106
|
+
Raises:
|
|
107
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
108
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
109
|
+
|
|
110
|
+
Returns:
|
|
111
|
+
HTTPValidationError | PingResponse
|
|
112
|
+
"""
|
|
113
|
+
|
|
114
|
+
return sync_detailed(
|
|
115
|
+
client=client,
|
|
116
|
+
body=body,
|
|
117
|
+
).parsed
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
async def asyncio_detailed(
|
|
121
|
+
*,
|
|
122
|
+
client: AuthenticatedClient | Client,
|
|
123
|
+
body: PingRequest,
|
|
124
|
+
) -> Response[HTTPValidationError | PingResponse]:
|
|
125
|
+
"""Ping
|
|
126
|
+
|
|
127
|
+
Verify the api is able to recieve and process unauthenticated requests.
|
|
128
|
+
|
|
129
|
+
Args:
|
|
130
|
+
body (PingRequest):
|
|
131
|
+
|
|
132
|
+
Raises:
|
|
133
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
134
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
135
|
+
|
|
136
|
+
Returns:
|
|
137
|
+
Response[HTTPValidationError | PingResponse]
|
|
138
|
+
"""
|
|
139
|
+
|
|
140
|
+
kwargs = _get_kwargs(
|
|
141
|
+
body=body,
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
145
|
+
|
|
146
|
+
return _build_response(client=client, response=response)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
async def asyncio(
|
|
150
|
+
*,
|
|
151
|
+
client: AuthenticatedClient | Client,
|
|
152
|
+
body: PingRequest,
|
|
153
|
+
) -> HTTPValidationError | PingResponse | None:
|
|
154
|
+
"""Ping
|
|
155
|
+
|
|
156
|
+
Verify the api is able to recieve and process unauthenticated requests.
|
|
157
|
+
|
|
158
|
+
Args:
|
|
159
|
+
body (PingRequest):
|
|
160
|
+
|
|
161
|
+
Raises:
|
|
162
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
163
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
164
|
+
|
|
165
|
+
Returns:
|
|
166
|
+
HTTPValidationError | PingResponse
|
|
167
|
+
"""
|
|
168
|
+
|
|
169
|
+
return (
|
|
170
|
+
await asyncio_detailed(
|
|
171
|
+
client=client,
|
|
172
|
+
body=body,
|
|
173
|
+
)
|
|
174
|
+
).parsed
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.economy_comparison import EconomyComparison
|
|
9
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
10
|
+
from ...models.simulation_options import SimulationOptions
|
|
11
|
+
from ...types import Response
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
*,
|
|
16
|
+
body: SimulationOptions,
|
|
17
|
+
) -> dict[str, Any]:
|
|
18
|
+
headers: dict[str, Any] = {}
|
|
19
|
+
|
|
20
|
+
_kwargs: dict[str, Any] = {
|
|
21
|
+
"method": "post",
|
|
22
|
+
"url": "/simulate/economy/comparison",
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
_kwargs["json"] = body.to_dict()
|
|
26
|
+
|
|
27
|
+
headers["Content-Type"] = "application/json"
|
|
28
|
+
|
|
29
|
+
_kwargs["headers"] = headers
|
|
30
|
+
return _kwargs
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _parse_response(
|
|
34
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
35
|
+
) -> EconomyComparison | HTTPValidationError | None:
|
|
36
|
+
if response.status_code == 200:
|
|
37
|
+
response_200 = EconomyComparison.from_dict(response.json())
|
|
38
|
+
|
|
39
|
+
return response_200
|
|
40
|
+
|
|
41
|
+
if response.status_code == 422:
|
|
42
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
43
|
+
|
|
44
|
+
return response_422
|
|
45
|
+
|
|
46
|
+
if client.raise_on_unexpected_status:
|
|
47
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
48
|
+
else:
|
|
49
|
+
return None
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def _build_response(
|
|
53
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
54
|
+
) -> Response[EconomyComparison | HTTPValidationError]:
|
|
55
|
+
return Response(
|
|
56
|
+
status_code=HTTPStatus(response.status_code),
|
|
57
|
+
content=response.content,
|
|
58
|
+
headers=response.headers,
|
|
59
|
+
parsed=_parse_response(client=client, response=response),
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def sync_detailed(
|
|
64
|
+
*,
|
|
65
|
+
client: AuthenticatedClient | Client,
|
|
66
|
+
body: SimulationOptions,
|
|
67
|
+
) -> Response[EconomyComparison | HTTPValidationError]:
|
|
68
|
+
"""Simulate
|
|
69
|
+
|
|
70
|
+
Args:
|
|
71
|
+
body (SimulationOptions):
|
|
72
|
+
|
|
73
|
+
Raises:
|
|
74
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
75
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
76
|
+
|
|
77
|
+
Returns:
|
|
78
|
+
Response[EconomyComparison | HTTPValidationError]
|
|
79
|
+
"""
|
|
80
|
+
|
|
81
|
+
kwargs = _get_kwargs(
|
|
82
|
+
body=body,
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
response = client.get_httpx_client().request(
|
|
86
|
+
**kwargs,
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
return _build_response(client=client, response=response)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def sync(
|
|
93
|
+
*,
|
|
94
|
+
client: AuthenticatedClient | Client,
|
|
95
|
+
body: SimulationOptions,
|
|
96
|
+
) -> EconomyComparison | HTTPValidationError | None:
|
|
97
|
+
"""Simulate
|
|
98
|
+
|
|
99
|
+
Args:
|
|
100
|
+
body (SimulationOptions):
|
|
101
|
+
|
|
102
|
+
Raises:
|
|
103
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
104
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
105
|
+
|
|
106
|
+
Returns:
|
|
107
|
+
EconomyComparison | HTTPValidationError
|
|
108
|
+
"""
|
|
109
|
+
|
|
110
|
+
return sync_detailed(
|
|
111
|
+
client=client,
|
|
112
|
+
body=body,
|
|
113
|
+
).parsed
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
async def asyncio_detailed(
|
|
117
|
+
*,
|
|
118
|
+
client: AuthenticatedClient | Client,
|
|
119
|
+
body: SimulationOptions,
|
|
120
|
+
) -> Response[EconomyComparison | HTTPValidationError]:
|
|
121
|
+
"""Simulate
|
|
122
|
+
|
|
123
|
+
Args:
|
|
124
|
+
body (SimulationOptions):
|
|
125
|
+
|
|
126
|
+
Raises:
|
|
127
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
128
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
129
|
+
|
|
130
|
+
Returns:
|
|
131
|
+
Response[EconomyComparison | HTTPValidationError]
|
|
132
|
+
"""
|
|
133
|
+
|
|
134
|
+
kwargs = _get_kwargs(
|
|
135
|
+
body=body,
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
139
|
+
|
|
140
|
+
return _build_response(client=client, response=response)
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
async def asyncio(
|
|
144
|
+
*,
|
|
145
|
+
client: AuthenticatedClient | Client,
|
|
146
|
+
body: SimulationOptions,
|
|
147
|
+
) -> EconomyComparison | HTTPValidationError | None:
|
|
148
|
+
"""Simulate
|
|
149
|
+
|
|
150
|
+
Args:
|
|
151
|
+
body (SimulationOptions):
|
|
152
|
+
|
|
153
|
+
Raises:
|
|
154
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
155
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
156
|
+
|
|
157
|
+
Returns:
|
|
158
|
+
EconomyComparison | HTTPValidationError
|
|
159
|
+
"""
|
|
160
|
+
|
|
161
|
+
return (
|
|
162
|
+
await asyncio_detailed(
|
|
163
|
+
client=client,
|
|
164
|
+
body=body,
|
|
165
|
+
)
|
|
166
|
+
).parsed
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, cast
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...types import Response
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def _get_kwargs() -> dict[str, Any]:
|
|
12
|
+
_kwargs: dict[str, Any] = {
|
|
13
|
+
"method": "get",
|
|
14
|
+
"url": "/ping/started",
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return _kwargs
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> str | None:
|
|
21
|
+
if response.status_code == 200:
|
|
22
|
+
response_200 = cast(str, response.json())
|
|
23
|
+
return response_200
|
|
24
|
+
|
|
25
|
+
if client.raise_on_unexpected_status:
|
|
26
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
27
|
+
else:
|
|
28
|
+
return None
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[str]:
|
|
32
|
+
return Response(
|
|
33
|
+
status_code=HTTPStatus(response.status_code),
|
|
34
|
+
content=response.content,
|
|
35
|
+
headers=response.headers,
|
|
36
|
+
parsed=_parse_response(client=client, response=response),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def sync_detailed(
|
|
41
|
+
*,
|
|
42
|
+
client: AuthenticatedClient | Client,
|
|
43
|
+
) -> Response[str]:
|
|
44
|
+
"""Started
|
|
45
|
+
|
|
46
|
+
Verify the api is running.
|
|
47
|
+
|
|
48
|
+
Raises:
|
|
49
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
50
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
51
|
+
|
|
52
|
+
Returns:
|
|
53
|
+
Response[str]
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
kwargs = _get_kwargs()
|
|
57
|
+
|
|
58
|
+
response = client.get_httpx_client().request(
|
|
59
|
+
**kwargs,
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
return _build_response(client=client, response=response)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def sync(
|
|
66
|
+
*,
|
|
67
|
+
client: AuthenticatedClient | Client,
|
|
68
|
+
) -> str | None:
|
|
69
|
+
"""Started
|
|
70
|
+
|
|
71
|
+
Verify the api is running.
|
|
72
|
+
|
|
73
|
+
Raises:
|
|
74
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
75
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
76
|
+
|
|
77
|
+
Returns:
|
|
78
|
+
str
|
|
79
|
+
"""
|
|
80
|
+
|
|
81
|
+
return sync_detailed(
|
|
82
|
+
client=client,
|
|
83
|
+
).parsed
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
async def asyncio_detailed(
|
|
87
|
+
*,
|
|
88
|
+
client: AuthenticatedClient | Client,
|
|
89
|
+
) -> Response[str]:
|
|
90
|
+
"""Started
|
|
91
|
+
|
|
92
|
+
Verify the api is running.
|
|
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[str]
|
|
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 | Client,
|
|
112
|
+
) -> str | None:
|
|
113
|
+
"""Started
|
|
114
|
+
|
|
115
|
+
Verify the api is running.
|
|
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
|
+
str
|
|
123
|
+
"""
|
|
124
|
+
|
|
125
|
+
return (
|
|
126
|
+
await asyncio_detailed(
|
|
127
|
+
client=client,
|
|
128
|
+
)
|
|
129
|
+
).parsed
|