autoassembler 0.3.1__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.
- autoassembler/.fernignore +7 -0
- autoassembler/__init__.py +537 -0
- autoassembler/_custom/__init__.py +56 -0
- autoassembler/_custom/assemblies.py +226 -0
- autoassembler/_custom/assemblies_api.py +188 -0
- autoassembler/_custom/credentials.py +248 -0
- autoassembler/_custom/http.py +42 -0
- autoassembler/_custom/operations.py +258 -0
- autoassembler/_custom/planning.py +598 -0
- autoassembler/_custom/planning_api.py +225 -0
- autoassembler/_default_clients.py +32 -0
- autoassembler/_version.py +8 -0
- autoassembler/alpha/__init__.py +63 -0
- autoassembler/alpha/client.py +82 -0
- autoassembler/alpha/jobs/__init__.py +39 -0
- autoassembler/alpha/jobs/client.py +338 -0
- autoassembler/alpha/jobs/raw_client.py +641 -0
- autoassembler/alpha/jobs/types/__init__.py +42 -0
- autoassembler/alpha/jobs/types/cancel_job_jobs_response.py +12 -0
- autoassembler/alpha/jobs/types/list_jobs_jobs_response.py +30 -0
- autoassembler/alpha/jobs/types/list_jobs_jobs_response_pagination.py +22 -0
- autoassembler/alpha/jobs/types/retry_job_jobs_response.py +16 -0
- autoassembler/alpha/planning/__init__.py +49 -0
- autoassembler/alpha/planning/client.py +201 -0
- autoassembler/alpha/planning/raw_client.py +268 -0
- autoassembler/alpha/planning/types/__init__.py +47 -0
- autoassembler/alpha/planning/types/apply_ops_planning_request_namespace.py +5 -0
- autoassembler/alpha/planning/types/apply_ops_planning_request_ops_item.py +13 -0
- autoassembler/alpha/planning/types/apply_ops_planning_request_ops_item_op.py +58 -0
- autoassembler/alpha/planning/types/apply_ops_planning_response.py +13 -0
- autoassembler/alpha/raw_client.py +13 -0
- autoassembler/assemblies/__init__.py +73 -0
- autoassembler/assemblies/client.py +1177 -0
- autoassembler/assemblies/raw_client.py +1557 -0
- autoassembler/assemblies/types/__init__.py +71 -0
- autoassembler/assemblies/types/delete_assembly_response.py +12 -0
- autoassembler/assemblies/types/download_assembly_cad_request_namespace.py +5 -0
- autoassembler/assemblies/types/get_assembly_info_request_namespace.py +5 -0
- autoassembler/assemblies/types/get_status_request_namespace.py +5 -0
- autoassembler/assemblies/types/get_status_response.py +16 -0
- autoassembler/assemblies/types/get_status_response_progress.py +13 -0
- autoassembler/assemblies/types/get_status_response_status.py +7 -0
- autoassembler/assemblies/types/get_structure_request_namespace.py +5 -0
- autoassembler/assemblies/types/list_assembly_versions_request_namespace.py +5 -0
- autoassembler/assemblies/types/list_connections_request_namespace.py +5 -0
- autoassembler/assemblies/types/process_request_namespace.py +5 -0
- autoassembler/assemblies/types/update_assembly_info_request_namespace.py +5 -0
- autoassembler/auth/__init__.py +34 -0
- autoassembler/auth/client.py +282 -0
- autoassembler/auth/raw_client.py +413 -0
- autoassembler/auth/types/__init__.py +36 -0
- autoassembler/auth/types/create_access_token_request_grant_type.py +7 -0
- autoassembler/base_client.py +328 -0
- autoassembler/client.py +262 -0
- autoassembler/core/__init__.py +127 -0
- autoassembler/core/api_error.py +23 -0
- autoassembler/core/client_wrapper.py +147 -0
- autoassembler/core/datetime_utils.py +70 -0
- autoassembler/core/file.py +67 -0
- autoassembler/core/force_multipart.py +18 -0
- autoassembler/core/http_client.py +965 -0
- autoassembler/core/http_response.py +63 -0
- autoassembler/core/http_sse/__init__.py +42 -0
- autoassembler/core/http_sse/_api.py +455 -0
- autoassembler/core/http_sse/_decoders.py +74 -0
- autoassembler/core/http_sse/_exceptions.py +7 -0
- autoassembler/core/http_sse/_models.py +17 -0
- autoassembler/core/jsonable_encoder.py +133 -0
- autoassembler/core/logging.py +107 -0
- autoassembler/core/parse_error.py +36 -0
- autoassembler/core/pydantic_utilities.py +486 -0
- autoassembler/core/query_encoder.py +58 -0
- autoassembler/core/remove_none_from_dict.py +11 -0
- autoassembler/core/request_options.py +40 -0
- autoassembler/core/serialization.py +347 -0
- autoassembler/environment.py +7 -0
- autoassembler/errors/__init__.py +56 -0
- autoassembler/errors/bad_request_error.py +10 -0
- autoassembler/errors/conflict_error.py +10 -0
- autoassembler/errors/forbidden_error.py +11 -0
- autoassembler/errors/internal_server_error.py +11 -0
- autoassembler/errors/not_found_error.py +11 -0
- autoassembler/errors/unauthorized_error.py +10 -0
- autoassembler/errors/unprocessable_entity_error.py +11 -0
- autoassembler/operation.py +196 -0
- autoassembler/operations/__init__.py +4 -0
- autoassembler/operations/client.py +209 -0
- autoassembler/operations/raw_client.py +343 -0
- autoassembler/planning/__init__.py +70 -0
- autoassembler/planning/client.py +1174 -0
- autoassembler/planning/raw_client.py +1349 -0
- autoassembler/planning/types/__init__.py +68 -0
- autoassembler/planning/types/adapt_request_namespace.py +5 -0
- autoassembler/planning/types/create_mpp_request_body.py +8 -0
- autoassembler/planning/types/create_mpp_request_namespace.py +5 -0
- autoassembler/planning/types/delete_mpp_request_namespace.py +5 -0
- autoassembler/planning/types/delete_mpp_response.py +12 -0
- autoassembler/planning/types/evaluate_dfa_request_namespace.py +5 -0
- autoassembler/planning/types/get_mpp_request_namespace.py +5 -0
- autoassembler/planning/types/get_mpp_response.py +27 -0
- autoassembler/planning/types/list_mpps_request_namespace.py +5 -0
- autoassembler/planning/types/plan_request_namespace.py +5 -0
- autoassembler/planning/types/validate_request_namespace.py +5 -0
- autoassembler/py.typed +0 -0
- autoassembler/sessions/__init__.py +4 -0
- autoassembler/sessions/client.py +102 -0
- autoassembler/sessions/raw_client.py +126 -0
- autoassembler/types/__init__.py +344 -0
- autoassembler/types/access_token_response.py +14 -0
- autoassembler/types/active_session.py +25 -0
- autoassembler/types/active_session_namespace.py +5 -0
- autoassembler/types/adapt_mpp_accepted.py +26 -0
- autoassembler/types/assembly.py +30 -0
- autoassembler/types/assembly_connection.py +21 -0
- autoassembler/types/assembly_connection_relationship.py +5 -0
- autoassembler/types/assembly_connections_response.py +13 -0
- autoassembler/types/assembly_diff_metadata.py +35 -0
- autoassembler/types/assembly_diff_response.py +34 -0
- autoassembler/types/assembly_info.py +36 -0
- autoassembler/types/assembly_json_response.py +15 -0
- autoassembler/types/assembly_process_metadata.py +32 -0
- autoassembler/types/assembly_process_response.py +18 -0
- autoassembler/types/assembly_search_hit.py +31 -0
- autoassembler/types/assembly_version_summary.py +27 -0
- autoassembler/types/conflict_error_body.py +19 -0
- autoassembler/types/conflict_error_body_error.py +5 -0
- autoassembler/types/create_mpp_request.py +13 -0
- autoassembler/types/device_authorization_response.py +17 -0
- autoassembler/types/diff_accepted.py +42 -0
- autoassembler/types/diff_context_node.py +20 -0
- autoassembler/types/diff_details.py +73 -0
- autoassembler/types/diff_error_response.py +38 -0
- autoassembler/types/diff_flags.py +74 -0
- autoassembler/types/diff_ml_semantics.py +55 -0
- autoassembler/types/diff_node.py +26 -0
- autoassembler/types/diff_node_pair_with_parts.py +90 -0
- autoassembler/types/diff_node_with_parent.py +15 -0
- autoassembler/types/diff_reference_target_nodes.py +25 -0
- autoassembler/types/diff_report.py +24 -0
- autoassembler/types/diff_rigid_alignment.py +30 -0
- autoassembler/types/diff_summary.py +121 -0
- autoassembler/types/diff_summary_assembly_labels.py +44 -0
- autoassembler/types/diff_summary_geometric_diffs.py +24 -0
- autoassembler/types/diff_summary_persistent_edges_congruence.py +24 -0
- autoassembler/types/diff_summary_persistent_edges_congruence_pose.py +24 -0
- autoassembler/types/diff_summary_persistent_nodes_congruence.py +24 -0
- autoassembler/types/diff_summary_persistent_nodes_congruence_pose.py +24 -0
- autoassembler/types/diff_summary_total_parts.py +24 -0
- autoassembler/types/diff_swap.py +65 -0
- autoassembler/types/diff_swap_confidence.py +5 -0
- autoassembler/types/diff_swap_group.py +92 -0
- autoassembler/types/diff_validation_issue.py +38 -0
- autoassembler/types/diff_validation_issue_severity.py +5 -0
- autoassembler/types/diff_validation_result.py +35 -0
- autoassembler/types/diff_warning.py +79 -0
- autoassembler/types/diff_warning_reason.py +18 -0
- autoassembler/types/diff_warning_severity.py +5 -0
- autoassembler/types/error_response.py +30 -0
- autoassembler/types/filter.py +19 -0
- autoassembler/types/filter_field.py +7 -0
- autoassembler/types/filter_operator.py +5 -0
- autoassembler/types/job.py +123 -0
- autoassembler/types/job_progress.py +24 -0
- autoassembler/types/job_status.py +5 -0
- autoassembler/types/list_operations_response.py +25 -0
- autoassembler/types/manufacturing_process_plan.py +57 -0
- autoassembler/types/mpp_adapt_metadata.py +48 -0
- autoassembler/types/mpp_adapt_response.py +22 -0
- autoassembler/types/mpp_evaluate_dfa_metadata.py +47 -0
- autoassembler/types/mpp_evaluate_dfa_response.py +22 -0
- autoassembler/types/mpp_plan_metadata.py +47 -0
- autoassembler/types/mpp_plan_response.py +22 -0
- autoassembler/types/mpp_summary.py +20 -0
- autoassembler/types/mpp_validate_metadata.py +47 -0
- autoassembler/types/mpp_validate_response.py +22 -0
- autoassembler/types/o_auth_error_response.py +14 -0
- autoassembler/types/o_auth_error_response_error.py +18 -0
- autoassembler/types/operation.py +27 -0
- autoassembler/types/operation_error.py +21 -0
- autoassembler/types/operation_metadata.py +148 -0
- autoassembler/types/operation_response.py +94 -0
- autoassembler/types/process_assembly_accepted.py +14 -0
- autoassembler/types/process_assembly_response.py +55 -0
- autoassembler/types/process_assembly_skipped.py +14 -0
- autoassembler/types/search_assemblies_response.py +14 -0
- autoassembler/types/seq_plan_accepted.py +24 -0
- autoassembler/types/sever.py +33 -0
- autoassembler/types/sever_kind.py +5 -0
- autoassembler/types/sever_source.py +5 -0
- autoassembler/types/sort.py +8 -0
- autoassembler/types/upload_response.py +19 -0
- autoassembler/types/user_info.py +19 -0
- autoassembler/types/user_info_response.py +23 -0
- autoassembler/types/user_info_response_providers.py +14 -0
- autoassembler-0.3.1.dist-info/METADATA +209 -0
- autoassembler-0.3.1.dist-info/RECORD +198 -0
- autoassembler-0.3.1.dist-info/WHEEL +4 -0
- autoassembler-0.3.1.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
|
+
from ..core.request_options import RequestOptions
|
|
7
|
+
from ..types.list_operations_response import ListOperationsResponse
|
|
8
|
+
from ..types.operation import Operation
|
|
9
|
+
from .raw_client import AsyncRawOperationsClient, RawOperationsClient
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class OperationsClient:
|
|
13
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
14
|
+
self._raw_client = RawOperationsClient(client_wrapper=client_wrapper)
|
|
15
|
+
|
|
16
|
+
@property
|
|
17
|
+
def with_raw_response(self) -> RawOperationsClient:
|
|
18
|
+
"""
|
|
19
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
20
|
+
|
|
21
|
+
Returns
|
|
22
|
+
-------
|
|
23
|
+
RawOperationsClient
|
|
24
|
+
"""
|
|
25
|
+
return self._raw_client
|
|
26
|
+
|
|
27
|
+
def list_operations(
|
|
28
|
+
self,
|
|
29
|
+
*,
|
|
30
|
+
page_size: typing.Optional[int] = None,
|
|
31
|
+
page_token: typing.Optional[str] = None,
|
|
32
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
33
|
+
) -> ListOperationsResponse:
|
|
34
|
+
"""
|
|
35
|
+
The caller's operations, newest first (an admin sees every user's). Pages follow
|
|
36
|
+
[AIP-158](https://google.aip.dev/158): pass a response's `nextPageToken` as `pageToken`
|
|
37
|
+
to get the next page; the last page has no `nextPageToken`.
|
|
38
|
+
|
|
39
|
+
Parameters
|
|
40
|
+
----------
|
|
41
|
+
page_size : typing.Optional[int]
|
|
42
|
+
Operations per page, at most 1000; a larger value is treated as 1000.
|
|
43
|
+
|
|
44
|
+
page_token : typing.Optional[str]
|
|
45
|
+
The `nextPageToken` of the previous page, as returned. Tokens are opaque; a value that is not one is refused with 400.
|
|
46
|
+
|
|
47
|
+
request_options : typing.Optional[RequestOptions]
|
|
48
|
+
Request-specific configuration.
|
|
49
|
+
|
|
50
|
+
Returns
|
|
51
|
+
-------
|
|
52
|
+
ListOperationsResponse
|
|
53
|
+
A page of operations
|
|
54
|
+
|
|
55
|
+
Examples
|
|
56
|
+
--------
|
|
57
|
+
from autoassembler import AutoAssembler
|
|
58
|
+
|
|
59
|
+
client = AutoAssembler(
|
|
60
|
+
token="YOUR_TOKEN",
|
|
61
|
+
)
|
|
62
|
+
client.operations.list_operations()
|
|
63
|
+
"""
|
|
64
|
+
_response = self._raw_client.list_operations(
|
|
65
|
+
page_size=page_size, page_token=page_token, request_options=request_options
|
|
66
|
+
)
|
|
67
|
+
return _response.data
|
|
68
|
+
|
|
69
|
+
def get_operation(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Operation:
|
|
70
|
+
"""
|
|
71
|
+
An operation records one request whose work continues after its response: it is `done`
|
|
72
|
+
once the outcome is recorded, with either `response` or `error` set. Shaped after
|
|
73
|
+
`google.longrunning.Operation` ([AIP-151](https://google.aip.dev/151)). Poll it until
|
|
74
|
+
`done`; for a station run, the process plan holds the run's results by then.
|
|
75
|
+
|
|
76
|
+
Parameters
|
|
77
|
+
----------
|
|
78
|
+
id : str
|
|
79
|
+
The operation's id, the part of its `name` after `operations/`.
|
|
80
|
+
|
|
81
|
+
request_options : typing.Optional[RequestOptions]
|
|
82
|
+
Request-specific configuration.
|
|
83
|
+
|
|
84
|
+
Returns
|
|
85
|
+
-------
|
|
86
|
+
Operation
|
|
87
|
+
Operation
|
|
88
|
+
|
|
89
|
+
Examples
|
|
90
|
+
--------
|
|
91
|
+
from autoassembler import AutoAssembler
|
|
92
|
+
|
|
93
|
+
client = AutoAssembler(
|
|
94
|
+
token="YOUR_TOKEN",
|
|
95
|
+
)
|
|
96
|
+
client.operations.get_operation(
|
|
97
|
+
id="id",
|
|
98
|
+
)
|
|
99
|
+
"""
|
|
100
|
+
_response = self._raw_client.get_operation(id, request_options=request_options)
|
|
101
|
+
return _response.data
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
class AsyncOperationsClient:
|
|
105
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
106
|
+
self._raw_client = AsyncRawOperationsClient(client_wrapper=client_wrapper)
|
|
107
|
+
|
|
108
|
+
@property
|
|
109
|
+
def with_raw_response(self) -> AsyncRawOperationsClient:
|
|
110
|
+
"""
|
|
111
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
112
|
+
|
|
113
|
+
Returns
|
|
114
|
+
-------
|
|
115
|
+
AsyncRawOperationsClient
|
|
116
|
+
"""
|
|
117
|
+
return self._raw_client
|
|
118
|
+
|
|
119
|
+
async def list_operations(
|
|
120
|
+
self,
|
|
121
|
+
*,
|
|
122
|
+
page_size: typing.Optional[int] = None,
|
|
123
|
+
page_token: typing.Optional[str] = None,
|
|
124
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
125
|
+
) -> ListOperationsResponse:
|
|
126
|
+
"""
|
|
127
|
+
The caller's operations, newest first (an admin sees every user's). Pages follow
|
|
128
|
+
[AIP-158](https://google.aip.dev/158): pass a response's `nextPageToken` as `pageToken`
|
|
129
|
+
to get the next page; the last page has no `nextPageToken`.
|
|
130
|
+
|
|
131
|
+
Parameters
|
|
132
|
+
----------
|
|
133
|
+
page_size : typing.Optional[int]
|
|
134
|
+
Operations per page, at most 1000; a larger value is treated as 1000.
|
|
135
|
+
|
|
136
|
+
page_token : typing.Optional[str]
|
|
137
|
+
The `nextPageToken` of the previous page, as returned. Tokens are opaque; a value that is not one is refused with 400.
|
|
138
|
+
|
|
139
|
+
request_options : typing.Optional[RequestOptions]
|
|
140
|
+
Request-specific configuration.
|
|
141
|
+
|
|
142
|
+
Returns
|
|
143
|
+
-------
|
|
144
|
+
ListOperationsResponse
|
|
145
|
+
A page of operations
|
|
146
|
+
|
|
147
|
+
Examples
|
|
148
|
+
--------
|
|
149
|
+
import asyncio
|
|
150
|
+
|
|
151
|
+
from autoassembler import AsyncAutoAssembler
|
|
152
|
+
|
|
153
|
+
client = AsyncAutoAssembler(
|
|
154
|
+
token="YOUR_TOKEN",
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
async def main() -> None:
|
|
159
|
+
await client.operations.list_operations()
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
asyncio.run(main())
|
|
163
|
+
"""
|
|
164
|
+
_response = await self._raw_client.list_operations(
|
|
165
|
+
page_size=page_size, page_token=page_token, request_options=request_options
|
|
166
|
+
)
|
|
167
|
+
return _response.data
|
|
168
|
+
|
|
169
|
+
async def get_operation(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Operation:
|
|
170
|
+
"""
|
|
171
|
+
An operation records one request whose work continues after its response: it is `done`
|
|
172
|
+
once the outcome is recorded, with either `response` or `error` set. Shaped after
|
|
173
|
+
`google.longrunning.Operation` ([AIP-151](https://google.aip.dev/151)). Poll it until
|
|
174
|
+
`done`; for a station run, the process plan holds the run's results by then.
|
|
175
|
+
|
|
176
|
+
Parameters
|
|
177
|
+
----------
|
|
178
|
+
id : str
|
|
179
|
+
The operation's id, the part of its `name` after `operations/`.
|
|
180
|
+
|
|
181
|
+
request_options : typing.Optional[RequestOptions]
|
|
182
|
+
Request-specific configuration.
|
|
183
|
+
|
|
184
|
+
Returns
|
|
185
|
+
-------
|
|
186
|
+
Operation
|
|
187
|
+
Operation
|
|
188
|
+
|
|
189
|
+
Examples
|
|
190
|
+
--------
|
|
191
|
+
import asyncio
|
|
192
|
+
|
|
193
|
+
from autoassembler import AsyncAutoAssembler
|
|
194
|
+
|
|
195
|
+
client = AsyncAutoAssembler(
|
|
196
|
+
token="YOUR_TOKEN",
|
|
197
|
+
)
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
async def main() -> None:
|
|
201
|
+
await client.operations.get_operation(
|
|
202
|
+
id="id",
|
|
203
|
+
)
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
asyncio.run(main())
|
|
207
|
+
"""
|
|
208
|
+
_response = await self._raw_client.get_operation(id, request_options=request_options)
|
|
209
|
+
return _response.data
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
from json.decoder import JSONDecodeError
|
|
5
|
+
|
|
6
|
+
from ..core.api_error import ApiError
|
|
7
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
8
|
+
from ..core.http_response import AsyncHttpResponse, HttpResponse
|
|
9
|
+
from ..core.jsonable_encoder import encode_path_param
|
|
10
|
+
from ..core.parse_error import ParsingError
|
|
11
|
+
from ..core.pydantic_utilities import parse_obj_as
|
|
12
|
+
from ..core.request_options import RequestOptions
|
|
13
|
+
from ..errors.bad_request_error import BadRequestError
|
|
14
|
+
from ..errors.forbidden_error import ForbiddenError
|
|
15
|
+
from ..errors.not_found_error import NotFoundError
|
|
16
|
+
from ..types.error_response import ErrorResponse
|
|
17
|
+
from ..types.list_operations_response import ListOperationsResponse
|
|
18
|
+
from ..types.operation import Operation
|
|
19
|
+
from pydantic import ValidationError
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class RawOperationsClient:
|
|
23
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
24
|
+
self._client_wrapper = client_wrapper
|
|
25
|
+
|
|
26
|
+
def list_operations(
|
|
27
|
+
self,
|
|
28
|
+
*,
|
|
29
|
+
page_size: typing.Optional[int] = None,
|
|
30
|
+
page_token: typing.Optional[str] = None,
|
|
31
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
32
|
+
) -> HttpResponse[ListOperationsResponse]:
|
|
33
|
+
"""
|
|
34
|
+
The caller's operations, newest first (an admin sees every user's). Pages follow
|
|
35
|
+
[AIP-158](https://google.aip.dev/158): pass a response's `nextPageToken` as `pageToken`
|
|
36
|
+
to get the next page; the last page has no `nextPageToken`.
|
|
37
|
+
|
|
38
|
+
Parameters
|
|
39
|
+
----------
|
|
40
|
+
page_size : typing.Optional[int]
|
|
41
|
+
Operations per page, at most 1000; a larger value is treated as 1000.
|
|
42
|
+
|
|
43
|
+
page_token : typing.Optional[str]
|
|
44
|
+
The `nextPageToken` of the previous page, as returned. Tokens are opaque; a value that is not one is refused with 400.
|
|
45
|
+
|
|
46
|
+
request_options : typing.Optional[RequestOptions]
|
|
47
|
+
Request-specific configuration.
|
|
48
|
+
|
|
49
|
+
Returns
|
|
50
|
+
-------
|
|
51
|
+
HttpResponse[ListOperationsResponse]
|
|
52
|
+
A page of operations
|
|
53
|
+
"""
|
|
54
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
55
|
+
"api/v4/operations",
|
|
56
|
+
method="GET",
|
|
57
|
+
params={
|
|
58
|
+
"pageSize": page_size,
|
|
59
|
+
"pageToken": page_token,
|
|
60
|
+
},
|
|
61
|
+
request_options=request_options,
|
|
62
|
+
)
|
|
63
|
+
try:
|
|
64
|
+
if 200 <= _response.status_code < 300:
|
|
65
|
+
_data = typing.cast(
|
|
66
|
+
ListOperationsResponse,
|
|
67
|
+
parse_obj_as(
|
|
68
|
+
type_=ListOperationsResponse, # type: ignore
|
|
69
|
+
object_=_response.json(),
|
|
70
|
+
),
|
|
71
|
+
)
|
|
72
|
+
return HttpResponse(response=_response, data=_data)
|
|
73
|
+
if _response.status_code == 400:
|
|
74
|
+
raise BadRequestError(
|
|
75
|
+
headers=dict(_response.headers),
|
|
76
|
+
body=typing.cast(
|
|
77
|
+
typing.Any,
|
|
78
|
+
parse_obj_as(
|
|
79
|
+
type_=typing.Any, # type: ignore
|
|
80
|
+
object_=_response.json(),
|
|
81
|
+
),
|
|
82
|
+
),
|
|
83
|
+
)
|
|
84
|
+
if _response.status_code == 403:
|
|
85
|
+
raise ForbiddenError(
|
|
86
|
+
headers=dict(_response.headers),
|
|
87
|
+
body=typing.cast(
|
|
88
|
+
ErrorResponse,
|
|
89
|
+
parse_obj_as(
|
|
90
|
+
type_=ErrorResponse, # type: ignore
|
|
91
|
+
object_=_response.json(),
|
|
92
|
+
),
|
|
93
|
+
),
|
|
94
|
+
)
|
|
95
|
+
_response_json = _response.json()
|
|
96
|
+
except JSONDecodeError:
|
|
97
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
98
|
+
except ValidationError as e:
|
|
99
|
+
raise ParsingError(
|
|
100
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
101
|
+
)
|
|
102
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
103
|
+
|
|
104
|
+
def get_operation(
|
|
105
|
+
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
106
|
+
) -> HttpResponse[Operation]:
|
|
107
|
+
"""
|
|
108
|
+
An operation records one request whose work continues after its response: it is `done`
|
|
109
|
+
once the outcome is recorded, with either `response` or `error` set. Shaped after
|
|
110
|
+
`google.longrunning.Operation` ([AIP-151](https://google.aip.dev/151)). Poll it until
|
|
111
|
+
`done`; for a station run, the process plan holds the run's results by then.
|
|
112
|
+
|
|
113
|
+
Parameters
|
|
114
|
+
----------
|
|
115
|
+
id : str
|
|
116
|
+
The operation's id, the part of its `name` after `operations/`.
|
|
117
|
+
|
|
118
|
+
request_options : typing.Optional[RequestOptions]
|
|
119
|
+
Request-specific configuration.
|
|
120
|
+
|
|
121
|
+
Returns
|
|
122
|
+
-------
|
|
123
|
+
HttpResponse[Operation]
|
|
124
|
+
Operation
|
|
125
|
+
"""
|
|
126
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
127
|
+
f"api/v4/operations/{encode_path_param(id)}",
|
|
128
|
+
method="GET",
|
|
129
|
+
request_options=request_options,
|
|
130
|
+
)
|
|
131
|
+
try:
|
|
132
|
+
if 200 <= _response.status_code < 300:
|
|
133
|
+
_data = typing.cast(
|
|
134
|
+
Operation,
|
|
135
|
+
parse_obj_as(
|
|
136
|
+
type_=Operation, # type: ignore
|
|
137
|
+
object_=_response.json(),
|
|
138
|
+
),
|
|
139
|
+
)
|
|
140
|
+
return HttpResponse(response=_response, data=_data)
|
|
141
|
+
if _response.status_code == 400:
|
|
142
|
+
raise BadRequestError(
|
|
143
|
+
headers=dict(_response.headers),
|
|
144
|
+
body=typing.cast(
|
|
145
|
+
typing.Any,
|
|
146
|
+
parse_obj_as(
|
|
147
|
+
type_=typing.Any, # type: ignore
|
|
148
|
+
object_=_response.json(),
|
|
149
|
+
),
|
|
150
|
+
),
|
|
151
|
+
)
|
|
152
|
+
if _response.status_code == 403:
|
|
153
|
+
raise ForbiddenError(
|
|
154
|
+
headers=dict(_response.headers),
|
|
155
|
+
body=typing.cast(
|
|
156
|
+
ErrorResponse,
|
|
157
|
+
parse_obj_as(
|
|
158
|
+
type_=ErrorResponse, # type: ignore
|
|
159
|
+
object_=_response.json(),
|
|
160
|
+
),
|
|
161
|
+
),
|
|
162
|
+
)
|
|
163
|
+
if _response.status_code == 404:
|
|
164
|
+
raise NotFoundError(
|
|
165
|
+
headers=dict(_response.headers),
|
|
166
|
+
body=typing.cast(
|
|
167
|
+
ErrorResponse,
|
|
168
|
+
parse_obj_as(
|
|
169
|
+
type_=ErrorResponse, # type: ignore
|
|
170
|
+
object_=_response.json(),
|
|
171
|
+
),
|
|
172
|
+
),
|
|
173
|
+
)
|
|
174
|
+
_response_json = _response.json()
|
|
175
|
+
except JSONDecodeError:
|
|
176
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
177
|
+
except ValidationError as e:
|
|
178
|
+
raise ParsingError(
|
|
179
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
180
|
+
)
|
|
181
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
class AsyncRawOperationsClient:
|
|
185
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
186
|
+
self._client_wrapper = client_wrapper
|
|
187
|
+
|
|
188
|
+
async def list_operations(
|
|
189
|
+
self,
|
|
190
|
+
*,
|
|
191
|
+
page_size: typing.Optional[int] = None,
|
|
192
|
+
page_token: typing.Optional[str] = None,
|
|
193
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
194
|
+
) -> AsyncHttpResponse[ListOperationsResponse]:
|
|
195
|
+
"""
|
|
196
|
+
The caller's operations, newest first (an admin sees every user's). Pages follow
|
|
197
|
+
[AIP-158](https://google.aip.dev/158): pass a response's `nextPageToken` as `pageToken`
|
|
198
|
+
to get the next page; the last page has no `nextPageToken`.
|
|
199
|
+
|
|
200
|
+
Parameters
|
|
201
|
+
----------
|
|
202
|
+
page_size : typing.Optional[int]
|
|
203
|
+
Operations per page, at most 1000; a larger value is treated as 1000.
|
|
204
|
+
|
|
205
|
+
page_token : typing.Optional[str]
|
|
206
|
+
The `nextPageToken` of the previous page, as returned. Tokens are opaque; a value that is not one is refused with 400.
|
|
207
|
+
|
|
208
|
+
request_options : typing.Optional[RequestOptions]
|
|
209
|
+
Request-specific configuration.
|
|
210
|
+
|
|
211
|
+
Returns
|
|
212
|
+
-------
|
|
213
|
+
AsyncHttpResponse[ListOperationsResponse]
|
|
214
|
+
A page of operations
|
|
215
|
+
"""
|
|
216
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
217
|
+
"api/v4/operations",
|
|
218
|
+
method="GET",
|
|
219
|
+
params={
|
|
220
|
+
"pageSize": page_size,
|
|
221
|
+
"pageToken": page_token,
|
|
222
|
+
},
|
|
223
|
+
request_options=request_options,
|
|
224
|
+
)
|
|
225
|
+
try:
|
|
226
|
+
if 200 <= _response.status_code < 300:
|
|
227
|
+
_data = typing.cast(
|
|
228
|
+
ListOperationsResponse,
|
|
229
|
+
parse_obj_as(
|
|
230
|
+
type_=ListOperationsResponse, # type: ignore
|
|
231
|
+
object_=_response.json(),
|
|
232
|
+
),
|
|
233
|
+
)
|
|
234
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
235
|
+
if _response.status_code == 400:
|
|
236
|
+
raise BadRequestError(
|
|
237
|
+
headers=dict(_response.headers),
|
|
238
|
+
body=typing.cast(
|
|
239
|
+
typing.Any,
|
|
240
|
+
parse_obj_as(
|
|
241
|
+
type_=typing.Any, # type: ignore
|
|
242
|
+
object_=_response.json(),
|
|
243
|
+
),
|
|
244
|
+
),
|
|
245
|
+
)
|
|
246
|
+
if _response.status_code == 403:
|
|
247
|
+
raise ForbiddenError(
|
|
248
|
+
headers=dict(_response.headers),
|
|
249
|
+
body=typing.cast(
|
|
250
|
+
ErrorResponse,
|
|
251
|
+
parse_obj_as(
|
|
252
|
+
type_=ErrorResponse, # type: ignore
|
|
253
|
+
object_=_response.json(),
|
|
254
|
+
),
|
|
255
|
+
),
|
|
256
|
+
)
|
|
257
|
+
_response_json = _response.json()
|
|
258
|
+
except JSONDecodeError:
|
|
259
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
260
|
+
except ValidationError as e:
|
|
261
|
+
raise ParsingError(
|
|
262
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
263
|
+
)
|
|
264
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
265
|
+
|
|
266
|
+
async def get_operation(
|
|
267
|
+
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
268
|
+
) -> AsyncHttpResponse[Operation]:
|
|
269
|
+
"""
|
|
270
|
+
An operation records one request whose work continues after its response: it is `done`
|
|
271
|
+
once the outcome is recorded, with either `response` or `error` set. Shaped after
|
|
272
|
+
`google.longrunning.Operation` ([AIP-151](https://google.aip.dev/151)). Poll it until
|
|
273
|
+
`done`; for a station run, the process plan holds the run's results by then.
|
|
274
|
+
|
|
275
|
+
Parameters
|
|
276
|
+
----------
|
|
277
|
+
id : str
|
|
278
|
+
The operation's id, the part of its `name` after `operations/`.
|
|
279
|
+
|
|
280
|
+
request_options : typing.Optional[RequestOptions]
|
|
281
|
+
Request-specific configuration.
|
|
282
|
+
|
|
283
|
+
Returns
|
|
284
|
+
-------
|
|
285
|
+
AsyncHttpResponse[Operation]
|
|
286
|
+
Operation
|
|
287
|
+
"""
|
|
288
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
289
|
+
f"api/v4/operations/{encode_path_param(id)}",
|
|
290
|
+
method="GET",
|
|
291
|
+
request_options=request_options,
|
|
292
|
+
)
|
|
293
|
+
try:
|
|
294
|
+
if 200 <= _response.status_code < 300:
|
|
295
|
+
_data = typing.cast(
|
|
296
|
+
Operation,
|
|
297
|
+
parse_obj_as(
|
|
298
|
+
type_=Operation, # type: ignore
|
|
299
|
+
object_=_response.json(),
|
|
300
|
+
),
|
|
301
|
+
)
|
|
302
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
303
|
+
if _response.status_code == 400:
|
|
304
|
+
raise BadRequestError(
|
|
305
|
+
headers=dict(_response.headers),
|
|
306
|
+
body=typing.cast(
|
|
307
|
+
typing.Any,
|
|
308
|
+
parse_obj_as(
|
|
309
|
+
type_=typing.Any, # type: ignore
|
|
310
|
+
object_=_response.json(),
|
|
311
|
+
),
|
|
312
|
+
),
|
|
313
|
+
)
|
|
314
|
+
if _response.status_code == 403:
|
|
315
|
+
raise ForbiddenError(
|
|
316
|
+
headers=dict(_response.headers),
|
|
317
|
+
body=typing.cast(
|
|
318
|
+
ErrorResponse,
|
|
319
|
+
parse_obj_as(
|
|
320
|
+
type_=ErrorResponse, # type: ignore
|
|
321
|
+
object_=_response.json(),
|
|
322
|
+
),
|
|
323
|
+
),
|
|
324
|
+
)
|
|
325
|
+
if _response.status_code == 404:
|
|
326
|
+
raise NotFoundError(
|
|
327
|
+
headers=dict(_response.headers),
|
|
328
|
+
body=typing.cast(
|
|
329
|
+
ErrorResponse,
|
|
330
|
+
parse_obj_as(
|
|
331
|
+
type_=ErrorResponse, # type: ignore
|
|
332
|
+
object_=_response.json(),
|
|
333
|
+
),
|
|
334
|
+
),
|
|
335
|
+
)
|
|
336
|
+
_response_json = _response.json()
|
|
337
|
+
except JSONDecodeError:
|
|
338
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
339
|
+
except ValidationError as e:
|
|
340
|
+
raise ParsingError(
|
|
341
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
342
|
+
)
|
|
343
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
import typing
|
|
6
|
+
from importlib import import_module
|
|
7
|
+
|
|
8
|
+
if typing.TYPE_CHECKING:
|
|
9
|
+
from .types import (
|
|
10
|
+
AdaptRequestNamespace,
|
|
11
|
+
CreateMppRequestBody,
|
|
12
|
+
CreateMppRequestNamespace,
|
|
13
|
+
DeleteMppRequestNamespace,
|
|
14
|
+
DeleteMppResponse,
|
|
15
|
+
EvaluateDfaRequestNamespace,
|
|
16
|
+
GetMppRequestNamespace,
|
|
17
|
+
GetMppResponse,
|
|
18
|
+
ListMppsRequestNamespace,
|
|
19
|
+
PlanRequestNamespace,
|
|
20
|
+
ValidateRequestNamespace,
|
|
21
|
+
)
|
|
22
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
23
|
+
"AdaptRequestNamespace": ".types",
|
|
24
|
+
"CreateMppRequestBody": ".types",
|
|
25
|
+
"CreateMppRequestNamespace": ".types",
|
|
26
|
+
"DeleteMppRequestNamespace": ".types",
|
|
27
|
+
"DeleteMppResponse": ".types",
|
|
28
|
+
"EvaluateDfaRequestNamespace": ".types",
|
|
29
|
+
"GetMppRequestNamespace": ".types",
|
|
30
|
+
"GetMppResponse": ".types",
|
|
31
|
+
"ListMppsRequestNamespace": ".types",
|
|
32
|
+
"PlanRequestNamespace": ".types",
|
|
33
|
+
"ValidateRequestNamespace": ".types",
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
38
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
39
|
+
if module_name is None:
|
|
40
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
41
|
+
try:
|
|
42
|
+
module = import_module(module_name, __package__)
|
|
43
|
+
if module_name == f".{attr_name}":
|
|
44
|
+
return module
|
|
45
|
+
else:
|
|
46
|
+
return getattr(module, attr_name)
|
|
47
|
+
except ImportError as e:
|
|
48
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
49
|
+
except AttributeError as e:
|
|
50
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def __dir__():
|
|
54
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
55
|
+
return sorted(lazy_attrs)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
__all__ = [
|
|
59
|
+
"AdaptRequestNamespace",
|
|
60
|
+
"CreateMppRequestBody",
|
|
61
|
+
"CreateMppRequestNamespace",
|
|
62
|
+
"DeleteMppRequestNamespace",
|
|
63
|
+
"DeleteMppResponse",
|
|
64
|
+
"EvaluateDfaRequestNamespace",
|
|
65
|
+
"GetMppRequestNamespace",
|
|
66
|
+
"GetMppResponse",
|
|
67
|
+
"ListMppsRequestNamespace",
|
|
68
|
+
"PlanRequestNamespace",
|
|
69
|
+
"ValidateRequestNamespace",
|
|
70
|
+
]
|