hiloop 0.1.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.
- hiloop/__init__.py +8 -0
- hiloop/api/__init__.py +1 -0
- hiloop/api/annotation_schema_service/__init__.py +1 -0
- hiloop/api/annotation_schema_service/annotation_schema_service_archive_annotation_schema.py +176 -0
- hiloop/api/annotation_schema_service/annotation_schema_service_get_annotation_schema.py +176 -0
- hiloop/api/annotation_schema_service/annotation_schema_service_list_annotation_schemas.py +160 -0
- hiloop/api/annotation_schema_service/annotation_schema_service_register_annotation_schema.py +168 -0
- hiloop/api/annotation_service/__init__.py +1 -0
- hiloop/api/annotation_service/annotation_service_annotate.py +160 -0
- hiloop/api/annotation_service/annotation_service_annotate_range.py +164 -0
- hiloop/api/identity_service/__init__.py +1 -0
- hiloop/api/identity_service/identity_service_who_am_i.py +128 -0
- hiloop/api/project_service/__init__.py +1 -0
- hiloop/api/project_service/project_service_create_project.py +158 -0
- hiloop/api/project_service/project_service_get_project.py +151 -0
- hiloop/api/project_service/project_service_list_projects.py +173 -0
- hiloop/api/project_service/project_service_update_project.py +174 -0
- hiloop/api/run_service/__init__.py +1 -0
- hiloop/api/run_service/run_service_get_run.py +151 -0
- hiloop/api/run_service/run_service_list_fork_nodes.py +153 -0
- hiloop/api/run_service/run_service_list_runs.py +235 -0
- hiloop/api/runtime_service/__init__.py +1 -0
- hiloop/api/runtime_service/runtime_service_create_sandbox.py +169 -0
- hiloop/api/runtime_service/runtime_service_create_snapshot.py +185 -0
- hiloop/api/runtime_service/runtime_service_delete_sandbox.py +149 -0
- hiloop/api/runtime_service/runtime_service_delete_snapshot.py +149 -0
- hiloop/api/runtime_service/runtime_service_execute_sandbox.py +185 -0
- hiloop/api/runtime_service/runtime_service_file_from_artifact.py +187 -0
- hiloop/api/runtime_service/runtime_service_file_to_artifact.py +185 -0
- hiloop/api/runtime_service/runtime_service_fork_sandbox.py +183 -0
- hiloop/api/runtime_service/runtime_service_get_artifact.py +147 -0
- hiloop/api/runtime_service/runtime_service_get_execution.py +149 -0
- hiloop/api/runtime_service/runtime_service_get_fork.py +147 -0
- hiloop/api/runtime_service/runtime_service_get_operation.py +149 -0
- hiloop/api/runtime_service/runtime_service_get_sandbox.py +147 -0
- hiloop/api/runtime_service/runtime_service_get_snapshot.py +147 -0
- hiloop/api/runtime_service/runtime_service_kill_execution.py +174 -0
- hiloop/api/runtime_service/runtime_service_list_runtime_capabilities.py +124 -0
- hiloop/api/runtime_service/runtime_service_list_sandboxes.py +199 -0
- hiloop/api/runtime_service/runtime_service_list_snapshots.py +154 -0
- hiloop/api/runtime_service/runtime_service_restore_snapshot.py +187 -0
- hiloop/api/runtime_service/runtime_service_send_execution_input.py +180 -0
- hiloop/api/runtime_service/runtime_service_start_execution.py +182 -0
- hiloop/api/runtime_service/runtime_service_stream_execution.py +151 -0
- hiloop/api/telemetry_query_service/__init__.py +1 -0
- hiloop/api/telemetry_query_service/telemetry_query_service_branch_diff.py +156 -0
- hiloop/api/telemetry_query_service/telemetry_query_service_query.py +156 -0
- hiloop/api/telemetry_query_service/telemetry_query_service_rollup.py +160 -0
- hiloop/api/telemetry_view_service/__init__.py +1 -0
- hiloop/api/telemetry_view_service/telemetry_view_service_delete_data_view.py +153 -0
- hiloop/api/telemetry_view_service/telemetry_view_service_delete_saved_view.py +155 -0
- hiloop/api/telemetry_view_service/telemetry_view_service_list_data_views.py +126 -0
- hiloop/api/telemetry_view_service/telemetry_view_service_list_saved_views.py +126 -0
- hiloop/api/telemetry_view_service/telemetry_view_service_put_data_view.py +180 -0
- hiloop/api/telemetry_view_service/telemetry_view_service_put_saved_view.py +176 -0
- hiloop/api/telemetry_view_service/telemetry_view_service_run_data_view.py +151 -0
- hiloop/api/telemetry_view_service/telemetry_view_service_run_saved_view.py +151 -0
- hiloop/api/usage_service/__init__.py +1 -0
- hiloop/api/usage_service/usage_service_get_usage_series.py +207 -0
- hiloop/api/usage_service/usage_service_get_usage_snapshot.py +164 -0
- hiloop/client.py +268 -0
- hiloop/errors.py +16 -0
- hiloop/models/__init__.py +239 -0
- hiloop/models/annotate_range_request.py +120 -0
- hiloop/models/annotate_request.py +111 -0
- hiloop/models/annotate_response.py +61 -0
- hiloop/models/annotation_schema.py +127 -0
- hiloop/models/archive_annotation_schema_request.py +70 -0
- hiloop/models/archive_annotation_schema_response.py +75 -0
- hiloop/models/artifact.py +115 -0
- hiloop/models/attribute_value.py +89 -0
- hiloop/models/branch_diff_request.py +78 -0
- hiloop/models/branch_diff_response.py +80 -0
- hiloop/models/branch_diff_spec.py +94 -0
- hiloop/models/build_artifact_image.py +61 -0
- hiloop/models/calculation.py +81 -0
- hiloop/models/calculation_op.py +16 -0
- hiloop/models/capability.py +79 -0
- hiloop/models/capability_requirement.py +79 -0
- hiloop/models/capture_spec.py +81 -0
- hiloop/models/capture_spec_policy.py +10 -0
- hiloop/models/command_spec.py +112 -0
- hiloop/models/command_spec_env.py +47 -0
- hiloop/models/create_project_request.py +70 -0
- hiloop/models/create_project_response.py +74 -0
- hiloop/models/create_sandbox_request.py +214 -0
- hiloop/models/create_sandbox_request_labels.py +47 -0
- hiloop/models/create_sandbox_response.py +92 -0
- hiloop/models/create_snapshot_request.py +118 -0
- hiloop/models/create_snapshot_response.py +74 -0
- hiloop/models/data_view.py +118 -0
- hiloop/models/data_view_spec.py +54 -0
- hiloop/models/delete_data_view_response.py +47 -0
- hiloop/models/delete_sandbox_response.py +74 -0
- hiloop/models/delete_saved_view_response.py +47 -0
- hiloop/models/delete_snapshot_response.py +92 -0
- hiloop/models/egress_policy.py +95 -0
- hiloop/models/egress_policy_mode.py +10 -0
- hiloop/models/exec_exit.py +71 -0
- hiloop/models/exec_output_event.py +93 -0
- hiloop/models/execute_sandbox_request.py +92 -0
- hiloop/models/execute_sandbox_response.py +92 -0
- hiloop/models/execution.py +115 -0
- hiloop/models/file_from_artifact_request.py +79 -0
- hiloop/models/file_from_artifact_response.py +74 -0
- hiloop/models/file_to_artifact_request.py +79 -0
- hiloop/models/file_to_artifact_response.py +74 -0
- hiloop/models/filter_.py +101 -0
- hiloop/models/filter_op.py +16 -0
- hiloop/models/fork.py +142 -0
- hiloop/models/fork_node.py +107 -0
- hiloop/models/fork_sandbox_request.py +259 -0
- hiloop/models/fork_sandbox_request_labels.py +47 -0
- hiloop/models/fork_sandbox_response.py +92 -0
- hiloop/models/get_annotation_schema_response.py +75 -0
- hiloop/models/get_artifact_response.py +83 -0
- hiloop/models/get_execution_response.py +74 -0
- hiloop/models/get_fork_response.py +74 -0
- hiloop/models/get_operation_response.py +74 -0
- hiloop/models/get_project_response.py +74 -0
- hiloop/models/get_run_response.py +76 -0
- hiloop/models/get_sandbox_response.py +74 -0
- hiloop/models/get_snapshot_response.py +74 -0
- hiloop/models/get_usage_series_response.py +79 -0
- hiloop/models/get_usage_snapshot_response.py +74 -0
- hiloop/models/identity.py +100 -0
- hiloop/models/kill_execution_request.py +79 -0
- hiloop/models/kill_execution_request_signal.py +12 -0
- hiloop/models/kill_execution_response.py +47 -0
- hiloop/models/list_annotation_schemas_response.py +81 -0
- hiloop/models/list_data_views_response.py +79 -0
- hiloop/models/list_fork_nodes_response.py +79 -0
- hiloop/models/list_projects_response.py +89 -0
- hiloop/models/list_runs_response.py +89 -0
- hiloop/models/list_runtime_capabilities_response.py +79 -0
- hiloop/models/list_sandboxes_response.py +89 -0
- hiloop/models/list_saved_views_response.py +79 -0
- hiloop/models/list_snapshots_response.py +79 -0
- hiloop/models/oci_image.py +70 -0
- hiloop/models/operation.py +124 -0
- hiloop/models/order.py +72 -0
- hiloop/models/project.py +110 -0
- hiloop/models/provider_native_image.py +62 -0
- hiloop/models/put_data_view_request.py +96 -0
- hiloop/models/put_data_view_request_spec.py +50 -0
- hiloop/models/put_saved_view_request.py +71 -0
- hiloop/models/query_request.py +76 -0
- hiloop/models/query_response.py +79 -0
- hiloop/models/query_spec.py +190 -0
- hiloop/models/register_annotation_schema_request.py +80 -0
- hiloop/models/register_annotation_schema_response.py +75 -0
- hiloop/models/reserved_resources.py +91 -0
- hiloop/models/resource_spec.py +96 -0
- hiloop/models/resource_spec_architecture.py +10 -0
- hiloop/models/restore_snapshot_request.py +241 -0
- hiloop/models/restore_snapshot_request_labels.py +47 -0
- hiloop/models/restore_snapshot_response.py +92 -0
- hiloop/models/rollup_request.py +79 -0
- hiloop/models/rollup_response.py +82 -0
- hiloop/models/rollup_spec.py +98 -0
- hiloop/models/row.py +76 -0
- hiloop/models/row_columns.py +60 -0
- hiloop/models/run.py +145 -0
- hiloop/models/sandbox.py +135 -0
- hiloop/models/sandbox_image.py +111 -0
- hiloop/models/sandbox_state_count.py +71 -0
- hiloop/models/saved_view.py +71 -0
- hiloop/models/secret_binding.py +82 -0
- hiloop/models/send_execution_input_request.py +88 -0
- hiloop/models/send_execution_input_request_signal.py +12 -0
- hiloop/models/send_execution_input_response.py +47 -0
- hiloop/models/snapshot.py +133 -0
- hiloop/models/start_execution_request.py +102 -0
- hiloop/models/start_execution_response.py +74 -0
- hiloop/models/time_range.py +71 -0
- hiloop/models/update_project_request.py +70 -0
- hiloop/models/update_project_response.py +74 -0
- hiloop/models/usage_series_point.py +90 -0
- hiloop/models/usage_snapshot.py +157 -0
- hiloop/models/who_am_i_response.py +76 -0
- hiloop/py.typed +1 -0
- hiloop/types.py +54 -0
- hiloop-0.1.0.dist-info/METADATA +139 -0
- hiloop-0.1.0.dist-info/RECORD +185 -0
- hiloop-0.1.0.dist-info/WHEEL +4 -0
hiloop/__init__.py
ADDED
hiloop/api/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains methods for accessing the API"""
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains endpoint functions for accessing the API"""
|
|
@@ -0,0 +1,176 @@
|
|
|
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.archive_annotation_schema_request import ArchiveAnnotationSchemaRequest
|
|
10
|
+
from ...models.archive_annotation_schema_response import ArchiveAnnotationSchemaResponse
|
|
11
|
+
from ...types import Response
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
name: str,
|
|
16
|
+
*,
|
|
17
|
+
body: ArchiveAnnotationSchemaRequest,
|
|
18
|
+
) -> dict[str, Any]:
|
|
19
|
+
headers: dict[str, Any] = {}
|
|
20
|
+
|
|
21
|
+
_kwargs: dict[str, Any] = {
|
|
22
|
+
"method": "post",
|
|
23
|
+
"url": "/v1/annotation-schemas/{name}:archive".format(
|
|
24
|
+
name=quote(str(name), safe=""),
|
|
25
|
+
),
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
_kwargs["json"] = body.to_dict()
|
|
29
|
+
|
|
30
|
+
headers["Content-Type"] = "application/json"
|
|
31
|
+
|
|
32
|
+
_kwargs["headers"] = headers
|
|
33
|
+
return _kwargs
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _parse_response(
|
|
37
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
38
|
+
) -> ArchiveAnnotationSchemaResponse | None:
|
|
39
|
+
if response.status_code == 200:
|
|
40
|
+
response_200 = ArchiveAnnotationSchemaResponse.from_dict(response.json())
|
|
41
|
+
|
|
42
|
+
return response_200
|
|
43
|
+
|
|
44
|
+
if client.raise_on_unexpected_status:
|
|
45
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
46
|
+
else:
|
|
47
|
+
return None
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def _build_response(
|
|
51
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
52
|
+
) -> Response[ArchiveAnnotationSchemaResponse]:
|
|
53
|
+
return Response(
|
|
54
|
+
status_code=HTTPStatus(response.status_code),
|
|
55
|
+
content=response.content,
|
|
56
|
+
headers=response.headers,
|
|
57
|
+
parsed=_parse_response(client=client, response=response),
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def sync_detailed(
|
|
62
|
+
name: str,
|
|
63
|
+
*,
|
|
64
|
+
client: AuthenticatedClient | Client,
|
|
65
|
+
body: ArchiveAnnotationSchemaRequest,
|
|
66
|
+
) -> Response[ArchiveAnnotationSchemaResponse]:
|
|
67
|
+
"""Archive a schema config version (stamp archived_at; never hard-delete) in the caller's tenant.
|
|
68
|
+
|
|
69
|
+
Args:
|
|
70
|
+
name (str):
|
|
71
|
+
body (ArchiveAnnotationSchemaRequest):
|
|
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[ArchiveAnnotationSchemaResponse]
|
|
79
|
+
"""
|
|
80
|
+
|
|
81
|
+
kwargs = _get_kwargs(
|
|
82
|
+
name=name,
|
|
83
|
+
body=body,
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
response = client.get_httpx_client().request(
|
|
87
|
+
**kwargs,
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
return _build_response(client=client, response=response)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def sync(
|
|
94
|
+
name: str,
|
|
95
|
+
*,
|
|
96
|
+
client: AuthenticatedClient | Client,
|
|
97
|
+
body: ArchiveAnnotationSchemaRequest,
|
|
98
|
+
) -> ArchiveAnnotationSchemaResponse | None:
|
|
99
|
+
"""Archive a schema config version (stamp archived_at; never hard-delete) in the caller's tenant.
|
|
100
|
+
|
|
101
|
+
Args:
|
|
102
|
+
name (str):
|
|
103
|
+
body (ArchiveAnnotationSchemaRequest):
|
|
104
|
+
|
|
105
|
+
Raises:
|
|
106
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
107
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
108
|
+
|
|
109
|
+
Returns:
|
|
110
|
+
ArchiveAnnotationSchemaResponse
|
|
111
|
+
"""
|
|
112
|
+
|
|
113
|
+
return sync_detailed(
|
|
114
|
+
name=name,
|
|
115
|
+
client=client,
|
|
116
|
+
body=body,
|
|
117
|
+
).parsed
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
async def asyncio_detailed(
|
|
121
|
+
name: str,
|
|
122
|
+
*,
|
|
123
|
+
client: AuthenticatedClient | Client,
|
|
124
|
+
body: ArchiveAnnotationSchemaRequest,
|
|
125
|
+
) -> Response[ArchiveAnnotationSchemaResponse]:
|
|
126
|
+
"""Archive a schema config version (stamp archived_at; never hard-delete) in the caller's tenant.
|
|
127
|
+
|
|
128
|
+
Args:
|
|
129
|
+
name (str):
|
|
130
|
+
body (ArchiveAnnotationSchemaRequest):
|
|
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[ArchiveAnnotationSchemaResponse]
|
|
138
|
+
"""
|
|
139
|
+
|
|
140
|
+
kwargs = _get_kwargs(
|
|
141
|
+
name=name,
|
|
142
|
+
body=body,
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
146
|
+
|
|
147
|
+
return _build_response(client=client, response=response)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
async def asyncio(
|
|
151
|
+
name: str,
|
|
152
|
+
*,
|
|
153
|
+
client: AuthenticatedClient | Client,
|
|
154
|
+
body: ArchiveAnnotationSchemaRequest,
|
|
155
|
+
) -> ArchiveAnnotationSchemaResponse | None:
|
|
156
|
+
"""Archive a schema config version (stamp archived_at; never hard-delete) in the caller's tenant.
|
|
157
|
+
|
|
158
|
+
Args:
|
|
159
|
+
name (str):
|
|
160
|
+
body (ArchiveAnnotationSchemaRequest):
|
|
161
|
+
|
|
162
|
+
Raises:
|
|
163
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
164
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
165
|
+
|
|
166
|
+
Returns:
|
|
167
|
+
ArchiveAnnotationSchemaResponse
|
|
168
|
+
"""
|
|
169
|
+
|
|
170
|
+
return (
|
|
171
|
+
await asyncio_detailed(
|
|
172
|
+
name=name,
|
|
173
|
+
client=client,
|
|
174
|
+
body=body,
|
|
175
|
+
)
|
|
176
|
+
).parsed
|
|
@@ -0,0 +1,176 @@
|
|
|
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.get_annotation_schema_response import GetAnnotationSchemaResponse
|
|
10
|
+
from ...types import UNSET, Response, Unset
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs(
|
|
14
|
+
name: str,
|
|
15
|
+
*,
|
|
16
|
+
version: str | Unset = UNSET,
|
|
17
|
+
) -> dict[str, Any]:
|
|
18
|
+
|
|
19
|
+
params: dict[str, Any] = {}
|
|
20
|
+
|
|
21
|
+
params["version"] = version
|
|
22
|
+
|
|
23
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
24
|
+
|
|
25
|
+
_kwargs: dict[str, Any] = {
|
|
26
|
+
"method": "get",
|
|
27
|
+
"url": "/v1/annotation-schemas/{name}".format(
|
|
28
|
+
name=quote(str(name), safe=""),
|
|
29
|
+
),
|
|
30
|
+
"params": params,
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return _kwargs
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _parse_response(
|
|
37
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
38
|
+
) -> GetAnnotationSchemaResponse | None:
|
|
39
|
+
if response.status_code == 200:
|
|
40
|
+
response_200 = GetAnnotationSchemaResponse.from_dict(response.json())
|
|
41
|
+
|
|
42
|
+
return response_200
|
|
43
|
+
|
|
44
|
+
if client.raise_on_unexpected_status:
|
|
45
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
46
|
+
else:
|
|
47
|
+
return None
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def _build_response(
|
|
51
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
52
|
+
) -> Response[GetAnnotationSchemaResponse]:
|
|
53
|
+
return Response(
|
|
54
|
+
status_code=HTTPStatus(response.status_code),
|
|
55
|
+
content=response.content,
|
|
56
|
+
headers=response.headers,
|
|
57
|
+
parsed=_parse_response(client=client, response=response),
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def sync_detailed(
|
|
62
|
+
name: str,
|
|
63
|
+
*,
|
|
64
|
+
client: AuthenticatedClient | Client,
|
|
65
|
+
version: str | Unset = UNSET,
|
|
66
|
+
) -> Response[GetAnnotationSchemaResponse]:
|
|
67
|
+
"""Get a schema config by name (latest live version, or a specific version) in the caller's tenant.
|
|
68
|
+
|
|
69
|
+
Args:
|
|
70
|
+
name (str):
|
|
71
|
+
version (str | Unset):
|
|
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[GetAnnotationSchemaResponse]
|
|
79
|
+
"""
|
|
80
|
+
|
|
81
|
+
kwargs = _get_kwargs(
|
|
82
|
+
name=name,
|
|
83
|
+
version=version,
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
response = client.get_httpx_client().request(
|
|
87
|
+
**kwargs,
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
return _build_response(client=client, response=response)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def sync(
|
|
94
|
+
name: str,
|
|
95
|
+
*,
|
|
96
|
+
client: AuthenticatedClient | Client,
|
|
97
|
+
version: str | Unset = UNSET,
|
|
98
|
+
) -> GetAnnotationSchemaResponse | None:
|
|
99
|
+
"""Get a schema config by name (latest live version, or a specific version) in the caller's tenant.
|
|
100
|
+
|
|
101
|
+
Args:
|
|
102
|
+
name (str):
|
|
103
|
+
version (str | Unset):
|
|
104
|
+
|
|
105
|
+
Raises:
|
|
106
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
107
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
108
|
+
|
|
109
|
+
Returns:
|
|
110
|
+
GetAnnotationSchemaResponse
|
|
111
|
+
"""
|
|
112
|
+
|
|
113
|
+
return sync_detailed(
|
|
114
|
+
name=name,
|
|
115
|
+
client=client,
|
|
116
|
+
version=version,
|
|
117
|
+
).parsed
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
async def asyncio_detailed(
|
|
121
|
+
name: str,
|
|
122
|
+
*,
|
|
123
|
+
client: AuthenticatedClient | Client,
|
|
124
|
+
version: str | Unset = UNSET,
|
|
125
|
+
) -> Response[GetAnnotationSchemaResponse]:
|
|
126
|
+
"""Get a schema config by name (latest live version, or a specific version) in the caller's tenant.
|
|
127
|
+
|
|
128
|
+
Args:
|
|
129
|
+
name (str):
|
|
130
|
+
version (str | Unset):
|
|
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[GetAnnotationSchemaResponse]
|
|
138
|
+
"""
|
|
139
|
+
|
|
140
|
+
kwargs = _get_kwargs(
|
|
141
|
+
name=name,
|
|
142
|
+
version=version,
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
146
|
+
|
|
147
|
+
return _build_response(client=client, response=response)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
async def asyncio(
|
|
151
|
+
name: str,
|
|
152
|
+
*,
|
|
153
|
+
client: AuthenticatedClient | Client,
|
|
154
|
+
version: str | Unset = UNSET,
|
|
155
|
+
) -> GetAnnotationSchemaResponse | None:
|
|
156
|
+
"""Get a schema config by name (latest live version, or a specific version) in the caller's tenant.
|
|
157
|
+
|
|
158
|
+
Args:
|
|
159
|
+
name (str):
|
|
160
|
+
version (str | Unset):
|
|
161
|
+
|
|
162
|
+
Raises:
|
|
163
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
164
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
165
|
+
|
|
166
|
+
Returns:
|
|
167
|
+
GetAnnotationSchemaResponse
|
|
168
|
+
"""
|
|
169
|
+
|
|
170
|
+
return (
|
|
171
|
+
await asyncio_detailed(
|
|
172
|
+
name=name,
|
|
173
|
+
client=client,
|
|
174
|
+
version=version,
|
|
175
|
+
)
|
|
176
|
+
).parsed
|
|
@@ -0,0 +1,160 @@
|
|
|
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.list_annotation_schemas_response import ListAnnotationSchemasResponse
|
|
9
|
+
from ...types import UNSET, Response, Unset
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _get_kwargs(
|
|
13
|
+
*,
|
|
14
|
+
include_archived: bool | Unset = UNSET,
|
|
15
|
+
) -> dict[str, Any]:
|
|
16
|
+
|
|
17
|
+
params: dict[str, Any] = {}
|
|
18
|
+
|
|
19
|
+
params["includeArchived"] = include_archived
|
|
20
|
+
|
|
21
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
22
|
+
|
|
23
|
+
_kwargs: dict[str, Any] = {
|
|
24
|
+
"method": "get",
|
|
25
|
+
"url": "/v1/annotation-schemas",
|
|
26
|
+
"params": params,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return _kwargs
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _parse_response(
|
|
33
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
34
|
+
) -> ListAnnotationSchemasResponse | None:
|
|
35
|
+
if response.status_code == 200:
|
|
36
|
+
response_200 = ListAnnotationSchemasResponse.from_dict(response.json())
|
|
37
|
+
|
|
38
|
+
return response_200
|
|
39
|
+
|
|
40
|
+
if client.raise_on_unexpected_status:
|
|
41
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
42
|
+
else:
|
|
43
|
+
return None
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def _build_response(
|
|
47
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
48
|
+
) -> Response[ListAnnotationSchemasResponse]:
|
|
49
|
+
return Response(
|
|
50
|
+
status_code=HTTPStatus(response.status_code),
|
|
51
|
+
content=response.content,
|
|
52
|
+
headers=response.headers,
|
|
53
|
+
parsed=_parse_response(client=client, response=response),
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def sync_detailed(
|
|
58
|
+
*,
|
|
59
|
+
client: AuthenticatedClient | Client,
|
|
60
|
+
include_archived: bool | Unset = UNSET,
|
|
61
|
+
) -> Response[ListAnnotationSchemasResponse]:
|
|
62
|
+
"""List the schema configs in the caller's tenant. By default the latest live version per name.
|
|
63
|
+
|
|
64
|
+
Args:
|
|
65
|
+
include_archived (bool | Unset):
|
|
66
|
+
|
|
67
|
+
Raises:
|
|
68
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
69
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
70
|
+
|
|
71
|
+
Returns:
|
|
72
|
+
Response[ListAnnotationSchemasResponse]
|
|
73
|
+
"""
|
|
74
|
+
|
|
75
|
+
kwargs = _get_kwargs(
|
|
76
|
+
include_archived=include_archived,
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
response = client.get_httpx_client().request(
|
|
80
|
+
**kwargs,
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
return _build_response(client=client, response=response)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def sync(
|
|
87
|
+
*,
|
|
88
|
+
client: AuthenticatedClient | Client,
|
|
89
|
+
include_archived: bool | Unset = UNSET,
|
|
90
|
+
) -> ListAnnotationSchemasResponse | None:
|
|
91
|
+
"""List the schema configs in the caller's tenant. By default the latest live version per name.
|
|
92
|
+
|
|
93
|
+
Args:
|
|
94
|
+
include_archived (bool | Unset):
|
|
95
|
+
|
|
96
|
+
Raises:
|
|
97
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
98
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
99
|
+
|
|
100
|
+
Returns:
|
|
101
|
+
ListAnnotationSchemasResponse
|
|
102
|
+
"""
|
|
103
|
+
|
|
104
|
+
return sync_detailed(
|
|
105
|
+
client=client,
|
|
106
|
+
include_archived=include_archived,
|
|
107
|
+
).parsed
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
async def asyncio_detailed(
|
|
111
|
+
*,
|
|
112
|
+
client: AuthenticatedClient | Client,
|
|
113
|
+
include_archived: bool | Unset = UNSET,
|
|
114
|
+
) -> Response[ListAnnotationSchemasResponse]:
|
|
115
|
+
"""List the schema configs in the caller's tenant. By default the latest live version per name.
|
|
116
|
+
|
|
117
|
+
Args:
|
|
118
|
+
include_archived (bool | Unset):
|
|
119
|
+
|
|
120
|
+
Raises:
|
|
121
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
122
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
123
|
+
|
|
124
|
+
Returns:
|
|
125
|
+
Response[ListAnnotationSchemasResponse]
|
|
126
|
+
"""
|
|
127
|
+
|
|
128
|
+
kwargs = _get_kwargs(
|
|
129
|
+
include_archived=include_archived,
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
133
|
+
|
|
134
|
+
return _build_response(client=client, response=response)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
async def asyncio(
|
|
138
|
+
*,
|
|
139
|
+
client: AuthenticatedClient | Client,
|
|
140
|
+
include_archived: bool | Unset = UNSET,
|
|
141
|
+
) -> ListAnnotationSchemasResponse | None:
|
|
142
|
+
"""List the schema configs in the caller's tenant. By default the latest live version per name.
|
|
143
|
+
|
|
144
|
+
Args:
|
|
145
|
+
include_archived (bool | Unset):
|
|
146
|
+
|
|
147
|
+
Raises:
|
|
148
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
149
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
150
|
+
|
|
151
|
+
Returns:
|
|
152
|
+
ListAnnotationSchemasResponse
|
|
153
|
+
"""
|
|
154
|
+
|
|
155
|
+
return (
|
|
156
|
+
await asyncio_detailed(
|
|
157
|
+
client=client,
|
|
158
|
+
include_archived=include_archived,
|
|
159
|
+
)
|
|
160
|
+
).parsed
|
|
@@ -0,0 +1,168 @@
|
|
|
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.register_annotation_schema_request import RegisterAnnotationSchemaRequest
|
|
9
|
+
from ...models.register_annotation_schema_response import RegisterAnnotationSchemaResponse
|
|
10
|
+
from ...types import Response
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs(
|
|
14
|
+
*,
|
|
15
|
+
body: RegisterAnnotationSchemaRequest,
|
|
16
|
+
) -> dict[str, Any]:
|
|
17
|
+
headers: dict[str, Any] = {}
|
|
18
|
+
|
|
19
|
+
_kwargs: dict[str, Any] = {
|
|
20
|
+
"method": "post",
|
|
21
|
+
"url": "/v1/annotation-schemas",
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
_kwargs["json"] = body.to_dict()
|
|
25
|
+
|
|
26
|
+
headers["Content-Type"] = "application/json"
|
|
27
|
+
|
|
28
|
+
_kwargs["headers"] = headers
|
|
29
|
+
return _kwargs
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _parse_response(
|
|
33
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
34
|
+
) -> RegisterAnnotationSchemaResponse | None:
|
|
35
|
+
if response.status_code == 200:
|
|
36
|
+
response_200 = RegisterAnnotationSchemaResponse.from_dict(response.json())
|
|
37
|
+
|
|
38
|
+
return response_200
|
|
39
|
+
|
|
40
|
+
if client.raise_on_unexpected_status:
|
|
41
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
42
|
+
else:
|
|
43
|
+
return None
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def _build_response(
|
|
47
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
48
|
+
) -> Response[RegisterAnnotationSchemaResponse]:
|
|
49
|
+
return Response(
|
|
50
|
+
status_code=HTTPStatus(response.status_code),
|
|
51
|
+
content=response.content,
|
|
52
|
+
headers=response.headers,
|
|
53
|
+
parsed=_parse_response(client=client, response=response),
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def sync_detailed(
|
|
58
|
+
*,
|
|
59
|
+
client: AuthenticatedClient | Client,
|
|
60
|
+
body: RegisterAnnotationSchemaRequest,
|
|
61
|
+
) -> Response[RegisterAnnotationSchemaResponse]:
|
|
62
|
+
"""Register a schema config in the caller's tenant. An unseen name starts at version 1; an existing
|
|
63
|
+
name creates the next version after a backward-compatibility check against the latest live
|
|
64
|
+
version (an incompatible change is rejected).
|
|
65
|
+
|
|
66
|
+
Args:
|
|
67
|
+
body (RegisterAnnotationSchemaRequest):
|
|
68
|
+
|
|
69
|
+
Raises:
|
|
70
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
71
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
72
|
+
|
|
73
|
+
Returns:
|
|
74
|
+
Response[RegisterAnnotationSchemaResponse]
|
|
75
|
+
"""
|
|
76
|
+
|
|
77
|
+
kwargs = _get_kwargs(
|
|
78
|
+
body=body,
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
response = client.get_httpx_client().request(
|
|
82
|
+
**kwargs,
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
return _build_response(client=client, response=response)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def sync(
|
|
89
|
+
*,
|
|
90
|
+
client: AuthenticatedClient | Client,
|
|
91
|
+
body: RegisterAnnotationSchemaRequest,
|
|
92
|
+
) -> RegisterAnnotationSchemaResponse | None:
|
|
93
|
+
"""Register a schema config in the caller's tenant. An unseen name starts at version 1; an existing
|
|
94
|
+
name creates the next version after a backward-compatibility check against the latest live
|
|
95
|
+
version (an incompatible change is rejected).
|
|
96
|
+
|
|
97
|
+
Args:
|
|
98
|
+
body (RegisterAnnotationSchemaRequest):
|
|
99
|
+
|
|
100
|
+
Raises:
|
|
101
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
102
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
103
|
+
|
|
104
|
+
Returns:
|
|
105
|
+
RegisterAnnotationSchemaResponse
|
|
106
|
+
"""
|
|
107
|
+
|
|
108
|
+
return sync_detailed(
|
|
109
|
+
client=client,
|
|
110
|
+
body=body,
|
|
111
|
+
).parsed
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
async def asyncio_detailed(
|
|
115
|
+
*,
|
|
116
|
+
client: AuthenticatedClient | Client,
|
|
117
|
+
body: RegisterAnnotationSchemaRequest,
|
|
118
|
+
) -> Response[RegisterAnnotationSchemaResponse]:
|
|
119
|
+
"""Register a schema config in the caller's tenant. An unseen name starts at version 1; an existing
|
|
120
|
+
name creates the next version after a backward-compatibility check against the latest live
|
|
121
|
+
version (an incompatible change is rejected).
|
|
122
|
+
|
|
123
|
+
Args:
|
|
124
|
+
body (RegisterAnnotationSchemaRequest):
|
|
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[RegisterAnnotationSchemaResponse]
|
|
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: RegisterAnnotationSchemaRequest,
|
|
147
|
+
) -> RegisterAnnotationSchemaResponse | None:
|
|
148
|
+
"""Register a schema config in the caller's tenant. An unseen name starts at version 1; an existing
|
|
149
|
+
name creates the next version after a backward-compatibility check against the latest live
|
|
150
|
+
version (an incompatible change is rejected).
|
|
151
|
+
|
|
152
|
+
Args:
|
|
153
|
+
body (RegisterAnnotationSchemaRequest):
|
|
154
|
+
|
|
155
|
+
Raises:
|
|
156
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
157
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
158
|
+
|
|
159
|
+
Returns:
|
|
160
|
+
RegisterAnnotationSchemaResponse
|
|
161
|
+
"""
|
|
162
|
+
|
|
163
|
+
return (
|
|
164
|
+
await asyncio_detailed(
|
|
165
|
+
client=client,
|
|
166
|
+
body=body,
|
|
167
|
+
)
|
|
168
|
+
).parsed
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains endpoint functions for accessing the API"""
|