apex-dispatch-api-client 0.7.2__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.
- apex_dispatch_api_client/__about__.py +15 -0
- apex_dispatch_api_client/__init__.py +8 -0
- apex_dispatch_api_client/api/__init__.py +1 -0
- apex_dispatch_api_client/api/default/__init__.py +1 -0
- apex_dispatch_api_client/api/default/health_health_get.py +85 -0
- apex_dispatch_api_client/api/unit_jobs/__init__.py +1 -0
- apex_dispatch_api_client/api/unit_jobs/create_sync_job_sync_jobs_post.py +178 -0
- apex_dispatch_api_client/api/unit_jobs/create_unit_job_unit_jobs_post.py +180 -0
- apex_dispatch_api_client/api/unit_jobs/delete_job_unit_jobs_job_id_delete.py +170 -0
- apex_dispatch_api_client/api/unit_jobs/get_job_params_params_post.py +179 -0
- apex_dispatch_api_client/api/unit_jobs/get_job_results_unit_jobs_job_id_results_get.py +186 -0
- apex_dispatch_api_client/api/unit_jobs/get_job_unit_jobs_job_id_get.py +172 -0
- apex_dispatch_api_client/api/upscale_tasks/__init__.py +1 -0
- apex_dispatch_api_client/api/upscale_tasks/create_upscale_task_upscale_tasks_post.py +180 -0
- apex_dispatch_api_client/api/upscale_tasks/get_jobs_status_jobs_status_get.py +192 -0
- apex_dispatch_api_client/api/upscale_tasks/get_upscale_task_upscale_tasks_task_id_get.py +172 -0
- apex_dispatch_api_client/api/upscale_tasks/split_in_tiles_tiles_post.py +184 -0
- apex_dispatch_api_client/client.py +282 -0
- apex_dispatch_api_client/errors.py +16 -0
- apex_dispatch_api_client/models/__init__.py +99 -0
- apex_dispatch_api_client/models/asset.py +155 -0
- apex_dispatch_api_client/models/base_job_request.py +104 -0
- apex_dispatch_api_client/models/base_job_request_parameters.py +47 -0
- apex_dispatch_api_client/models/collection.py +332 -0
- apex_dispatch_api_client/models/collection_assets_type_0.py +60 -0
- apex_dispatch_api_client/models/collection_summaries_type_0.py +109 -0
- apex_dispatch_api_client/models/collection_summaries_type_0_additional_property_type_2.py +47 -0
- apex_dispatch_api_client/models/error_response.py +138 -0
- apex_dispatch_api_client/models/error_response_details_type_0.py +47 -0
- apex_dispatch_api_client/models/extent.py +80 -0
- apex_dispatch_api_client/models/geometry_collection.py +247 -0
- apex_dispatch_api_client/models/grid_type_enum.py +9 -0
- apex_dispatch_api_client/models/http_validation_error.py +79 -0
- apex_dispatch_api_client/models/jobs_filter.py +9 -0
- apex_dispatch_api_client/models/jobs_status_response.py +97 -0
- apex_dispatch_api_client/models/line_string.py +163 -0
- apex_dispatch_api_client/models/link.py +123 -0
- apex_dispatch_api_client/models/mime_types.py +37 -0
- apex_dispatch_api_client/models/multi_line_string.py +180 -0
- apex_dispatch_api_client/models/multi_point.py +163 -0
- apex_dispatch_api_client/models/multi_polygon.py +191 -0
- apex_dispatch_api_client/models/output_format_enum.py +11 -0
- apex_dispatch_api_client/models/param_request.py +77 -0
- apex_dispatch_api_client/models/param_type_enum.py +16 -0
- apex_dispatch_api_client/models/parameter.py +108 -0
- apex_dispatch_api_client/models/parameter_dimension.py +69 -0
- apex_dispatch_api_client/models/point.py +151 -0
- apex_dispatch_api_client/models/polygon.py +180 -0
- apex_dispatch_api_client/models/process_type_enum.py +9 -0
- apex_dispatch_api_client/models/processing_job.py +130 -0
- apex_dispatch_api_client/models/processing_job_parameters.py +47 -0
- apex_dispatch_api_client/models/processing_job_summary.py +116 -0
- apex_dispatch_api_client/models/processing_job_summary_parameters.py +47 -0
- apex_dispatch_api_client/models/processing_status_enum.py +14 -0
- apex_dispatch_api_client/models/provider.py +135 -0
- apex_dispatch_api_client/models/range_.py +79 -0
- apex_dispatch_api_client/models/service_details.py +95 -0
- apex_dispatch_api_client/models/spatial_extent.py +96 -0
- apex_dispatch_api_client/models/tile_request.py +77 -0
- apex_dispatch_api_client/models/time_interval.py +99 -0
- apex_dispatch_api_client/models/upscaling_task.py +138 -0
- apex_dispatch_api_client/models/upscaling_task_request.py +118 -0
- apex_dispatch_api_client/models/upscaling_task_request_parameters.py +47 -0
- apex_dispatch_api_client/models/upscaling_task_summary.py +88 -0
- apex_dispatch_api_client/models/validation_error.py +123 -0
- apex_dispatch_api_client/models/validation_error_context.py +47 -0
- apex_dispatch_api_client/types.py +54 -0
- apex_dispatch_api_client-0.7.2.dist-info/METADATA +167 -0
- apex_dispatch_api_client-0.7.2.dist-info/RECORD +71 -0
- apex_dispatch_api_client-0.7.2.dist-info/WHEEL +4 -0
- apex_dispatch_api_client-0.7.2.dist-info/licenses/LICENSE +202 -0
|
@@ -0,0 +1,179 @@
|
|
|
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.param_request import ParamRequest
|
|
10
|
+
from ...models.parameter import Parameter
|
|
11
|
+
from ...types import Response
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
*,
|
|
16
|
+
body: ParamRequest,
|
|
17
|
+
) -> dict[str, Any]:
|
|
18
|
+
headers: dict[str, Any] = {}
|
|
19
|
+
|
|
20
|
+
_kwargs: dict[str, Any] = {
|
|
21
|
+
"method": "post",
|
|
22
|
+
"url": "/params",
|
|
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 | list[Parameter] | None:
|
|
36
|
+
if response.status_code == 200:
|
|
37
|
+
response_200 = []
|
|
38
|
+
_response_200 = response.json()
|
|
39
|
+
for response_200_item_data in _response_200:
|
|
40
|
+
response_200_item = Parameter.from_dict(response_200_item_data)
|
|
41
|
+
|
|
42
|
+
response_200.append(response_200_item)
|
|
43
|
+
|
|
44
|
+
return response_200
|
|
45
|
+
|
|
46
|
+
if response.status_code == 422:
|
|
47
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
48
|
+
|
|
49
|
+
return response_422
|
|
50
|
+
|
|
51
|
+
if client.raise_on_unexpected_status:
|
|
52
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
53
|
+
else:
|
|
54
|
+
return None
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def _build_response(
|
|
58
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
59
|
+
) -> Response[HTTPValidationError | list[Parameter]]:
|
|
60
|
+
return Response(
|
|
61
|
+
status_code=HTTPStatus(response.status_code),
|
|
62
|
+
content=response.content,
|
|
63
|
+
headers=response.headers,
|
|
64
|
+
parsed=_parse_response(client=client, response=response),
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def sync_detailed(
|
|
69
|
+
*,
|
|
70
|
+
client: AuthenticatedClient,
|
|
71
|
+
body: ParamRequest,
|
|
72
|
+
) -> Response[HTTPValidationError | list[Parameter]]:
|
|
73
|
+
"""Get the parameters of a specific processing service.
|
|
74
|
+
|
|
75
|
+
Retrieve the parameters required for a specific processing service.
|
|
76
|
+
|
|
77
|
+
Args:
|
|
78
|
+
body (ParamRequest):
|
|
79
|
+
|
|
80
|
+
Raises:
|
|
81
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
82
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
83
|
+
|
|
84
|
+
Returns:
|
|
85
|
+
Response[HTTPValidationError | list[Parameter]]
|
|
86
|
+
"""
|
|
87
|
+
|
|
88
|
+
kwargs = _get_kwargs(
|
|
89
|
+
body=body,
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
response = client.get_httpx_client().request(
|
|
93
|
+
**kwargs,
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
return _build_response(client=client, response=response)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def sync(
|
|
100
|
+
*,
|
|
101
|
+
client: AuthenticatedClient,
|
|
102
|
+
body: ParamRequest,
|
|
103
|
+
) -> HTTPValidationError | list[Parameter] | None:
|
|
104
|
+
"""Get the parameters of a specific processing service.
|
|
105
|
+
|
|
106
|
+
Retrieve the parameters required for a specific processing service.
|
|
107
|
+
|
|
108
|
+
Args:
|
|
109
|
+
body (ParamRequest):
|
|
110
|
+
|
|
111
|
+
Raises:
|
|
112
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
113
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
114
|
+
|
|
115
|
+
Returns:
|
|
116
|
+
HTTPValidationError | list[Parameter]
|
|
117
|
+
"""
|
|
118
|
+
|
|
119
|
+
return sync_detailed(
|
|
120
|
+
client=client,
|
|
121
|
+
body=body,
|
|
122
|
+
).parsed
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
async def asyncio_detailed(
|
|
126
|
+
*,
|
|
127
|
+
client: AuthenticatedClient,
|
|
128
|
+
body: ParamRequest,
|
|
129
|
+
) -> Response[HTTPValidationError | list[Parameter]]:
|
|
130
|
+
"""Get the parameters of a specific processing service.
|
|
131
|
+
|
|
132
|
+
Retrieve the parameters required for a specific processing service.
|
|
133
|
+
|
|
134
|
+
Args:
|
|
135
|
+
body (ParamRequest):
|
|
136
|
+
|
|
137
|
+
Raises:
|
|
138
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
139
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
140
|
+
|
|
141
|
+
Returns:
|
|
142
|
+
Response[HTTPValidationError | list[Parameter]]
|
|
143
|
+
"""
|
|
144
|
+
|
|
145
|
+
kwargs = _get_kwargs(
|
|
146
|
+
body=body,
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
150
|
+
|
|
151
|
+
return _build_response(client=client, response=response)
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
async def asyncio(
|
|
155
|
+
*,
|
|
156
|
+
client: AuthenticatedClient,
|
|
157
|
+
body: ParamRequest,
|
|
158
|
+
) -> HTTPValidationError | list[Parameter] | None:
|
|
159
|
+
"""Get the parameters of a specific processing service.
|
|
160
|
+
|
|
161
|
+
Retrieve the parameters required for a specific processing service.
|
|
162
|
+
|
|
163
|
+
Args:
|
|
164
|
+
body (ParamRequest):
|
|
165
|
+
|
|
166
|
+
Raises:
|
|
167
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
168
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
169
|
+
|
|
170
|
+
Returns:
|
|
171
|
+
HTTPValidationError | list[Parameter]
|
|
172
|
+
"""
|
|
173
|
+
|
|
174
|
+
return (
|
|
175
|
+
await asyncio_detailed(
|
|
176
|
+
client=client,
|
|
177
|
+
body=body,
|
|
178
|
+
)
|
|
179
|
+
).parsed
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, cast
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ... import errors
|
|
8
|
+
from ...client import AuthenticatedClient, Client
|
|
9
|
+
from ...models.collection import Collection
|
|
10
|
+
from ...models.error_response import ErrorResponse
|
|
11
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
12
|
+
from ...types import Response
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _get_kwargs(
|
|
16
|
+
job_id: int,
|
|
17
|
+
) -> dict[str, Any]:
|
|
18
|
+
|
|
19
|
+
_kwargs: dict[str, Any] = {
|
|
20
|
+
"method": "get",
|
|
21
|
+
"url": "/unit_jobs/{job_id}/results".format(
|
|
22
|
+
job_id=quote(str(job_id), safe=""),
|
|
23
|
+
),
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return _kwargs
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _parse_response(
|
|
30
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
31
|
+
) -> Collection | None | ErrorResponse | HTTPValidationError | None:
|
|
32
|
+
if response.status_code == 200:
|
|
33
|
+
|
|
34
|
+
def _parse_response_200(data: object) -> Collection | None:
|
|
35
|
+
if data is None:
|
|
36
|
+
return data
|
|
37
|
+
try:
|
|
38
|
+
if not isinstance(data, dict):
|
|
39
|
+
raise TypeError()
|
|
40
|
+
response_200_type_0 = Collection.from_dict(data)
|
|
41
|
+
|
|
42
|
+
return response_200_type_0
|
|
43
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
44
|
+
pass
|
|
45
|
+
return cast(Collection | None, data)
|
|
46
|
+
|
|
47
|
+
response_200 = _parse_response_200(response.json())
|
|
48
|
+
|
|
49
|
+
return response_200
|
|
50
|
+
|
|
51
|
+
if response.status_code == 404:
|
|
52
|
+
response_404 = ErrorResponse.from_dict(response.json())
|
|
53
|
+
|
|
54
|
+
return response_404
|
|
55
|
+
|
|
56
|
+
if response.status_code == 422:
|
|
57
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
58
|
+
|
|
59
|
+
return response_422
|
|
60
|
+
|
|
61
|
+
if response.status_code == 500:
|
|
62
|
+
response_500 = ErrorResponse.from_dict(response.json())
|
|
63
|
+
|
|
64
|
+
return response_500
|
|
65
|
+
|
|
66
|
+
if client.raise_on_unexpected_status:
|
|
67
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
68
|
+
else:
|
|
69
|
+
return None
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def _build_response(
|
|
73
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
74
|
+
) -> Response[Collection | None | ErrorResponse | HTTPValidationError]:
|
|
75
|
+
return Response(
|
|
76
|
+
status_code=HTTPStatus(response.status_code),
|
|
77
|
+
content=response.content,
|
|
78
|
+
headers=response.headers,
|
|
79
|
+
parsed=_parse_response(client=client, response=response),
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def sync_detailed(
|
|
84
|
+
job_id: int,
|
|
85
|
+
*,
|
|
86
|
+
client: AuthenticatedClient,
|
|
87
|
+
) -> Response[Collection | None | ErrorResponse | HTTPValidationError]:
|
|
88
|
+
"""Get Job Results
|
|
89
|
+
|
|
90
|
+
Args:
|
|
91
|
+
job_id (int):
|
|
92
|
+
|
|
93
|
+
Raises:
|
|
94
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
95
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
96
|
+
|
|
97
|
+
Returns:
|
|
98
|
+
Response[Collection | None | ErrorResponse | HTTPValidationError]
|
|
99
|
+
"""
|
|
100
|
+
|
|
101
|
+
kwargs = _get_kwargs(
|
|
102
|
+
job_id=job_id,
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
response = client.get_httpx_client().request(
|
|
106
|
+
**kwargs,
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
return _build_response(client=client, response=response)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def sync(
|
|
113
|
+
job_id: int,
|
|
114
|
+
*,
|
|
115
|
+
client: AuthenticatedClient,
|
|
116
|
+
) -> Collection | None | ErrorResponse | HTTPValidationError | None:
|
|
117
|
+
"""Get Job Results
|
|
118
|
+
|
|
119
|
+
Args:
|
|
120
|
+
job_id (int):
|
|
121
|
+
|
|
122
|
+
Raises:
|
|
123
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
124
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
125
|
+
|
|
126
|
+
Returns:
|
|
127
|
+
Collection | None | ErrorResponse | HTTPValidationError
|
|
128
|
+
"""
|
|
129
|
+
|
|
130
|
+
return sync_detailed(
|
|
131
|
+
job_id=job_id,
|
|
132
|
+
client=client,
|
|
133
|
+
).parsed
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
async def asyncio_detailed(
|
|
137
|
+
job_id: int,
|
|
138
|
+
*,
|
|
139
|
+
client: AuthenticatedClient,
|
|
140
|
+
) -> Response[Collection | None | ErrorResponse | HTTPValidationError]:
|
|
141
|
+
"""Get Job Results
|
|
142
|
+
|
|
143
|
+
Args:
|
|
144
|
+
job_id (int):
|
|
145
|
+
|
|
146
|
+
Raises:
|
|
147
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
148
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
149
|
+
|
|
150
|
+
Returns:
|
|
151
|
+
Response[Collection | None | ErrorResponse | HTTPValidationError]
|
|
152
|
+
"""
|
|
153
|
+
|
|
154
|
+
kwargs = _get_kwargs(
|
|
155
|
+
job_id=job_id,
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
159
|
+
|
|
160
|
+
return _build_response(client=client, response=response)
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
async def asyncio(
|
|
164
|
+
job_id: int,
|
|
165
|
+
*,
|
|
166
|
+
client: AuthenticatedClient,
|
|
167
|
+
) -> Collection | None | ErrorResponse | HTTPValidationError | None:
|
|
168
|
+
"""Get Job Results
|
|
169
|
+
|
|
170
|
+
Args:
|
|
171
|
+
job_id (int):
|
|
172
|
+
|
|
173
|
+
Raises:
|
|
174
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
175
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
176
|
+
|
|
177
|
+
Returns:
|
|
178
|
+
Collection | None | ErrorResponse | HTTPValidationError
|
|
179
|
+
"""
|
|
180
|
+
|
|
181
|
+
return (
|
|
182
|
+
await asyncio_detailed(
|
|
183
|
+
job_id=job_id,
|
|
184
|
+
client=client,
|
|
185
|
+
)
|
|
186
|
+
).parsed
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ... import errors
|
|
8
|
+
from ...client import AuthenticatedClient, Client
|
|
9
|
+
from ...models.error_response import ErrorResponse
|
|
10
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
11
|
+
from ...models.processing_job import ProcessingJob
|
|
12
|
+
from ...types import Response
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _get_kwargs(
|
|
16
|
+
job_id: int,
|
|
17
|
+
) -> dict[str, Any]:
|
|
18
|
+
|
|
19
|
+
_kwargs: dict[str, Any] = {
|
|
20
|
+
"method": "get",
|
|
21
|
+
"url": "/unit_jobs/{job_id}".format(
|
|
22
|
+
job_id=quote(str(job_id), safe=""),
|
|
23
|
+
),
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return _kwargs
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _parse_response(
|
|
30
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
31
|
+
) -> ErrorResponse | HTTPValidationError | ProcessingJob | None:
|
|
32
|
+
if response.status_code == 200:
|
|
33
|
+
response_200 = ProcessingJob.from_dict(response.json())
|
|
34
|
+
|
|
35
|
+
return response_200
|
|
36
|
+
|
|
37
|
+
if response.status_code == 404:
|
|
38
|
+
response_404 = ErrorResponse.from_dict(response.json())
|
|
39
|
+
|
|
40
|
+
return response_404
|
|
41
|
+
|
|
42
|
+
if response.status_code == 422:
|
|
43
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
44
|
+
|
|
45
|
+
return response_422
|
|
46
|
+
|
|
47
|
+
if response.status_code == 500:
|
|
48
|
+
response_500 = ErrorResponse.from_dict(response.json())
|
|
49
|
+
|
|
50
|
+
return response_500
|
|
51
|
+
|
|
52
|
+
if client.raise_on_unexpected_status:
|
|
53
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
54
|
+
else:
|
|
55
|
+
return None
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def _build_response(
|
|
59
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
60
|
+
) -> Response[ErrorResponse | HTTPValidationError | ProcessingJob]:
|
|
61
|
+
return Response(
|
|
62
|
+
status_code=HTTPStatus(response.status_code),
|
|
63
|
+
content=response.content,
|
|
64
|
+
headers=response.headers,
|
|
65
|
+
parsed=_parse_response(client=client, response=response),
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def sync_detailed(
|
|
70
|
+
job_id: int,
|
|
71
|
+
*,
|
|
72
|
+
client: AuthenticatedClient,
|
|
73
|
+
) -> Response[ErrorResponse | HTTPValidationError | ProcessingJob]:
|
|
74
|
+
"""Get Job
|
|
75
|
+
|
|
76
|
+
Args:
|
|
77
|
+
job_id (int):
|
|
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
|
+
Response[ErrorResponse | HTTPValidationError | ProcessingJob]
|
|
85
|
+
"""
|
|
86
|
+
|
|
87
|
+
kwargs = _get_kwargs(
|
|
88
|
+
job_id=job_id,
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
response = client.get_httpx_client().request(
|
|
92
|
+
**kwargs,
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
return _build_response(client=client, response=response)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def sync(
|
|
99
|
+
job_id: int,
|
|
100
|
+
*,
|
|
101
|
+
client: AuthenticatedClient,
|
|
102
|
+
) -> ErrorResponse | HTTPValidationError | ProcessingJob | None:
|
|
103
|
+
"""Get Job
|
|
104
|
+
|
|
105
|
+
Args:
|
|
106
|
+
job_id (int):
|
|
107
|
+
|
|
108
|
+
Raises:
|
|
109
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
110
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
111
|
+
|
|
112
|
+
Returns:
|
|
113
|
+
ErrorResponse | HTTPValidationError | ProcessingJob
|
|
114
|
+
"""
|
|
115
|
+
|
|
116
|
+
return sync_detailed(
|
|
117
|
+
job_id=job_id,
|
|
118
|
+
client=client,
|
|
119
|
+
).parsed
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
async def asyncio_detailed(
|
|
123
|
+
job_id: int,
|
|
124
|
+
*,
|
|
125
|
+
client: AuthenticatedClient,
|
|
126
|
+
) -> Response[ErrorResponse | HTTPValidationError | ProcessingJob]:
|
|
127
|
+
"""Get Job
|
|
128
|
+
|
|
129
|
+
Args:
|
|
130
|
+
job_id (int):
|
|
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[ErrorResponse | HTTPValidationError | ProcessingJob]
|
|
138
|
+
"""
|
|
139
|
+
|
|
140
|
+
kwargs = _get_kwargs(
|
|
141
|
+
job_id=job_id,
|
|
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
|
+
job_id: int,
|
|
151
|
+
*,
|
|
152
|
+
client: AuthenticatedClient,
|
|
153
|
+
) -> ErrorResponse | HTTPValidationError | ProcessingJob | None:
|
|
154
|
+
"""Get Job
|
|
155
|
+
|
|
156
|
+
Args:
|
|
157
|
+
job_id (int):
|
|
158
|
+
|
|
159
|
+
Raises:
|
|
160
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
161
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
162
|
+
|
|
163
|
+
Returns:
|
|
164
|
+
ErrorResponse | HTTPValidationError | ProcessingJob
|
|
165
|
+
"""
|
|
166
|
+
|
|
167
|
+
return (
|
|
168
|
+
await asyncio_detailed(
|
|
169
|
+
job_id=job_id,
|
|
170
|
+
client=client,
|
|
171
|
+
)
|
|
172
|
+
).parsed
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains endpoint functions for accessing the API"""
|
|
@@ -0,0 +1,180 @@
|
|
|
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.error_response import ErrorResponse
|
|
9
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
10
|
+
from ...models.upscaling_task_request import UpscalingTaskRequest
|
|
11
|
+
from ...models.upscaling_task_summary import UpscalingTaskSummary
|
|
12
|
+
from ...types import Response
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _get_kwargs(
|
|
16
|
+
*,
|
|
17
|
+
body: UpscalingTaskRequest,
|
|
18
|
+
) -> dict[str, Any]:
|
|
19
|
+
headers: dict[str, Any] = {}
|
|
20
|
+
|
|
21
|
+
_kwargs: dict[str, Any] = {
|
|
22
|
+
"method": "post",
|
|
23
|
+
"url": "/upscale_tasks",
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
_kwargs["json"] = body.to_dict()
|
|
27
|
+
|
|
28
|
+
headers["Content-Type"] = "application/json"
|
|
29
|
+
|
|
30
|
+
_kwargs["headers"] = headers
|
|
31
|
+
return _kwargs
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _parse_response(
|
|
35
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
36
|
+
) -> ErrorResponse | HTTPValidationError | UpscalingTaskSummary | None:
|
|
37
|
+
if response.status_code == 201:
|
|
38
|
+
response_201 = UpscalingTaskSummary.from_dict(response.json())
|
|
39
|
+
|
|
40
|
+
return response_201
|
|
41
|
+
|
|
42
|
+
if response.status_code == 422:
|
|
43
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
44
|
+
|
|
45
|
+
return response_422
|
|
46
|
+
|
|
47
|
+
if response.status_code == 500:
|
|
48
|
+
response_500 = ErrorResponse.from_dict(response.json())
|
|
49
|
+
|
|
50
|
+
return response_500
|
|
51
|
+
|
|
52
|
+
if client.raise_on_unexpected_status:
|
|
53
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
54
|
+
else:
|
|
55
|
+
return None
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def _build_response(
|
|
59
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
60
|
+
) -> Response[ErrorResponse | HTTPValidationError | UpscalingTaskSummary]:
|
|
61
|
+
return Response(
|
|
62
|
+
status_code=HTTPStatus(response.status_code),
|
|
63
|
+
content=response.content,
|
|
64
|
+
headers=response.headers,
|
|
65
|
+
parsed=_parse_response(client=client, response=response),
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def sync_detailed(
|
|
70
|
+
*,
|
|
71
|
+
client: AuthenticatedClient,
|
|
72
|
+
body: UpscalingTaskRequest,
|
|
73
|
+
) -> Response[ErrorResponse | HTTPValidationError | UpscalingTaskSummary]:
|
|
74
|
+
"""Create a new upscaling task
|
|
75
|
+
|
|
76
|
+
Create a new upscaling job with the provided data.
|
|
77
|
+
|
|
78
|
+
Args:
|
|
79
|
+
body (UpscalingTaskRequest):
|
|
80
|
+
|
|
81
|
+
Raises:
|
|
82
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
83
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
84
|
+
|
|
85
|
+
Returns:
|
|
86
|
+
Response[ErrorResponse | HTTPValidationError | UpscalingTaskSummary]
|
|
87
|
+
"""
|
|
88
|
+
|
|
89
|
+
kwargs = _get_kwargs(
|
|
90
|
+
body=body,
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
response = client.get_httpx_client().request(
|
|
94
|
+
**kwargs,
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
return _build_response(client=client, response=response)
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def sync(
|
|
101
|
+
*,
|
|
102
|
+
client: AuthenticatedClient,
|
|
103
|
+
body: UpscalingTaskRequest,
|
|
104
|
+
) -> ErrorResponse | HTTPValidationError | UpscalingTaskSummary | None:
|
|
105
|
+
"""Create a new upscaling task
|
|
106
|
+
|
|
107
|
+
Create a new upscaling job with the provided data.
|
|
108
|
+
|
|
109
|
+
Args:
|
|
110
|
+
body (UpscalingTaskRequest):
|
|
111
|
+
|
|
112
|
+
Raises:
|
|
113
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
114
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
115
|
+
|
|
116
|
+
Returns:
|
|
117
|
+
ErrorResponse | HTTPValidationError | UpscalingTaskSummary
|
|
118
|
+
"""
|
|
119
|
+
|
|
120
|
+
return sync_detailed(
|
|
121
|
+
client=client,
|
|
122
|
+
body=body,
|
|
123
|
+
).parsed
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
async def asyncio_detailed(
|
|
127
|
+
*,
|
|
128
|
+
client: AuthenticatedClient,
|
|
129
|
+
body: UpscalingTaskRequest,
|
|
130
|
+
) -> Response[ErrorResponse | HTTPValidationError | UpscalingTaskSummary]:
|
|
131
|
+
"""Create a new upscaling task
|
|
132
|
+
|
|
133
|
+
Create a new upscaling job with the provided data.
|
|
134
|
+
|
|
135
|
+
Args:
|
|
136
|
+
body (UpscalingTaskRequest):
|
|
137
|
+
|
|
138
|
+
Raises:
|
|
139
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
140
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
141
|
+
|
|
142
|
+
Returns:
|
|
143
|
+
Response[ErrorResponse | HTTPValidationError | UpscalingTaskSummary]
|
|
144
|
+
"""
|
|
145
|
+
|
|
146
|
+
kwargs = _get_kwargs(
|
|
147
|
+
body=body,
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
151
|
+
|
|
152
|
+
return _build_response(client=client, response=response)
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
async def asyncio(
|
|
156
|
+
*,
|
|
157
|
+
client: AuthenticatedClient,
|
|
158
|
+
body: UpscalingTaskRequest,
|
|
159
|
+
) -> ErrorResponse | HTTPValidationError | UpscalingTaskSummary | None:
|
|
160
|
+
"""Create a new upscaling task
|
|
161
|
+
|
|
162
|
+
Create a new upscaling job with the provided data.
|
|
163
|
+
|
|
164
|
+
Args:
|
|
165
|
+
body (UpscalingTaskRequest):
|
|
166
|
+
|
|
167
|
+
Raises:
|
|
168
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
169
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
170
|
+
|
|
171
|
+
Returns:
|
|
172
|
+
ErrorResponse | HTTPValidationError | UpscalingTaskSummary
|
|
173
|
+
"""
|
|
174
|
+
|
|
175
|
+
return (
|
|
176
|
+
await asyncio_detailed(
|
|
177
|
+
client=client,
|
|
178
|
+
body=body,
|
|
179
|
+
)
|
|
180
|
+
).parsed
|