octostar-python-client 0.1.759__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.
- octostar/__init__.py +9 -0
- octostar/api/__init__.py +1 -0
- octostar/api/apps/__init__.py +0 -0
- octostar/api/apps/deploy_app.py +210 -0
- octostar/api/apps/execute_app_job.py +188 -0
- octostar/api/apps/get_app_logs.py +210 -0
- octostar/api/apps/get_apps_url.py +188 -0
- octostar/api/apps/get_job_logs.py +210 -0
- octostar/api/apps/get_job_progress.py +162 -0
- octostar/api/apps/kill_job.py +160 -0
- octostar/api/apps/list_app_jobs.py +276 -0
- octostar/api/apps/list_apps.py +251 -0
- octostar/api/apps/set_job_progress.py +216 -0
- octostar/api/apps/undeploy_app.py +160 -0
- octostar/api/metadata/__init__.py +0 -0
- octostar/api/metadata/get_version.py +232 -0
- octostar/api/metadata/get_whoami.py +232 -0
- octostar/api/notifications/__init__.py +0 -0
- octostar/api/notifications/delete_stream.py +222 -0
- octostar/api/notifications/get_subscriptions.py +240 -0
- octostar/api/notifications/publish_notification.py +275 -0
- octostar/api/notifications/pull_events_from_stream.py +282 -0
- octostar/api/notifications/push_event_to_stream.py +265 -0
- octostar/api/notifications/toast.py +264 -0
- octostar/api/ontology/__init__.py +0 -0
- octostar/api/ontology/fetch_ontology_data.py +275 -0
- octostar/api/ontology/get_ontologies.py +237 -0
- octostar/api/ontology/multi_query.py +297 -0
- octostar/api/ontology/query.py +276 -0
- octostar/api/pipeline/__init__.py +1 -0
- octostar/api/pipeline/get_processing_status.py +185 -0
- octostar/api/pipeline/update_processing_status.py +164 -0
- octostar/api/search/__init__.py +0 -0
- octostar/api/search/get_annotations.py +153 -0
- octostar/api/workspace_data/__init__.py +0 -0
- octostar/api/workspace_data/delete_blob.py +212 -0
- octostar/api/workspace_data/delete_entities.py +326 -0
- octostar/api/workspace_data/download_blob.py +235 -0
- octostar/api/workspace_data/get_attachment.py +336 -0
- octostar/api/workspace_data/get_files_tree.py +397 -0
- octostar/api/workspace_data/upload_blob.py +235 -0
- octostar/api/workspace_data/upsert_entities.py +284 -0
- octostar/api/workspace_permissions/__init__.py +0 -0
- octostar/api/workspace_permissions/get_permissions.py +325 -0
- octostar/api/workspace_tags/__init__.py +0 -0
- octostar/api/workspace_tags/delete_tag_from_entities.py +141 -0
- octostar/api/workspace_tags/tag_entities.py +180 -0
- octostar/client.py +492 -0
- octostar/errors.py +50 -0
- octostar/models/__init__.py +249 -0
- octostar/models/acknowledgement.py +74 -0
- octostar/models/acknowledgement_with_data.py +82 -0
- octostar/models/app_status.py +239 -0
- octostar/models/app_status_annotations.py +66 -0
- octostar/models/app_status_labels.py +69 -0
- octostar/models/app_with_url.py +82 -0
- octostar/models/child_processing_status.py +118 -0
- octostar/models/delete_entities_response_401.py +74 -0
- octostar/models/delete_entities_response_409.py +82 -0
- octostar/models/delete_entities_response_500.py +82 -0
- octostar/models/delete_stream_response_401.py +74 -0
- octostar/models/delete_tag_from_entities_response_401.py +74 -0
- octostar/models/deploy_app_json_body.py +90 -0
- octostar/models/deploy_app_json_body_secrets.py +65 -0
- octostar/models/deploy_app_response_200.py +98 -0
- octostar/models/deploy_app_response_200_data.py +60 -0
- octostar/models/deploy_app_response_400.py +82 -0
- octostar/models/deploy_app_response_403.py +82 -0
- octostar/models/deploy_app_response_404.py +82 -0
- octostar/models/deploy_app_response_409.py +82 -0
- octostar/models/deploy_app_response_500.py +82 -0
- octostar/models/entity.py +80 -0
- octostar/models/entity_response.py +99 -0
- octostar/models/entity_response_s3_urls.py +93 -0
- octostar/models/entity_response_s3_urls_additional_property.py +105 -0
- octostar/models/entity_response_s3_urls_additional_property_fields.py +114 -0
- octostar/models/execute_app_job_json_body.py +151 -0
- octostar/models/execute_app_job_json_body_annotation.py +65 -0
- octostar/models/execute_app_job_response_401.py +74 -0
- octostar/models/fetch_ontology_data_response_200.py +60 -0
- octostar/models/fetch_ontology_data_response_401.py +74 -0
- octostar/models/fetch_ontology_data_response_500.py +82 -0
- octostar/models/get_app_logs_response_401.py +74 -0
- octostar/models/get_app_logs_response_404.py +74 -0
- octostar/models/get_app_logs_response_500.py +82 -0
- octostar/models/get_apps_url_json_body.py +76 -0
- octostar/models/get_apps_url_response_401.py +74 -0
- octostar/models/get_apps_url_response_500.py +82 -0
- octostar/models/get_attachment_response_200.py +74 -0
- octostar/models/get_attachment_response_401.py +74 -0
- octostar/models/get_files_tree_response_200.py +106 -0
- octostar/models/get_files_tree_response_200_status.py +8 -0
- octostar/models/get_files_tree_response_400.py +111 -0
- octostar/models/get_files_tree_response_400_data.py +60 -0
- octostar/models/get_files_tree_response_400_status.py +8 -0
- octostar/models/get_files_tree_response_401.py +74 -0
- octostar/models/get_files_tree_response_500.py +111 -0
- octostar/models/get_files_tree_response_500_data.py +60 -0
- octostar/models/get_files_tree_response_500_status.py +8 -0
- octostar/models/get_job_logs_response_401.py +74 -0
- octostar/models/get_job_logs_response_404.py +74 -0
- octostar/models/get_job_logs_response_500.py +82 -0
- octostar/models/get_job_progress_response_401.py +74 -0
- octostar/models/get_object_response_401.py +74 -0
- octostar/models/get_ontologies_response_401.py +74 -0
- octostar/models/get_ontologies_response_500.py +81 -0
- octostar/models/get_permissions_response_200.py +98 -0
- octostar/models/get_permissions_response_400.py +82 -0
- octostar/models/get_permissions_response_401.py +74 -0
- octostar/models/get_permissions_response_500.py +82 -0
- octostar/models/get_processing_status_response_200.py +104 -0
- octostar/models/get_processing_status_response_200_data.py +87 -0
- octostar/models/get_processing_status_response_400.py +82 -0
- octostar/models/get_processing_status_response_500.py +82 -0
- octostar/models/get_subscriptions_response_200_item.py +74 -0
- octostar/models/get_version_response_200.py +74 -0
- octostar/models/get_version_response_404.py +74 -0
- octostar/models/get_whoami_response_200.py +129 -0
- octostar/models/get_whoami_response_401.py +74 -0
- octostar/models/insert_entity.py +114 -0
- octostar/models/insert_entity_base.py +266 -0
- octostar/models/insert_entity_relationships_item.py +107 -0
- octostar/models/insert_entity_request.py +94 -0
- octostar/models/internal_server_error.py +82 -0
- octostar/models/job_execution_result.py +146 -0
- octostar/models/job_status.py +196 -0
- octostar/models/job_status_labels.py +60 -0
- octostar/models/job_with_url.py +82 -0
- octostar/models/kill_job_response_401.py +74 -0
- octostar/models/list_app_jobs_response_401.py +74 -0
- octostar/models/list_app_jobs_response_500.py +82 -0
- octostar/models/list_apps_response_401.py +74 -0
- octostar/models/list_apps_response_500.py +82 -0
- octostar/models/multi_query_json_body.py +100 -0
- octostar/models/multi_query_json_body_queries_item.py +80 -0
- octostar/models/multi_query_response_400.py +82 -0
- octostar/models/multi_query_response_401.py +74 -0
- octostar/models/not_found_error.py +74 -0
- octostar/models/octostar_event.py +96 -0
- octostar/models/octostar_event_octostar_payload.py +100 -0
- octostar/models/octostar_event_octostar_payload_level.py +11 -0
- octostar/models/os_notification.py +122 -0
- octostar/models/processing_status.py +262 -0
- octostar/models/processing_status_code.py +14 -0
- octostar/models/progress_request.py +73 -0
- octostar/models/publish_notification_response_401.py +74 -0
- octostar/models/pull_events_from_stream_response_401.py +74 -0
- octostar/models/push_event_to_stream_response_401.py +74 -0
- octostar/models/query_json_body.py +101 -0
- octostar/models/query_json_body_params.py +60 -0
- octostar/models/query_response_400.py +82 -0
- octostar/models/query_response_401.py +74 -0
- octostar/models/set_job_progress_response_401.py +74 -0
- octostar/models/string_to_value_label_map.py +99 -0
- octostar/models/string_to_value_label_map_data.py +89 -0
- octostar/models/string_to_value_label_map_data_additional_property.py +80 -0
- octostar/models/successful_get_tags.py +103 -0
- octostar/models/successful_insertion.py +98 -0
- octostar/models/tag_entities_response_401.py +74 -0
- octostar/models/toast_level.py +11 -0
- octostar/models/toast_response_401.py +74 -0
- octostar/models/undeploy_app_response_401.py +74 -0
- octostar/models/update_processing_status_response_200.py +82 -0
- octostar/models/update_processing_status_response_400.py +82 -0
- octostar/models/update_processing_status_response_500.py +82 -0
- octostar/models/upsert_entities_response_401.py +74 -0
- octostar/models/upsert_entity.py +114 -0
- octostar/models/upsert_entity_base.py +266 -0
- octostar/models/upsert_entity_relationships_item.py +107 -0
- octostar/py.typed +1 -0
- octostar/types.py +54 -0
- octostar/utils/__init__.py +15 -0
- octostar/utils/chat/__init__.py +0 -0
- octostar/utils/chat/chat.py +513 -0
- octostar/utils/chat/detokenize.py +105 -0
- octostar/utils/chat/get_default_model.py +50 -0
- octostar/utils/chat/list_models.py +91 -0
- octostar/utils/chat/tokenize.py +105 -0
- octostar/utils/commons.py +226 -0
- octostar/utils/exceptions.py +134 -0
- octostar/utils/jobs/__init__.py +0 -0
- octostar/utils/jobs/apps/__init__.py +0 -0
- octostar/utils/jobs/apps/deploy_app.py +81 -0
- octostar/utils/jobs/apps/execute_app_job.py +114 -0
- octostar/utils/jobs/apps/get_app_logs.py +113 -0
- octostar/utils/jobs/apps/get_app_secret.py +102 -0
- octostar/utils/jobs/apps/get_apps_url.py +73 -0
- octostar/utils/jobs/apps/list_app_jobs.py +62 -0
- octostar/utils/jobs/apps/list_apps.py +126 -0
- octostar/utils/jobs/apps/undeploy_app.py +48 -0
- octostar/utils/jobs/get_job_logs.py +113 -0
- octostar/utils/jobs/get_job_progress.py +76 -0
- octostar/utils/jobs/kill_job.py +47 -0
- octostar/utils/jobs/set_job_progress.py +67 -0
- octostar/utils/meta/__init__.py +0 -0
- octostar/utils/meta/get_version.py +30 -0
- octostar/utils/meta/get_whoami.py +30 -0
- octostar/utils/notifications/__init__.py +0 -0
- octostar/utils/notifications/delete_stream.py +58 -0
- octostar/utils/notifications/get_my_subscriptions.py +49 -0
- octostar/utils/notifications/publish_notification.py +73 -0
- octostar/utils/notifications/pull_event_from_stream.py +63 -0
- octostar/utils/notifications/pull_events_from_stream.py +64 -0
- octostar/utils/notifications/push_event_to_stream.py +109 -0
- octostar/utils/notifications/push_events_to_stream.py +137 -0
- octostar/utils/notifications/toast.py +92 -0
- octostar/utils/ontology/__init__.py +10 -0
- octostar/utils/ontology/fetch_ontology_data.py +141 -0
- octostar/utils/ontology/get_ontologies.py +55 -0
- octostar/utils/ontology/multiquery_ontology.py +287 -0
- octostar/utils/ontology/query_ontology.py +186 -0
- octostar/utils/pipeline/__init__.py +1 -0
- octostar/utils/pipeline/get_processing_status.py +230 -0
- octostar/utils/pipeline/update_processing_status.py +286 -0
- octostar/utils/search/__init__.py +11 -0
- octostar/utils/search/bulk_update.py +138 -0
- octostar/utils/search/count.py +117 -0
- octostar/utils/search/get_entity_annotations.py +304 -0
- octostar/utils/search/get_index_definition.py +111 -0
- octostar/utils/search/multi_search.py +129 -0
- octostar/utils/workspace/__init__.py +0 -0
- octostar/utils/workspace/delete_entities.py +247 -0
- octostar/utils/workspace/delete_entity.py +81 -0
- octostar/utils/workspace/delete_relationship.py +78 -0
- octostar/utils/workspace/delete_relationships.py +85 -0
- octostar/utils/workspace/delete_temporary_blob.py +85 -0
- octostar/utils/workspace/extract_entities.py +140 -0
- octostar/utils/workspace/get_filepath_from_item.py +85 -0
- octostar/utils/workspace/get_filepaths_from_items.py +100 -0
- octostar/utils/workspace/get_files_tree.py +102 -0
- octostar/utils/workspace/get_item_from_filepath.py +102 -0
- octostar/utils/workspace/get_items_from_filepaths.py +108 -0
- octostar/utils/workspace/linkcharts/__init__.py +0 -0
- octostar/utils/workspace/linkcharts/create_linkchart.py +241 -0
- octostar/utils/workspace/permissions/PermissionLevel.py +8 -0
- octostar/utils/workspace/permissions/__init__.py +1 -0
- octostar/utils/workspace/permissions/get_permissions.py +81 -0
- octostar/utils/workspace/read_attachment.py +284 -0
- octostar/utils/workspace/read_file.py +113 -0
- octostar/utils/workspace/read_temporary_blob.py +428 -0
- octostar/utils/workspace/saved_searches/__init__.py +0 -0
- octostar/utils/workspace/saved_searches/create_saved_search.py +183 -0
- octostar/utils/workspace/tags/__init__.py +0 -0
- octostar/utils/workspace/tags/delete_tag_from_entities.py +96 -0
- octostar/utils/workspace/tags/tag_entities.py +175 -0
- octostar/utils/workspace/upsert_entities.py +268 -0
- octostar/utils/workspace/upsert_entity.py +110 -0
- octostar/utils/workspace/upsert_relationship.py +128 -0
- octostar/utils/workspace/upsert_relationships.py +194 -0
- octostar/utils/workspace/write_attachment.py +263 -0
- octostar/utils/workspace/write_file.py +335 -0
- octostar/utils/workspace/write_temporary_blob.py +218 -0
- octostar_python_client-0.1.759.dist-info/METADATA +159 -0
- octostar_python_client-0.1.759.dist-info/RECORD +257 -0
- octostar_python_client-0.1.759.dist-info/WHEEL +5 -0
- octostar_python_client-0.1.759.dist-info/licenses/LICENSE +21 -0
- octostar_python_client-0.1.759.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Dict, List, Optional, Union, cast
|
|
3
|
+
from warnings import warn
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ...client import AuthenticatedClient, Client, get_default_client
|
|
8
|
+
from ...types import Response, UNSET
|
|
9
|
+
from ... import errors
|
|
10
|
+
|
|
11
|
+
from ...types import UNSET, Unset
|
|
12
|
+
from ...models.fetch_ontology_data_response_200 import FetchOntologyDataResponse200
|
|
13
|
+
from typing import Union
|
|
14
|
+
from typing import cast
|
|
15
|
+
from ...models.fetch_ontology_data_response_500 import FetchOntologyDataResponse500
|
|
16
|
+
from ...models.fetch_ontology_data_response_401 import FetchOntologyDataResponse401
|
|
17
|
+
from typing import Dict
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
client_missing_msg = """No client was passed to this function. The default admin client will be used, but this is deprecated and will be removed soon.
|
|
21
|
+
Please create a client using octostar.client.make_client() and run the function via client.execute()."""
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _get_kwargs(
|
|
25
|
+
*,
|
|
26
|
+
client: Client = None,
|
|
27
|
+
accept: Union[Unset, str] = "application/json",
|
|
28
|
+
) -> Dict[str, Any]:
|
|
29
|
+
if not client:
|
|
30
|
+
warn(client_missing_msg, FutureWarning, stacklevel=2)
|
|
31
|
+
client = get_default_client()
|
|
32
|
+
# raise RuntimeError("Missing client!")
|
|
33
|
+
|
|
34
|
+
base_url = client.get_base_url_v1()
|
|
35
|
+
url = "{}/api/v1/ontology/fetch_ontology_data".format(base_url)
|
|
36
|
+
|
|
37
|
+
headers: Dict[str, str] = client.get_headers()
|
|
38
|
+
cookies: Dict[str, Any] = client.get_cookies()
|
|
39
|
+
|
|
40
|
+
if not isinstance(accept, Unset):
|
|
41
|
+
headers["Accept"] = accept
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
"method": "get",
|
|
45
|
+
"url": url,
|
|
46
|
+
"headers": headers,
|
|
47
|
+
"cookies": cookies,
|
|
48
|
+
"timeout": client.get_timeout(),
|
|
49
|
+
"follow_redirects": client.follow_redirects,
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def _parse_response(*, client: Client = None, response: httpx.Response) -> Optional[
|
|
54
|
+
Union[
|
|
55
|
+
FetchOntologyDataResponse200,
|
|
56
|
+
FetchOntologyDataResponse401,
|
|
57
|
+
FetchOntologyDataResponse500,
|
|
58
|
+
]
|
|
59
|
+
]:
|
|
60
|
+
if not client:
|
|
61
|
+
warn(client_missing_msg, FutureWarning, stacklevel=2)
|
|
62
|
+
client = get_default_client()
|
|
63
|
+
# raise RuntimeError("Missing client!")
|
|
64
|
+
if response.status_code == HTTPStatus.OK:
|
|
65
|
+
response_200 = FetchOntologyDataResponse200.from_dict(response.json())
|
|
66
|
+
|
|
67
|
+
return response_200
|
|
68
|
+
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
|
69
|
+
response_401 = FetchOntologyDataResponse401.from_dict(response.json())
|
|
70
|
+
|
|
71
|
+
return response_401
|
|
72
|
+
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
73
|
+
response_500 = FetchOntologyDataResponse500.from_dict(response.json())
|
|
74
|
+
|
|
75
|
+
return response_500
|
|
76
|
+
if client.raise_on_unexpected_status:
|
|
77
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
78
|
+
else:
|
|
79
|
+
return None
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def _build_response(*, client: Client = None, response: httpx.Response) -> Response[
|
|
83
|
+
Union[
|
|
84
|
+
FetchOntologyDataResponse200,
|
|
85
|
+
FetchOntologyDataResponse401,
|
|
86
|
+
FetchOntologyDataResponse500,
|
|
87
|
+
]
|
|
88
|
+
]:
|
|
89
|
+
if not client:
|
|
90
|
+
warn(client_missing_msg, FutureWarning, stacklevel=2)
|
|
91
|
+
client = get_default_client()
|
|
92
|
+
# raise RuntimeError("Missing client!")
|
|
93
|
+
response_kwargs = {
|
|
94
|
+
"status_code": HTTPStatus(response.status_code),
|
|
95
|
+
"content": response.content,
|
|
96
|
+
"headers": response.headers,
|
|
97
|
+
"parsed": _parse_response(client=client, response=response),
|
|
98
|
+
}
|
|
99
|
+
return Response(**response_kwargs)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def _build_chunk_response(
|
|
103
|
+
*, client: Client = None, response: httpx.Response, chunk: bytes
|
|
104
|
+
) -> Response[
|
|
105
|
+
Union[
|
|
106
|
+
FetchOntologyDataResponse200,
|
|
107
|
+
FetchOntologyDataResponse401,
|
|
108
|
+
FetchOntologyDataResponse500,
|
|
109
|
+
]
|
|
110
|
+
]:
|
|
111
|
+
if not client:
|
|
112
|
+
warn(client_missing_msg, FutureWarning, stacklevel=2)
|
|
113
|
+
client = get_default_client()
|
|
114
|
+
# raise RuntimeError("Missing client!")
|
|
115
|
+
response_kwargs = {
|
|
116
|
+
"status_code": HTTPStatus(response.status_code),
|
|
117
|
+
"content": chunk,
|
|
118
|
+
"headers": response.headers,
|
|
119
|
+
"parsed": None, # cannot parse incomplete chunks of data, we leave it to the user
|
|
120
|
+
}
|
|
121
|
+
return Response(**response_kwargs)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def sync_detailed(
|
|
125
|
+
*,
|
|
126
|
+
client: Client = None,
|
|
127
|
+
accept: Union[Unset, str] = "application/json",
|
|
128
|
+
) -> Response[
|
|
129
|
+
Union[
|
|
130
|
+
FetchOntologyDataResponse200,
|
|
131
|
+
FetchOntologyDataResponse401,
|
|
132
|
+
FetchOntologyDataResponse500,
|
|
133
|
+
]
|
|
134
|
+
]:
|
|
135
|
+
"""## Fetch data of an ontology
|
|
136
|
+
|
|
137
|
+
Fetch data of an ontology
|
|
138
|
+
|
|
139
|
+
### Args:
|
|
140
|
+
* `Accept`: accept (Union[Unset, str]): Default: 'application/json'.
|
|
141
|
+
|
|
142
|
+
### Raises:
|
|
143
|
+
* `errors.UnexpectedStatus`: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
144
|
+
* `httpx.TimeoutException`: If the request takes longer than Client.timeout.
|
|
145
|
+
|
|
146
|
+
## Returns:
|
|
147
|
+
* `Response[Union[FetchOntologyDataResponse200, FetchOntologyDataResponse401, FetchOntologyDataResponse500]]`
|
|
148
|
+
"""
|
|
149
|
+
|
|
150
|
+
if not client:
|
|
151
|
+
warn(client_missing_msg, FutureWarning, stacklevel=2)
|
|
152
|
+
client = get_default_client()
|
|
153
|
+
# raise RuntimeError("Missing client!")
|
|
154
|
+
kwargs = _get_kwargs(
|
|
155
|
+
client=client,
|
|
156
|
+
accept=accept,
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
response = httpx.request(
|
|
160
|
+
verify=client.verify_ssl,
|
|
161
|
+
**kwargs,
|
|
162
|
+
)
|
|
163
|
+
if response.is_error:
|
|
164
|
+
print(
|
|
165
|
+
f"{str(response.status_code)} Error: {response.text} for request",
|
|
166
|
+
str(kwargs),
|
|
167
|
+
)
|
|
168
|
+
return _build_response(client=client, response=response)
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
def sync(
|
|
172
|
+
*,
|
|
173
|
+
client: Client = None,
|
|
174
|
+
accept: Union[Unset, str] = "application/json",
|
|
175
|
+
) -> Optional[
|
|
176
|
+
Union[
|
|
177
|
+
FetchOntologyDataResponse200,
|
|
178
|
+
FetchOntologyDataResponse401,
|
|
179
|
+
FetchOntologyDataResponse500,
|
|
180
|
+
]
|
|
181
|
+
]:
|
|
182
|
+
"""## Fetch data of an ontology
|
|
183
|
+
|
|
184
|
+
Fetch data of an ontology
|
|
185
|
+
|
|
186
|
+
### Args:
|
|
187
|
+
* `Accept`: accept (Union[Unset, str]): Default: 'application/json'.
|
|
188
|
+
|
|
189
|
+
### Raises:
|
|
190
|
+
* `errors.UnexpectedStatus`: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
191
|
+
* `httpx.TimeoutException`: If the request takes longer than Client.timeout.
|
|
192
|
+
|
|
193
|
+
## Returns:
|
|
194
|
+
* `Union[FetchOntologyDataResponse200, FetchOntologyDataResponse401, FetchOntologyDataResponse500]`
|
|
195
|
+
"""
|
|
196
|
+
|
|
197
|
+
return sync_detailed(
|
|
198
|
+
client=client,
|
|
199
|
+
accept=accept,
|
|
200
|
+
).parsed
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
async def asyncio_detailed(
|
|
204
|
+
*,
|
|
205
|
+
client: Client = None,
|
|
206
|
+
accept: Union[Unset, str] = "application/json",
|
|
207
|
+
) -> Response[
|
|
208
|
+
Union[
|
|
209
|
+
FetchOntologyDataResponse200,
|
|
210
|
+
FetchOntologyDataResponse401,
|
|
211
|
+
FetchOntologyDataResponse500,
|
|
212
|
+
]
|
|
213
|
+
]:
|
|
214
|
+
"""## Fetch data of an ontology
|
|
215
|
+
|
|
216
|
+
Fetch data of an ontology
|
|
217
|
+
|
|
218
|
+
### Args:
|
|
219
|
+
* `Accept`: accept (Union[Unset, str]): Default: 'application/json'.
|
|
220
|
+
|
|
221
|
+
### Raises:
|
|
222
|
+
* `errors.UnexpectedStatus`: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
223
|
+
* `httpx.TimeoutException`: If the request takes longer than Client.timeout.
|
|
224
|
+
|
|
225
|
+
## Returns:
|
|
226
|
+
* `Response[Union[FetchOntologyDataResponse200, FetchOntologyDataResponse401, FetchOntologyDataResponse500]]`
|
|
227
|
+
"""
|
|
228
|
+
|
|
229
|
+
if not client:
|
|
230
|
+
warn(client_missing_msg, FutureWarning, stacklevel=2)
|
|
231
|
+
client = get_default_client()
|
|
232
|
+
# raise RuntimeError("Missing client!")
|
|
233
|
+
kwargs = _get_kwargs(
|
|
234
|
+
client=client,
|
|
235
|
+
accept=accept,
|
|
236
|
+
)
|
|
237
|
+
|
|
238
|
+
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
|
239
|
+
response = await _client.request(**kwargs)
|
|
240
|
+
|
|
241
|
+
return _build_response(client=client, response=response)
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
async def asyncio(
|
|
245
|
+
*,
|
|
246
|
+
client: Client = None,
|
|
247
|
+
accept: Union[Unset, str] = "application/json",
|
|
248
|
+
) -> Optional[
|
|
249
|
+
Union[
|
|
250
|
+
FetchOntologyDataResponse200,
|
|
251
|
+
FetchOntologyDataResponse401,
|
|
252
|
+
FetchOntologyDataResponse500,
|
|
253
|
+
]
|
|
254
|
+
]:
|
|
255
|
+
"""## Fetch data of an ontology
|
|
256
|
+
|
|
257
|
+
Fetch data of an ontology
|
|
258
|
+
|
|
259
|
+
### Args:
|
|
260
|
+
* `Accept`: accept (Union[Unset, str]): Default: 'application/json'.
|
|
261
|
+
|
|
262
|
+
### Raises:
|
|
263
|
+
* `errors.UnexpectedStatus`: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
264
|
+
* `httpx.TimeoutException`: If the request takes longer than Client.timeout.
|
|
265
|
+
|
|
266
|
+
## Returns:
|
|
267
|
+
* `Union[FetchOntologyDataResponse200, FetchOntologyDataResponse401, FetchOntologyDataResponse500]`
|
|
268
|
+
"""
|
|
269
|
+
|
|
270
|
+
return (
|
|
271
|
+
await asyncio_detailed(
|
|
272
|
+
client=client,
|
|
273
|
+
accept=accept,
|
|
274
|
+
)
|
|
275
|
+
).parsed
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Dict, List, Optional, Union, cast
|
|
3
|
+
from warnings import warn
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ...client import AuthenticatedClient, Client, get_default_client
|
|
8
|
+
from ...types import Response, UNSET
|
|
9
|
+
from ... import errors
|
|
10
|
+
|
|
11
|
+
from ...types import UNSET, Unset
|
|
12
|
+
from typing import cast, List
|
|
13
|
+
from typing import Union
|
|
14
|
+
from typing import cast
|
|
15
|
+
from ...models.get_ontologies_response_401 import GetOntologiesResponse401
|
|
16
|
+
from ...models.get_ontologies_response_500 import GetOntologiesResponse500
|
|
17
|
+
from typing import Dict
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
client_missing_msg = """No client was passed to this function. The default admin client will be used, but this is deprecated and will be removed soon.
|
|
21
|
+
Please create a client using octostar.client.make_client() and run the function via client.execute()."""
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _get_kwargs(
|
|
25
|
+
*,
|
|
26
|
+
client: Client = None,
|
|
27
|
+
accept: Union[Unset, str] = "application/json",
|
|
28
|
+
) -> Dict[str, Any]:
|
|
29
|
+
if not client:
|
|
30
|
+
warn(client_missing_msg, FutureWarning, stacklevel=2)
|
|
31
|
+
client = get_default_client()
|
|
32
|
+
# raise RuntimeError("Missing client!")
|
|
33
|
+
|
|
34
|
+
base_url = client.get_base_url_v1()
|
|
35
|
+
url = "{}/api/v1/ontology/get_ontologies".format(base_url)
|
|
36
|
+
|
|
37
|
+
headers: Dict[str, str] = client.get_headers()
|
|
38
|
+
cookies: Dict[str, Any] = client.get_cookies()
|
|
39
|
+
|
|
40
|
+
if not isinstance(accept, Unset):
|
|
41
|
+
headers["Accept"] = accept
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
"method": "get",
|
|
45
|
+
"url": url,
|
|
46
|
+
"headers": headers,
|
|
47
|
+
"cookies": cookies,
|
|
48
|
+
"timeout": client.get_timeout(),
|
|
49
|
+
"follow_redirects": client.follow_redirects,
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def _parse_response(
|
|
54
|
+
*, client: Client = None, response: httpx.Response
|
|
55
|
+
) -> Optional[Union[GetOntologiesResponse401, GetOntologiesResponse500, List[str]]]:
|
|
56
|
+
if not client:
|
|
57
|
+
warn(client_missing_msg, FutureWarning, stacklevel=2)
|
|
58
|
+
client = get_default_client()
|
|
59
|
+
# raise RuntimeError("Missing client!")
|
|
60
|
+
if response.status_code == HTTPStatus.OK:
|
|
61
|
+
response_200 = cast(List[str], response.json())
|
|
62
|
+
|
|
63
|
+
return response_200
|
|
64
|
+
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
|
65
|
+
response_401 = GetOntologiesResponse401.from_dict(response.json())
|
|
66
|
+
|
|
67
|
+
return response_401
|
|
68
|
+
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
69
|
+
response_500 = GetOntologiesResponse500.from_dict(response.json())
|
|
70
|
+
|
|
71
|
+
return response_500
|
|
72
|
+
if client.raise_on_unexpected_status:
|
|
73
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
74
|
+
else:
|
|
75
|
+
return None
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def _build_response(
|
|
79
|
+
*, client: Client = None, response: httpx.Response
|
|
80
|
+
) -> Response[Union[GetOntologiesResponse401, GetOntologiesResponse500, List[str]]]:
|
|
81
|
+
if not client:
|
|
82
|
+
warn(client_missing_msg, FutureWarning, stacklevel=2)
|
|
83
|
+
client = get_default_client()
|
|
84
|
+
# raise RuntimeError("Missing client!")
|
|
85
|
+
response_kwargs = {
|
|
86
|
+
"status_code": HTTPStatus(response.status_code),
|
|
87
|
+
"content": response.content,
|
|
88
|
+
"headers": response.headers,
|
|
89
|
+
"parsed": _parse_response(client=client, response=response),
|
|
90
|
+
}
|
|
91
|
+
return Response(**response_kwargs)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def _build_chunk_response(
|
|
95
|
+
*, client: Client = None, response: httpx.Response, chunk: bytes
|
|
96
|
+
) -> Response[Union[GetOntologiesResponse401, GetOntologiesResponse500, List[str]]]:
|
|
97
|
+
if not client:
|
|
98
|
+
warn(client_missing_msg, FutureWarning, stacklevel=2)
|
|
99
|
+
client = get_default_client()
|
|
100
|
+
# raise RuntimeError("Missing client!")
|
|
101
|
+
response_kwargs = {
|
|
102
|
+
"status_code": HTTPStatus(response.status_code),
|
|
103
|
+
"content": chunk,
|
|
104
|
+
"headers": response.headers,
|
|
105
|
+
"parsed": None, # cannot parse incomplete chunks of data, we leave it to the user
|
|
106
|
+
}
|
|
107
|
+
return Response(**response_kwargs)
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
def sync_detailed(
|
|
111
|
+
*,
|
|
112
|
+
client: Client = None,
|
|
113
|
+
accept: Union[Unset, str] = "application/json",
|
|
114
|
+
) -> Response[Union[GetOntologiesResponse401, GetOntologiesResponse500, List[str]]]:
|
|
115
|
+
"""## Get ontologies
|
|
116
|
+
|
|
117
|
+
Get ontologies
|
|
118
|
+
|
|
119
|
+
### Args:
|
|
120
|
+
* `Accept`: accept (Union[Unset, str]): Default: 'application/json'.
|
|
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
|
+
* `Response[Union[GetOntologiesResponse401, GetOntologiesResponse500, List[str]]]`
|
|
128
|
+
"""
|
|
129
|
+
|
|
130
|
+
if not client:
|
|
131
|
+
warn(client_missing_msg, FutureWarning, stacklevel=2)
|
|
132
|
+
client = get_default_client()
|
|
133
|
+
# raise RuntimeError("Missing client!")
|
|
134
|
+
kwargs = _get_kwargs(
|
|
135
|
+
client=client,
|
|
136
|
+
accept=accept,
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
response = httpx.request(
|
|
140
|
+
verify=client.verify_ssl,
|
|
141
|
+
**kwargs,
|
|
142
|
+
)
|
|
143
|
+
if response.is_error:
|
|
144
|
+
print(
|
|
145
|
+
f"{str(response.status_code)} Error: {response.text} for request",
|
|
146
|
+
str(kwargs),
|
|
147
|
+
)
|
|
148
|
+
return _build_response(client=client, response=response)
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
def sync(
|
|
152
|
+
*,
|
|
153
|
+
client: Client = None,
|
|
154
|
+
accept: Union[Unset, str] = "application/json",
|
|
155
|
+
) -> Optional[Union[GetOntologiesResponse401, GetOntologiesResponse500, List[str]]]:
|
|
156
|
+
"""## Get ontologies
|
|
157
|
+
|
|
158
|
+
Get ontologies
|
|
159
|
+
|
|
160
|
+
### Args:
|
|
161
|
+
* `Accept`: accept (Union[Unset, str]): Default: 'application/json'.
|
|
162
|
+
|
|
163
|
+
### Raises:
|
|
164
|
+
* `errors.UnexpectedStatus`: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
165
|
+
* `httpx.TimeoutException`: If the request takes longer than Client.timeout.
|
|
166
|
+
|
|
167
|
+
## Returns:
|
|
168
|
+
* `Union[GetOntologiesResponse401, GetOntologiesResponse500, List[str]]`
|
|
169
|
+
"""
|
|
170
|
+
|
|
171
|
+
return sync_detailed(
|
|
172
|
+
client=client,
|
|
173
|
+
accept=accept,
|
|
174
|
+
).parsed
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
async def asyncio_detailed(
|
|
178
|
+
*,
|
|
179
|
+
client: Client = None,
|
|
180
|
+
accept: Union[Unset, str] = "application/json",
|
|
181
|
+
) -> Response[Union[GetOntologiesResponse401, GetOntologiesResponse500, List[str]]]:
|
|
182
|
+
"""## Get ontologies
|
|
183
|
+
|
|
184
|
+
Get ontologies
|
|
185
|
+
|
|
186
|
+
### Args:
|
|
187
|
+
* `Accept`: accept (Union[Unset, str]): Default: 'application/json'.
|
|
188
|
+
|
|
189
|
+
### Raises:
|
|
190
|
+
* `errors.UnexpectedStatus`: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
191
|
+
* `httpx.TimeoutException`: If the request takes longer than Client.timeout.
|
|
192
|
+
|
|
193
|
+
## Returns:
|
|
194
|
+
* `Response[Union[GetOntologiesResponse401, GetOntologiesResponse500, List[str]]]`
|
|
195
|
+
"""
|
|
196
|
+
|
|
197
|
+
if not client:
|
|
198
|
+
warn(client_missing_msg, FutureWarning, stacklevel=2)
|
|
199
|
+
client = get_default_client()
|
|
200
|
+
# raise RuntimeError("Missing client!")
|
|
201
|
+
kwargs = _get_kwargs(
|
|
202
|
+
client=client,
|
|
203
|
+
accept=accept,
|
|
204
|
+
)
|
|
205
|
+
|
|
206
|
+
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
|
207
|
+
response = await _client.request(**kwargs)
|
|
208
|
+
|
|
209
|
+
return _build_response(client=client, response=response)
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
async def asyncio(
|
|
213
|
+
*,
|
|
214
|
+
client: Client = None,
|
|
215
|
+
accept: Union[Unset, str] = "application/json",
|
|
216
|
+
) -> Optional[Union[GetOntologiesResponse401, GetOntologiesResponse500, List[str]]]:
|
|
217
|
+
"""## Get ontologies
|
|
218
|
+
|
|
219
|
+
Get ontologies
|
|
220
|
+
|
|
221
|
+
### Args:
|
|
222
|
+
* `Accept`: accept (Union[Unset, str]): Default: 'application/json'.
|
|
223
|
+
|
|
224
|
+
### Raises:
|
|
225
|
+
* `errors.UnexpectedStatus`: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
226
|
+
* `httpx.TimeoutException`: If the request takes longer than Client.timeout.
|
|
227
|
+
|
|
228
|
+
## Returns:
|
|
229
|
+
* `Union[GetOntologiesResponse401, GetOntologiesResponse500, List[str]]`
|
|
230
|
+
"""
|
|
231
|
+
|
|
232
|
+
return (
|
|
233
|
+
await asyncio_detailed(
|
|
234
|
+
client=client,
|
|
235
|
+
accept=accept,
|
|
236
|
+
)
|
|
237
|
+
).parsed
|