ivcap_client 0.40.3__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.
Files changed (116) hide show
  1. ivcap_client/__init__.py +26 -0
  2. ivcap_client/api/__init__.py +1 -0
  3. ivcap_client/api/artifact/__init__.py +0 -0
  4. ivcap_client/api/artifact/artifact_list.py +330 -0
  5. ivcap_client/api/artifact/artifact_read.py +183 -0
  6. ivcap_client/api/artifact/artifact_upload.py +368 -0
  7. ivcap_client/api/aspect/__init__.py +0 -0
  8. ivcap_client/api/aspect/aspect_create.py +265 -0
  9. ivcap_client/api/aspect/aspect_list.py +450 -0
  10. ivcap_client/api/aspect/aspect_read.py +183 -0
  11. ivcap_client/api/aspect/aspect_retract.py +185 -0
  12. ivcap_client/api/aspect/aspect_update.py +254 -0
  13. ivcap_client/api/metadata/__init__.py +0 -0
  14. ivcap_client/api/metadata/metadata_add.py +264 -0
  15. ivcap_client/api/metadata/metadata_list.py +418 -0
  16. ivcap_client/api/metadata/metadata_read.py +183 -0
  17. ivcap_client/api/metadata/metadata_revoke.py +185 -0
  18. ivcap_client/api/metadata/metadata_update_record.py +286 -0
  19. ivcap_client/api/openapi/__init__.py +0 -0
  20. ivcap_client/api/openapi/openapi_1openapiopenapi3_json.py +83 -0
  21. ivcap_client/api/order/__init__.py +0 -0
  22. ivcap_client/api/order/order_create.py +210 -0
  23. ivcap_client/api/order/order_list.py +330 -0
  24. ivcap_client/api/order/order_logs.py +230 -0
  25. ivcap_client/api/order/order_metadata.py +298 -0
  26. ivcap_client/api/order/order_products.py +298 -0
  27. ivcap_client/api/order/order_read.py +183 -0
  28. ivcap_client/api/order/order_top.py +211 -0
  29. ivcap_client/api/queue/__init__.py +0 -0
  30. ivcap_client/api/queue/queue_create.py +206 -0
  31. ivcap_client/api/queue/queue_delete.py +176 -0
  32. ivcap_client/api/queue/queue_dequeue.py +204 -0
  33. ivcap_client/api/queue/queue_enqueue.py +252 -0
  34. ivcap_client/api/queue/queue_list.py +330 -0
  35. ivcap_client/api/queue/queue_read.py +183 -0
  36. ivcap_client/api/search/__init__.py +0 -0
  37. ivcap_client/api/search/search_search.py +360 -0
  38. ivcap_client/api/service/__init__.py +0 -0
  39. ivcap_client/api/service/service_create_service.py +258 -0
  40. ivcap_client/api/service/service_delete.py +176 -0
  41. ivcap_client/api/service/service_list.py +330 -0
  42. ivcap_client/api/service/service_read.py +183 -0
  43. ivcap_client/api/service/service_update.py +287 -0
  44. ivcap_client/artifact.py +154 -0
  45. ivcap_client/aspect.py +133 -0
  46. ivcap_client/client/__init__.py +13 -0
  47. ivcap_client/client/client.py +273 -0
  48. ivcap_client/errors.py +25 -0
  49. ivcap_client/excpetions.py +34 -0
  50. ivcap_client/ivcap.py +500 -0
  51. ivcap_client/models/__init__.py +115 -0
  52. ivcap_client/models/add_meta_rt.py +61 -0
  53. ivcap_client/models/artifact_list_item.py +119 -0
  54. ivcap_client/models/artifact_list_item_status.py +12 -0
  55. ivcap_client/models/artifact_list_rt.py +139 -0
  56. ivcap_client/models/artifact_status_rt.py +212 -0
  57. ivcap_client/models/artifact_status_rt_status.py +12 -0
  58. ivcap_client/models/aspect_idrt.py +61 -0
  59. ivcap_client/models/aspect_list_item_rt.py +146 -0
  60. ivcap_client/models/aspect_list_item_rt_content.py +43 -0
  61. ivcap_client/models/aspect_list_rt.py +163 -0
  62. ivcap_client/models/aspect_rt.py +172 -0
  63. ivcap_client/models/aspect_rt_content.py +43 -0
  64. ivcap_client/models/aspectcreate_body.py +48 -0
  65. ivcap_client/models/aspectupdate_body.py +48 -0
  66. ivcap_client/models/bad_request_t.py +63 -0
  67. ivcap_client/models/basic_workflow_opts_t.py +171 -0
  68. ivcap_client/models/createqueueresponse.py +102 -0
  69. ivcap_client/models/invalid_parameter_t.py +81 -0
  70. ivcap_client/models/invalid_scopes_t.py +73 -0
  71. ivcap_client/models/link_t.py +77 -0
  72. ivcap_client/models/list_meta_rt.py +161 -0
  73. ivcap_client/models/message_list.py +110 -0
  74. ivcap_client/models/messagestatus.py +61 -0
  75. ivcap_client/models/metadata_list_item_rt.py +111 -0
  76. ivcap_client/models/metadata_list_item_rt_aspect.py +48 -0
  77. ivcap_client/models/metadata_record_rt.py +162 -0
  78. ivcap_client/models/order_list_item.py +161 -0
  79. ivcap_client/models/order_list_item_status.py +14 -0
  80. ivcap_client/models/order_list_rt.py +138 -0
  81. ivcap_client/models/order_metadata_list_item_rt.py +86 -0
  82. ivcap_client/models/order_request_t.py +118 -0
  83. ivcap_client/models/order_status_rt.py +225 -0
  84. ivcap_client/models/order_status_rt_status.py +14 -0
  85. ivcap_client/models/order_top_result_item.py +95 -0
  86. ivcap_client/models/parameter_def_t.py +166 -0
  87. ivcap_client/models/parameter_opt_t.py +70 -0
  88. ivcap_client/models/parameter_t.py +70 -0
  89. ivcap_client/models/partial_meta_list_t.py +98 -0
  90. ivcap_client/models/partial_product_list_t.py +98 -0
  91. ivcap_client/models/payload_for_create_endpoint.py +84 -0
  92. ivcap_client/models/product_list_item_t.py +117 -0
  93. ivcap_client/models/publishedmessage.py +101 -0
  94. ivcap_client/models/queue_list_item.py +99 -0
  95. ivcap_client/models/queue_list_result.py +124 -0
  96. ivcap_client/models/readqueueresponse.py +173 -0
  97. ivcap_client/models/reference_t.py +70 -0
  98. ivcap_client/models/resource_memory_t.py +72 -0
  99. ivcap_client/models/resource_not_found_t.py +70 -0
  100. ivcap_client/models/search_list_rt.py +115 -0
  101. ivcap_client/models/service_definition_t.py +177 -0
  102. ivcap_client/models/service_list_item.py +139 -0
  103. ivcap_client/models/service_list_rt.py +136 -0
  104. ivcap_client/models/service_status_rt.py +159 -0
  105. ivcap_client/models/service_status_rt_status.py +10 -0
  106. ivcap_client/models/workflow_t.py +111 -0
  107. ivcap_client/order.py +135 -0
  108. ivcap_client/py.typed +1 -0
  109. ivcap_client/service.py +229 -0
  110. ivcap_client/types.py +54 -0
  111. ivcap_client/utils.py +128 -0
  112. ivcap_client-0.40.3.dist-info/AUTHORS.md +5 -0
  113. ivcap_client-0.40.3.dist-info/LICENSE +29 -0
  114. ivcap_client-0.40.3.dist-info/METADATA +231 -0
  115. ivcap_client-0.40.3.dist-info/RECORD +116 -0
  116. ivcap_client-0.40.3.dist-info/WHEEL +4 -0
@@ -0,0 +1,26 @@
1
+ #
2
+ # Copyright (c) 2023 Commonwealth Scientific and Industrial Research Organisation (CSIRO). All rights reserved.
3
+ # Use of this source code is governed by a BSD-style license that can be
4
+ # found in the LICENSE file. See the AUTHORS file for names of contributors.
5
+ #
6
+ """ A client library for accessing IVCAP """
7
+
8
+ # read version from installed package
9
+ try: # Python < 3.10 (backport)
10
+ from importlib_metadata import version
11
+ except ImportError:
12
+ from importlib.metadata import version
13
+ try:
14
+ __version__ = version("ivcap_client")
15
+ except Exception:
16
+ __version__ = "???" # should only happen when running the local examples
17
+
18
+ from .ivcap import IVCAP, URN
19
+ from .service import Service
20
+ from .order import Order
21
+ from .artifact import Artifact
22
+ # from .metadata import Metadata
23
+
24
+ # __all__ = (
25
+ # "IVCAP",
26
+ # )
@@ -0,0 +1 @@
1
+ """Contains methods for accessing the API"""
File without changes
@@ -0,0 +1,330 @@
1
+ import datetime
2
+ from http import HTTPStatus
3
+ from typing import Any, Dict, Optional, Union, cast
4
+
5
+ import httpx
6
+
7
+ from ... import errors
8
+ from ...client import AuthenticatedClient, Client
9
+ from ...models.artifact_list_rt import ArtifactListRT
10
+ from ...models.bad_request_t import BadRequestT
11
+ from ...models.invalid_parameter_t import InvalidParameterT
12
+ from ...models.invalid_scopes_t import InvalidScopesT
13
+ from ...types import UNSET, Response, Unset
14
+
15
+
16
+ def _get_kwargs(
17
+ *,
18
+ limit: Union[Unset, int] = 10,
19
+ page: Union[Unset, str] = UNSET,
20
+ filter_: Union[Unset, str] = UNSET,
21
+ order_by: Union[Unset, str] = UNSET,
22
+ order_desc: Union[Unset, bool] = True,
23
+ at_time: Union[Unset, datetime.datetime] = UNSET,
24
+ ) -> Dict[str, Any]:
25
+ params: Dict[str, Any] = {}
26
+
27
+ params["limit"] = limit
28
+
29
+ params["page"] = page
30
+
31
+ params["filter"] = filter_
32
+
33
+ params["order-by"] = order_by
34
+
35
+ params["order-desc"] = order_desc
36
+
37
+ json_at_time: Union[Unset, str] = UNSET
38
+ if not isinstance(at_time, Unset):
39
+ json_at_time = at_time.isoformat()
40
+ params["at-time"] = json_at_time
41
+
42
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
43
+
44
+ _kwargs: Dict[str, Any] = {
45
+ "method": "get",
46
+ "url": "/1/artifacts",
47
+ "params": params,
48
+ }
49
+
50
+ return _kwargs
51
+
52
+
53
+ def _parse_response(
54
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
55
+ ) -> Optional[Union[Any, ArtifactListRT, BadRequestT, InvalidParameterT, InvalidScopesT]]:
56
+ if response.status_code == HTTPStatus.OK:
57
+ response_200 = ArtifactListRT.from_dict(response.json())
58
+
59
+ return response_200
60
+ if response.status_code == HTTPStatus.BAD_REQUEST:
61
+ response_400 = BadRequestT.from_dict(response.json())
62
+
63
+ return response_400
64
+ if response.status_code == HTTPStatus.UNAUTHORIZED:
65
+ response_401 = cast(Any, None)
66
+ return response_401
67
+ if response.status_code == HTTPStatus.FORBIDDEN:
68
+ response_403 = InvalidScopesT.from_dict(response.json())
69
+
70
+ return response_403
71
+ if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY:
72
+ response_422 = InvalidParameterT.from_dict(response.json())
73
+
74
+ return response_422
75
+ if response.status_code == HTTPStatus.NOT_IMPLEMENTED:
76
+ response_501 = BadRequestT.from_dict(response.json())
77
+
78
+ return response_501
79
+ if response.status_code == HTTPStatus.SERVICE_UNAVAILABLE:
80
+ response_503 = cast(Any, None)
81
+ return response_503
82
+ if client.raise_on_unexpected_status:
83
+ raise errors.UnexpectedStatus(response.status_code, response.content)
84
+ else:
85
+ return None
86
+
87
+
88
+ def _build_response(
89
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
90
+ ) -> Response[Union[Any, ArtifactListRT, BadRequestT, InvalidParameterT, InvalidScopesT]]:
91
+ return Response(
92
+ status_code=HTTPStatus(response.status_code),
93
+ content=response.content,
94
+ headers=response.headers,
95
+ parsed=_parse_response(client=client, response=response),
96
+ )
97
+
98
+
99
+ def sync_detailed(
100
+ *,
101
+ client: AuthenticatedClient,
102
+ limit: Union[Unset, int] = 10,
103
+ page: Union[Unset, str] = UNSET,
104
+ filter_: Union[Unset, str] = UNSET,
105
+ order_by: Union[Unset, str] = UNSET,
106
+ order_desc: Union[Unset, bool] = True,
107
+ at_time: Union[Unset, datetime.datetime] = UNSET,
108
+ ) -> Response[Union[Any, ArtifactListRT, BadRequestT, InvalidParameterT, InvalidScopesT]]:
109
+ """list artifact
110
+
111
+ list artifacts
112
+
113
+ Args:
114
+ limit (Union[Unset, int]): The 'limit' query option sets the maximum number of items
115
+ to be included in the result. Default: 10. Example: 10.
116
+ page (Union[Unset, str]): The content of 'page' is returned in the 'links' part of a
117
+ previous query and
118
+ will when set, ALL other parameters, except for 'limit' are ignored. Example:
119
+ gdsgQwhdgd.
120
+ filter_ (Union[Unset, str]): The 'filter' system query option allows clients to filter a
121
+ collection of
122
+ resources that are addressed by a request URL. The expression specified with 'filter'
123
+ is evaluated for each resource in the collection, and only items where the expression
124
+ evaluates to true are included in the response. Example: name ~= 'Scott%'.
125
+ order_by (Union[Unset, str]): The 'orderby' query option allows clients to request
126
+ resources in either
127
+ ascending order using asc or descending order using desc. If asc or desc not specified,
128
+ then the resources will be ordered in ascending order. The request below orders Trips
129
+ on
130
+ property EndsAt in descending order. Example: orderby=EndsAt.
131
+ order_desc (Union[Unset, bool]): When set order result in descending order. Ascending
132
+ order is the lt. Default: True. Example: True.
133
+ at_time (Union[Unset, datetime.datetime]): Return the state of the respective resources at
134
+ that time [now] Example: 1996-12-19T16:39:57-08:00.
135
+
136
+ Raises:
137
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
138
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
139
+
140
+ Returns:
141
+ Response[Union[Any, ArtifactListRT, BadRequestT, InvalidParameterT, InvalidScopesT]]
142
+ """
143
+
144
+ kwargs = _get_kwargs(
145
+ limit=limit,
146
+ page=page,
147
+ filter_=filter_,
148
+ order_by=order_by,
149
+ order_desc=order_desc,
150
+ at_time=at_time,
151
+ )
152
+
153
+ response = client.get_httpx_client().request(
154
+ **kwargs,
155
+ )
156
+
157
+ return _build_response(client=client, response=response)
158
+
159
+
160
+ def sync(
161
+ *,
162
+ client: AuthenticatedClient,
163
+ limit: Union[Unset, int] = 10,
164
+ page: Union[Unset, str] = UNSET,
165
+ filter_: Union[Unset, str] = UNSET,
166
+ order_by: Union[Unset, str] = UNSET,
167
+ order_desc: Union[Unset, bool] = True,
168
+ at_time: Union[Unset, datetime.datetime] = UNSET,
169
+ ) -> Optional[Union[Any, ArtifactListRT, BadRequestT, InvalidParameterT, InvalidScopesT]]:
170
+ """list artifact
171
+
172
+ list artifacts
173
+
174
+ Args:
175
+ limit (Union[Unset, int]): The 'limit' query option sets the maximum number of items
176
+ to be included in the result. Default: 10. Example: 10.
177
+ page (Union[Unset, str]): The content of 'page' is returned in the 'links' part of a
178
+ previous query and
179
+ will when set, ALL other parameters, except for 'limit' are ignored. Example:
180
+ gdsgQwhdgd.
181
+ filter_ (Union[Unset, str]): The 'filter' system query option allows clients to filter a
182
+ collection of
183
+ resources that are addressed by a request URL. The expression specified with 'filter'
184
+ is evaluated for each resource in the collection, and only items where the expression
185
+ evaluates to true are included in the response. Example: name ~= 'Scott%'.
186
+ order_by (Union[Unset, str]): The 'orderby' query option allows clients to request
187
+ resources in either
188
+ ascending order using asc or descending order using desc. If asc or desc not specified,
189
+ then the resources will be ordered in ascending order. The request below orders Trips
190
+ on
191
+ property EndsAt in descending order. Example: orderby=EndsAt.
192
+ order_desc (Union[Unset, bool]): When set order result in descending order. Ascending
193
+ order is the lt. Default: True. Example: True.
194
+ at_time (Union[Unset, datetime.datetime]): Return the state of the respective resources at
195
+ that time [now] Example: 1996-12-19T16:39:57-08:00.
196
+
197
+ Raises:
198
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
199
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
200
+
201
+ Returns:
202
+ Union[Any, ArtifactListRT, BadRequestT, InvalidParameterT, InvalidScopesT]
203
+ """
204
+
205
+ return sync_detailed(
206
+ client=client,
207
+ limit=limit,
208
+ page=page,
209
+ filter_=filter_,
210
+ order_by=order_by,
211
+ order_desc=order_desc,
212
+ at_time=at_time,
213
+ ).parsed
214
+
215
+
216
+ async def asyncio_detailed(
217
+ *,
218
+ client: AuthenticatedClient,
219
+ limit: Union[Unset, int] = 10,
220
+ page: Union[Unset, str] = UNSET,
221
+ filter_: Union[Unset, str] = UNSET,
222
+ order_by: Union[Unset, str] = UNSET,
223
+ order_desc: Union[Unset, bool] = True,
224
+ at_time: Union[Unset, datetime.datetime] = UNSET,
225
+ ) -> Response[Union[Any, ArtifactListRT, BadRequestT, InvalidParameterT, InvalidScopesT]]:
226
+ """list artifact
227
+
228
+ list artifacts
229
+
230
+ Args:
231
+ limit (Union[Unset, int]): The 'limit' query option sets the maximum number of items
232
+ to be included in the result. Default: 10. Example: 10.
233
+ page (Union[Unset, str]): The content of 'page' is returned in the 'links' part of a
234
+ previous query and
235
+ will when set, ALL other parameters, except for 'limit' are ignored. Example:
236
+ gdsgQwhdgd.
237
+ filter_ (Union[Unset, str]): The 'filter' system query option allows clients to filter a
238
+ collection of
239
+ resources that are addressed by a request URL. The expression specified with 'filter'
240
+ is evaluated for each resource in the collection, and only items where the expression
241
+ evaluates to true are included in the response. Example: name ~= 'Scott%'.
242
+ order_by (Union[Unset, str]): The 'orderby' query option allows clients to request
243
+ resources in either
244
+ ascending order using asc or descending order using desc. If asc or desc not specified,
245
+ then the resources will be ordered in ascending order. The request below orders Trips
246
+ on
247
+ property EndsAt in descending order. Example: orderby=EndsAt.
248
+ order_desc (Union[Unset, bool]): When set order result in descending order. Ascending
249
+ order is the lt. Default: True. Example: True.
250
+ at_time (Union[Unset, datetime.datetime]): Return the state of the respective resources at
251
+ that time [now] Example: 1996-12-19T16:39:57-08:00.
252
+
253
+ Raises:
254
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
255
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
256
+
257
+ Returns:
258
+ Response[Union[Any, ArtifactListRT, BadRequestT, InvalidParameterT, InvalidScopesT]]
259
+ """
260
+
261
+ kwargs = _get_kwargs(
262
+ limit=limit,
263
+ page=page,
264
+ filter_=filter_,
265
+ order_by=order_by,
266
+ order_desc=order_desc,
267
+ at_time=at_time,
268
+ )
269
+
270
+ response = await client.get_async_httpx_client().request(**kwargs)
271
+
272
+ return _build_response(client=client, response=response)
273
+
274
+
275
+ async def asyncio(
276
+ *,
277
+ client: AuthenticatedClient,
278
+ limit: Union[Unset, int] = 10,
279
+ page: Union[Unset, str] = UNSET,
280
+ filter_: Union[Unset, str] = UNSET,
281
+ order_by: Union[Unset, str] = UNSET,
282
+ order_desc: Union[Unset, bool] = True,
283
+ at_time: Union[Unset, datetime.datetime] = UNSET,
284
+ ) -> Optional[Union[Any, ArtifactListRT, BadRequestT, InvalidParameterT, InvalidScopesT]]:
285
+ """list artifact
286
+
287
+ list artifacts
288
+
289
+ Args:
290
+ limit (Union[Unset, int]): The 'limit' query option sets the maximum number of items
291
+ to be included in the result. Default: 10. Example: 10.
292
+ page (Union[Unset, str]): The content of 'page' is returned in the 'links' part of a
293
+ previous query and
294
+ will when set, ALL other parameters, except for 'limit' are ignored. Example:
295
+ gdsgQwhdgd.
296
+ filter_ (Union[Unset, str]): The 'filter' system query option allows clients to filter a
297
+ collection of
298
+ resources that are addressed by a request URL. The expression specified with 'filter'
299
+ is evaluated for each resource in the collection, and only items where the expression
300
+ evaluates to true are included in the response. Example: name ~= 'Scott%'.
301
+ order_by (Union[Unset, str]): The 'orderby' query option allows clients to request
302
+ resources in either
303
+ ascending order using asc or descending order using desc. If asc or desc not specified,
304
+ then the resources will be ordered in ascending order. The request below orders Trips
305
+ on
306
+ property EndsAt in descending order. Example: orderby=EndsAt.
307
+ order_desc (Union[Unset, bool]): When set order result in descending order. Ascending
308
+ order is the lt. Default: True. Example: True.
309
+ at_time (Union[Unset, datetime.datetime]): Return the state of the respective resources at
310
+ that time [now] Example: 1996-12-19T16:39:57-08:00.
311
+
312
+ Raises:
313
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
314
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
315
+
316
+ Returns:
317
+ Union[Any, ArtifactListRT, BadRequestT, InvalidParameterT, InvalidScopesT]
318
+ """
319
+
320
+ return (
321
+ await asyncio_detailed(
322
+ client=client,
323
+ limit=limit,
324
+ page=page,
325
+ filter_=filter_,
326
+ order_by=order_by,
327
+ order_desc=order_desc,
328
+ at_time=at_time,
329
+ )
330
+ ).parsed
@@ -0,0 +1,183 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, Optional, Union, cast
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.artifact_status_rt import ArtifactStatusRT
9
+ from ...models.bad_request_t import BadRequestT
10
+ from ...models.invalid_scopes_t import InvalidScopesT
11
+ from ...models.resource_not_found_t import ResourceNotFoundT
12
+ from ...types import Response
13
+
14
+
15
+ def _get_kwargs(
16
+ id: str,
17
+ ) -> Dict[str, Any]:
18
+ _kwargs: Dict[str, Any] = {
19
+ "method": "get",
20
+ "url": f"/1/artifacts/{id}",
21
+ }
22
+
23
+ return _kwargs
24
+
25
+
26
+ def _parse_response(
27
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
28
+ ) -> Optional[Union[Any, ArtifactStatusRT, BadRequestT, InvalidScopesT, ResourceNotFoundT]]:
29
+ if response.status_code == HTTPStatus.OK:
30
+ response_200 = ArtifactStatusRT.from_dict(response.json())
31
+
32
+ return response_200
33
+ if response.status_code == HTTPStatus.BAD_REQUEST:
34
+ response_400 = BadRequestT.from_dict(response.json())
35
+
36
+ return response_400
37
+ if response.status_code == HTTPStatus.UNAUTHORIZED:
38
+ response_401 = cast(Any, None)
39
+ return response_401
40
+ if response.status_code == HTTPStatus.FORBIDDEN:
41
+ response_403 = InvalidScopesT.from_dict(response.json())
42
+
43
+ return response_403
44
+ if response.status_code == HTTPStatus.NOT_FOUND:
45
+ response_404 = ResourceNotFoundT.from_dict(response.json())
46
+
47
+ return response_404
48
+ if response.status_code == HTTPStatus.NOT_IMPLEMENTED:
49
+ response_501 = BadRequestT.from_dict(response.json())
50
+
51
+ return response_501
52
+ if response.status_code == HTTPStatus.SERVICE_UNAVAILABLE:
53
+ response_503 = cast(Any, None)
54
+ return response_503
55
+ if client.raise_on_unexpected_status:
56
+ raise errors.UnexpectedStatus(response.status_code, response.content)
57
+ else:
58
+ return None
59
+
60
+
61
+ def _build_response(
62
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
63
+ ) -> Response[Union[Any, ArtifactStatusRT, BadRequestT, InvalidScopesT, ResourceNotFoundT]]:
64
+ return Response(
65
+ status_code=HTTPStatus(response.status_code),
66
+ content=response.content,
67
+ headers=response.headers,
68
+ parsed=_parse_response(client=client, response=response),
69
+ )
70
+
71
+
72
+ def sync_detailed(
73
+ id: str,
74
+ *,
75
+ client: AuthenticatedClient,
76
+ ) -> Response[Union[Any, ArtifactStatusRT, BadRequestT, InvalidScopesT, ResourceNotFoundT]]:
77
+ """read artifact
78
+
79
+ Show artifacts by ID
80
+
81
+ Args:
82
+ id (str): ID of artifacts to show Example: urn:ivcap:artifacts.
83
+
84
+ Raises:
85
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
86
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
87
+
88
+ Returns:
89
+ Response[Union[Any, ArtifactStatusRT, BadRequestT, InvalidScopesT, ResourceNotFoundT]]
90
+ """
91
+
92
+ kwargs = _get_kwargs(
93
+ id=id,
94
+ )
95
+
96
+ response = client.get_httpx_client().request(
97
+ **kwargs,
98
+ )
99
+
100
+ return _build_response(client=client, response=response)
101
+
102
+
103
+ def sync(
104
+ id: str,
105
+ *,
106
+ client: AuthenticatedClient,
107
+ ) -> Optional[Union[Any, ArtifactStatusRT, BadRequestT, InvalidScopesT, ResourceNotFoundT]]:
108
+ """read artifact
109
+
110
+ Show artifacts by ID
111
+
112
+ Args:
113
+ id (str): ID of artifacts to show Example: urn:ivcap:artifacts.
114
+
115
+ Raises:
116
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
117
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
118
+
119
+ Returns:
120
+ Union[Any, ArtifactStatusRT, BadRequestT, InvalidScopesT, ResourceNotFoundT]
121
+ """
122
+
123
+ return sync_detailed(
124
+ id=id,
125
+ client=client,
126
+ ).parsed
127
+
128
+
129
+ async def asyncio_detailed(
130
+ id: str,
131
+ *,
132
+ client: AuthenticatedClient,
133
+ ) -> Response[Union[Any, ArtifactStatusRT, BadRequestT, InvalidScopesT, ResourceNotFoundT]]:
134
+ """read artifact
135
+
136
+ Show artifacts by ID
137
+
138
+ Args:
139
+ id (str): ID of artifacts to show Example: urn:ivcap:artifacts.
140
+
141
+ Raises:
142
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
143
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
144
+
145
+ Returns:
146
+ Response[Union[Any, ArtifactStatusRT, BadRequestT, InvalidScopesT, ResourceNotFoundT]]
147
+ """
148
+
149
+ kwargs = _get_kwargs(
150
+ id=id,
151
+ )
152
+
153
+ response = await client.get_async_httpx_client().request(**kwargs)
154
+
155
+ return _build_response(client=client, response=response)
156
+
157
+
158
+ async def asyncio(
159
+ id: str,
160
+ *,
161
+ client: AuthenticatedClient,
162
+ ) -> Optional[Union[Any, ArtifactStatusRT, BadRequestT, InvalidScopesT, ResourceNotFoundT]]:
163
+ """read artifact
164
+
165
+ Show artifacts by ID
166
+
167
+ Args:
168
+ id (str): ID of artifacts to show Example: urn:ivcap:artifacts.
169
+
170
+ Raises:
171
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
172
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
173
+
174
+ Returns:
175
+ Union[Any, ArtifactStatusRT, BadRequestT, InvalidScopesT, ResourceNotFoundT]
176
+ """
177
+
178
+ return (
179
+ await asyncio_detailed(
180
+ id=id,
181
+ client=client,
182
+ )
183
+ ).parsed