crypticorn 2.8.0rc2__py3-none-any.whl → 2.8.0rc3__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.
- crypticorn/__init__.py +1 -1
- crypticorn/common/ansi_colors.py +1 -0
- crypticorn/common/logging.py +2 -2
- crypticorn/common/middleware.py +5 -4
- crypticorn/common/mixins.py +3 -2
- crypticorn/common/router/admin_router.py +2 -2
- crypticorn/hive/client/__init__.py +3 -0
- crypticorn/hive/client/api/__init__.py +1 -0
- crypticorn/hive/client/api/admin_api.py +1453 -0
- crypticorn/hive/client/api/models_api.py +7 -7
- crypticorn/hive/client/api/status_api.py +4 -231
- crypticorn/hive/client/models/__init__.py +2 -0
- crypticorn/hive/client/models/log_level.py +38 -0
- crypticorn/hive/client/models/response_getuptime.py +159 -0
- crypticorn/hive/main.py +2 -1
- crypticorn/pay/client/__init__.py +3 -0
- crypticorn/pay/client/api/__init__.py +1 -0
- crypticorn/pay/client/api/admin_api.py +1453 -0
- crypticorn/pay/client/api/status_api.py +4 -231
- crypticorn/pay/client/models/__init__.py +2 -0
- crypticorn/pay/client/models/log_level.py +38 -0
- crypticorn/pay/client/models/response_getuptime.py +159 -0
- crypticorn/pay/client/models/scope.py +2 -0
- crypticorn/pay/main.py +2 -0
- {crypticorn-2.8.0rc2.dist-info → crypticorn-2.8.0rc3.dist-info}/METADATA +1 -1
- {crypticorn-2.8.0rc2.dist-info → crypticorn-2.8.0rc3.dist-info}/RECORD +29 -23
- {crypticorn-2.8.0rc2.dist-info → crypticorn-2.8.0rc3.dist-info}/WHEEL +0 -0
- {crypticorn-2.8.0rc2.dist-info → crypticorn-2.8.0rc3.dist-info}/entry_points.txt +0 -0
- {crypticorn-2.8.0rc2.dist-info → crypticorn-2.8.0rc3.dist-info}/top_level.txt +0 -0
@@ -281,7 +281,7 @@ class ModelsApi:
|
|
281
281
|
|
282
282
|
return self.api_client.param_serialize(
|
283
283
|
method="POST",
|
284
|
-
resource_path="/
|
284
|
+
resource_path="/models/creation",
|
285
285
|
path_params=_path_params,
|
286
286
|
query_params=_query_params,
|
287
287
|
header_params=_header_params,
|
@@ -523,7 +523,7 @@ class ModelsApi:
|
|
523
523
|
|
524
524
|
return self.api_client.param_serialize(
|
525
525
|
method="DELETE",
|
526
|
-
resource_path="/
|
526
|
+
resource_path="/models/{id}",
|
527
527
|
path_params=_path_params,
|
528
528
|
query_params=_query_params,
|
529
529
|
header_params=_header_params,
|
@@ -815,7 +815,7 @@ class ModelsApi:
|
|
815
815
|
|
816
816
|
return self.api_client.param_serialize(
|
817
817
|
method="POST",
|
818
|
-
resource_path="/
|
818
|
+
resource_path="/models/evaluation/{id}",
|
819
819
|
path_params=_path_params,
|
820
820
|
query_params=_query_params,
|
821
821
|
header_params=_header_params,
|
@@ -1057,7 +1057,7 @@ class ModelsApi:
|
|
1057
1057
|
|
1058
1058
|
return self.api_client.param_serialize(
|
1059
1059
|
method="GET",
|
1060
|
-
resource_path="/
|
1060
|
+
resource_path="/models/{id}",
|
1061
1061
|
path_params=_path_params,
|
1062
1062
|
query_params=_query_params,
|
1063
1063
|
header_params=_header_params,
|
@@ -1299,7 +1299,7 @@ class ModelsApi:
|
|
1299
1299
|
|
1300
1300
|
return self.api_client.param_serialize(
|
1301
1301
|
method="GET",
|
1302
|
-
resource_path="/
|
1302
|
+
resource_path="/models/by-name/{name}",
|
1303
1303
|
path_params=_path_params,
|
1304
1304
|
query_params=_query_params,
|
1305
1305
|
header_params=_header_params,
|
@@ -1590,7 +1590,7 @@ class ModelsApi:
|
|
1590
1590
|
|
1591
1591
|
return self.api_client.param_serialize(
|
1592
1592
|
method="GET",
|
1593
|
-
resource_path="/
|
1593
|
+
resource_path="/models",
|
1594
1594
|
path_params=_path_params,
|
1595
1595
|
query_params=_query_params,
|
1596
1596
|
header_params=_header_params,
|
@@ -1857,7 +1857,7 @@ class ModelsApi:
|
|
1857
1857
|
|
1858
1858
|
return self.api_client.param_serialize(
|
1859
1859
|
method="PUT",
|
1860
|
-
resource_path="/
|
1860
|
+
resource_path="/models/{id}",
|
1861
1861
|
path_params=_path_params,
|
1862
1862
|
query_params=_query_params,
|
1863
1863
|
header_params=_header_params,
|
@@ -17,7 +17,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union
|
|
17
17
|
from typing_extensions import Annotated
|
18
18
|
|
19
19
|
from pydantic import StrictStr, field_validator
|
20
|
-
from typing import
|
20
|
+
from typing import Optional
|
21
21
|
|
22
22
|
from crypticorn.hive.client.api_client import ApiClient, RequestSerialized
|
23
23
|
from crypticorn.hive.client.api_response import ApiResponse
|
@@ -36,233 +36,6 @@ class StatusApi:
|
|
36
36
|
api_client = ApiClient.get_default()
|
37
37
|
self.api_client = api_client
|
38
38
|
|
39
|
-
@validate_call
|
40
|
-
async def get_config(
|
41
|
-
self,
|
42
|
-
_request_timeout: Union[
|
43
|
-
None,
|
44
|
-
Annotated[StrictFloat, Field(gt=0)],
|
45
|
-
Tuple[
|
46
|
-
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
47
|
-
],
|
48
|
-
] = None,
|
49
|
-
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
50
|
-
_content_type: Optional[StrictStr] = None,
|
51
|
-
_headers: Optional[Dict[StrictStr, Any]] = None,
|
52
|
-
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
53
|
-
) -> Dict[str, object]:
|
54
|
-
"""Config
|
55
|
-
|
56
|
-
Returns the version of the crypticorn library and the environment.
|
57
|
-
|
58
|
-
:param _request_timeout: timeout setting for this request. If one
|
59
|
-
number provided, it will be total request
|
60
|
-
timeout. It can also be a pair (tuple) of
|
61
|
-
(connection, read) timeouts.
|
62
|
-
:type _request_timeout: int, tuple(int, int), optional
|
63
|
-
:param _request_auth: set to override the auth_settings for an a single
|
64
|
-
request; this effectively ignores the
|
65
|
-
authentication in the spec for a single request.
|
66
|
-
:type _request_auth: dict, optional
|
67
|
-
:param _content_type: force content-type for the request.
|
68
|
-
:type _content_type: str, Optional
|
69
|
-
:param _headers: set to override the headers for a single
|
70
|
-
request; this effectively ignores the headers
|
71
|
-
in the spec for a single request.
|
72
|
-
:type _headers: dict, optional
|
73
|
-
:param _host_index: set to override the host_index for a single
|
74
|
-
request; this effectively ignores the host_index
|
75
|
-
in the spec for a single request.
|
76
|
-
:type _host_index: int, optional
|
77
|
-
:return: Returns the result object.
|
78
|
-
""" # noqa: E501
|
79
|
-
|
80
|
-
_param = self._get_config_serialize(
|
81
|
-
_request_auth=_request_auth,
|
82
|
-
_content_type=_content_type,
|
83
|
-
_headers=_headers,
|
84
|
-
_host_index=_host_index,
|
85
|
-
)
|
86
|
-
|
87
|
-
_response_types_map: Dict[str, Optional[str]] = {
|
88
|
-
"200": "Dict[str, object]",
|
89
|
-
}
|
90
|
-
response_data = await self.api_client.call_api(
|
91
|
-
*_param, _request_timeout=_request_timeout
|
92
|
-
)
|
93
|
-
await response_data.read()
|
94
|
-
return self.api_client.response_deserialize(
|
95
|
-
response_data=response_data,
|
96
|
-
response_types_map=_response_types_map,
|
97
|
-
).data
|
98
|
-
|
99
|
-
@validate_call
|
100
|
-
async def get_config_with_http_info(
|
101
|
-
self,
|
102
|
-
_request_timeout: Union[
|
103
|
-
None,
|
104
|
-
Annotated[StrictFloat, Field(gt=0)],
|
105
|
-
Tuple[
|
106
|
-
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
107
|
-
],
|
108
|
-
] = None,
|
109
|
-
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
110
|
-
_content_type: Optional[StrictStr] = None,
|
111
|
-
_headers: Optional[Dict[StrictStr, Any]] = None,
|
112
|
-
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
113
|
-
) -> ApiResponse[Dict[str, object]]:
|
114
|
-
"""Config
|
115
|
-
|
116
|
-
Returns the version of the crypticorn library and the environment.
|
117
|
-
|
118
|
-
:param _request_timeout: timeout setting for this request. If one
|
119
|
-
number provided, it will be total request
|
120
|
-
timeout. It can also be a pair (tuple) of
|
121
|
-
(connection, read) timeouts.
|
122
|
-
:type _request_timeout: int, tuple(int, int), optional
|
123
|
-
:param _request_auth: set to override the auth_settings for an a single
|
124
|
-
request; this effectively ignores the
|
125
|
-
authentication in the spec for a single request.
|
126
|
-
:type _request_auth: dict, optional
|
127
|
-
:param _content_type: force content-type for the request.
|
128
|
-
:type _content_type: str, Optional
|
129
|
-
:param _headers: set to override the headers for a single
|
130
|
-
request; this effectively ignores the headers
|
131
|
-
in the spec for a single request.
|
132
|
-
:type _headers: dict, optional
|
133
|
-
:param _host_index: set to override the host_index for a single
|
134
|
-
request; this effectively ignores the host_index
|
135
|
-
in the spec for a single request.
|
136
|
-
:type _host_index: int, optional
|
137
|
-
:return: Returns the result object.
|
138
|
-
""" # noqa: E501
|
139
|
-
|
140
|
-
_param = self._get_config_serialize(
|
141
|
-
_request_auth=_request_auth,
|
142
|
-
_content_type=_content_type,
|
143
|
-
_headers=_headers,
|
144
|
-
_host_index=_host_index,
|
145
|
-
)
|
146
|
-
|
147
|
-
_response_types_map: Dict[str, Optional[str]] = {
|
148
|
-
"200": "Dict[str, object]",
|
149
|
-
}
|
150
|
-
response_data = await self.api_client.call_api(
|
151
|
-
*_param, _request_timeout=_request_timeout
|
152
|
-
)
|
153
|
-
await response_data.read()
|
154
|
-
return self.api_client.response_deserialize(
|
155
|
-
response_data=response_data,
|
156
|
-
response_types_map=_response_types_map,
|
157
|
-
)
|
158
|
-
|
159
|
-
@validate_call
|
160
|
-
async def get_config_without_preload_content(
|
161
|
-
self,
|
162
|
-
_request_timeout: Union[
|
163
|
-
None,
|
164
|
-
Annotated[StrictFloat, Field(gt=0)],
|
165
|
-
Tuple[
|
166
|
-
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
167
|
-
],
|
168
|
-
] = None,
|
169
|
-
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
170
|
-
_content_type: Optional[StrictStr] = None,
|
171
|
-
_headers: Optional[Dict[StrictStr, Any]] = None,
|
172
|
-
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
173
|
-
) -> RESTResponseType:
|
174
|
-
"""Config
|
175
|
-
|
176
|
-
Returns the version of the crypticorn library and the environment.
|
177
|
-
|
178
|
-
:param _request_timeout: timeout setting for this request. If one
|
179
|
-
number provided, it will be total request
|
180
|
-
timeout. It can also be a pair (tuple) of
|
181
|
-
(connection, read) timeouts.
|
182
|
-
:type _request_timeout: int, tuple(int, int), optional
|
183
|
-
:param _request_auth: set to override the auth_settings for an a single
|
184
|
-
request; this effectively ignores the
|
185
|
-
authentication in the spec for a single request.
|
186
|
-
:type _request_auth: dict, optional
|
187
|
-
:param _content_type: force content-type for the request.
|
188
|
-
:type _content_type: str, Optional
|
189
|
-
:param _headers: set to override the headers for a single
|
190
|
-
request; this effectively ignores the headers
|
191
|
-
in the spec for a single request.
|
192
|
-
:type _headers: dict, optional
|
193
|
-
:param _host_index: set to override the host_index for a single
|
194
|
-
request; this effectively ignores the host_index
|
195
|
-
in the spec for a single request.
|
196
|
-
:type _host_index: int, optional
|
197
|
-
:return: Returns the result object.
|
198
|
-
""" # noqa: E501
|
199
|
-
|
200
|
-
_param = self._get_config_serialize(
|
201
|
-
_request_auth=_request_auth,
|
202
|
-
_content_type=_content_type,
|
203
|
-
_headers=_headers,
|
204
|
-
_host_index=_host_index,
|
205
|
-
)
|
206
|
-
|
207
|
-
_response_types_map: Dict[str, Optional[str]] = {
|
208
|
-
"200": "Dict[str, object]",
|
209
|
-
}
|
210
|
-
response_data = await self.api_client.call_api(
|
211
|
-
*_param, _request_timeout=_request_timeout
|
212
|
-
)
|
213
|
-
return response_data.response
|
214
|
-
|
215
|
-
def _get_config_serialize(
|
216
|
-
self,
|
217
|
-
_request_auth,
|
218
|
-
_content_type,
|
219
|
-
_headers,
|
220
|
-
_host_index,
|
221
|
-
) -> RequestSerialized:
|
222
|
-
|
223
|
-
_host = None
|
224
|
-
|
225
|
-
_collection_formats: Dict[str, str] = {}
|
226
|
-
|
227
|
-
_path_params: Dict[str, str] = {}
|
228
|
-
_query_params: List[Tuple[str, str]] = []
|
229
|
-
_header_params: Dict[str, Optional[str]] = _headers or {}
|
230
|
-
_form_params: List[Tuple[str, str]] = []
|
231
|
-
_files: Dict[
|
232
|
-
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
233
|
-
] = {}
|
234
|
-
_body_params: Optional[bytes] = None
|
235
|
-
|
236
|
-
# process the path parameters
|
237
|
-
# process the query parameters
|
238
|
-
# process the header parameters
|
239
|
-
# process the form parameters
|
240
|
-
# process the body parameter
|
241
|
-
|
242
|
-
# set the HTTP header `Accept`
|
243
|
-
if "Accept" not in _header_params:
|
244
|
-
_header_params["Accept"] = self.api_client.select_header_accept(
|
245
|
-
["application/json"]
|
246
|
-
)
|
247
|
-
|
248
|
-
# authentication setting
|
249
|
-
_auth_settings: List[str] = []
|
250
|
-
|
251
|
-
return self.api_client.param_serialize(
|
252
|
-
method="GET",
|
253
|
-
resource_path="/config",
|
254
|
-
path_params=_path_params,
|
255
|
-
query_params=_query_params,
|
256
|
-
header_params=_header_params,
|
257
|
-
body=_body_params,
|
258
|
-
post_params=_form_params,
|
259
|
-
files=_files,
|
260
|
-
auth_settings=_auth_settings,
|
261
|
-
collection_formats=_collection_formats,
|
262
|
-
_host=_host,
|
263
|
-
_request_auth=_request_auth,
|
264
|
-
)
|
265
|
-
|
266
39
|
@validate_call
|
267
40
|
async def get_time(
|
268
41
|
self,
|
@@ -281,7 +54,7 @@ class StatusApi:
|
|
281
54
|
) -> str:
|
282
55
|
"""Time
|
283
56
|
|
284
|
-
Returns the current time in
|
57
|
+
Returns the current time in either ISO or Unix timestamp (seconds) format.
|
285
58
|
|
286
59
|
:param type:
|
287
60
|
:type type: str
|
@@ -345,7 +118,7 @@ class StatusApi:
|
|
345
118
|
) -> ApiResponse[str]:
|
346
119
|
"""Time
|
347
120
|
|
348
|
-
Returns the current time in
|
121
|
+
Returns the current time in either ISO or Unix timestamp (seconds) format.
|
349
122
|
|
350
123
|
:param type:
|
351
124
|
:type type: str
|
@@ -409,7 +182,7 @@ class StatusApi:
|
|
409
182
|
) -> RESTResponseType:
|
410
183
|
"""Time
|
411
184
|
|
412
|
-
Returns the current time in
|
185
|
+
Returns the current time in either ISO or Unix timestamp (seconds) format.
|
413
186
|
|
414
187
|
:param type:
|
415
188
|
:type type: str
|
@@ -27,10 +27,12 @@ from crypticorn.hive.client.models.evaluation import Evaluation
|
|
27
27
|
from crypticorn.hive.client.models.evaluation_response import EvaluationResponse
|
28
28
|
from crypticorn.hive.client.models.exception_detail import ExceptionDetail
|
29
29
|
from crypticorn.hive.client.models.feature_size import FeatureSize
|
30
|
+
from crypticorn.hive.client.models.log_level import LogLevel
|
30
31
|
from crypticorn.hive.client.models.model import Model
|
31
32
|
from crypticorn.hive.client.models.model_create import ModelCreate
|
32
33
|
from crypticorn.hive.client.models.model_status import ModelStatus
|
33
34
|
from crypticorn.hive.client.models.model_update import ModelUpdate
|
35
|
+
from crypticorn.hive.client.models.response_getuptime import ResponseGetuptime
|
34
36
|
from crypticorn.hive.client.models.target import Target
|
35
37
|
from crypticorn.hive.client.models.target_info import TargetInfo
|
36
38
|
from crypticorn.hive.client.models.target_type import TargetType
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Hive AI API
|
5
|
+
|
6
|
+
API for Hive AI model training and evaluation
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import json
|
17
|
+
from enum import Enum
|
18
|
+
from typing_extensions import Self
|
19
|
+
|
20
|
+
|
21
|
+
class LogLevel(str, Enum):
|
22
|
+
"""
|
23
|
+
LogLevel
|
24
|
+
"""
|
25
|
+
|
26
|
+
"""
|
27
|
+
allowed enum values
|
28
|
+
"""
|
29
|
+
DEBUG = "DEBUG"
|
30
|
+
INFO = "INFO"
|
31
|
+
WARNING = "WARNING"
|
32
|
+
ERROR = "ERROR"
|
33
|
+
CRITICAL = "CRITICAL"
|
34
|
+
|
35
|
+
@classmethod
|
36
|
+
def from_json(cls, json_str: str) -> Self:
|
37
|
+
"""Create an instance of LogLevel from a JSON string"""
|
38
|
+
return cls(json.loads(json_str))
|
@@ -0,0 +1,159 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Hive AI API
|
5
|
+
|
6
|
+
API for Hive AI model training and evaluation
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
from inspect import getfullargspec
|
17
|
+
import json
|
18
|
+
import pprint
|
19
|
+
import re # noqa: F401
|
20
|
+
from pydantic import (
|
21
|
+
BaseModel,
|
22
|
+
ConfigDict,
|
23
|
+
Field,
|
24
|
+
StrictInt,
|
25
|
+
StrictStr,
|
26
|
+
ValidationError,
|
27
|
+
field_validator,
|
28
|
+
)
|
29
|
+
from typing import Optional
|
30
|
+
from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
|
31
|
+
from typing_extensions import Literal, Self
|
32
|
+
from pydantic import Field
|
33
|
+
|
34
|
+
RESPONSEGETUPTIME_ANY_OF_SCHEMAS = ["int", "str"]
|
35
|
+
|
36
|
+
|
37
|
+
class ResponseGetuptime(BaseModel):
|
38
|
+
"""
|
39
|
+
ResponseGetuptime
|
40
|
+
"""
|
41
|
+
|
42
|
+
# data type: int
|
43
|
+
anyof_schema_1_validator: Optional[StrictInt] = None
|
44
|
+
# data type: str
|
45
|
+
anyof_schema_2_validator: Optional[StrictStr] = None
|
46
|
+
if TYPE_CHECKING:
|
47
|
+
actual_instance: Optional[Union[int, str]] = None
|
48
|
+
else:
|
49
|
+
actual_instance: Any = None
|
50
|
+
any_of_schemas: Set[str] = {"int", "str"}
|
51
|
+
|
52
|
+
model_config = {
|
53
|
+
"validate_assignment": True,
|
54
|
+
"protected_namespaces": (),
|
55
|
+
}
|
56
|
+
|
57
|
+
def __init__(self, *args, **kwargs) -> None:
|
58
|
+
if args:
|
59
|
+
if len(args) > 1:
|
60
|
+
raise ValueError(
|
61
|
+
"If a position argument is used, only 1 is allowed to set `actual_instance`"
|
62
|
+
)
|
63
|
+
if kwargs:
|
64
|
+
raise ValueError(
|
65
|
+
"If a position argument is used, keyword arguments cannot be used."
|
66
|
+
)
|
67
|
+
super().__init__(actual_instance=args[0])
|
68
|
+
else:
|
69
|
+
super().__init__(**kwargs)
|
70
|
+
|
71
|
+
@field_validator("actual_instance")
|
72
|
+
def actual_instance_must_validate_anyof(cls, v):
|
73
|
+
instance = ResponseGetuptime.model_construct()
|
74
|
+
error_messages = []
|
75
|
+
# validate data type: int
|
76
|
+
try:
|
77
|
+
instance.anyof_schema_1_validator = v
|
78
|
+
return v
|
79
|
+
except (ValidationError, ValueError) as e:
|
80
|
+
error_messages.append(str(e))
|
81
|
+
# validate data type: str
|
82
|
+
try:
|
83
|
+
instance.anyof_schema_2_validator = v
|
84
|
+
return v
|
85
|
+
except (ValidationError, ValueError) as e:
|
86
|
+
error_messages.append(str(e))
|
87
|
+
if error_messages:
|
88
|
+
# no match
|
89
|
+
raise ValueError(
|
90
|
+
"No match found when setting the actual_instance in ResponseGetuptime with anyOf schemas: int, str. Details: "
|
91
|
+
+ ", ".join(error_messages)
|
92
|
+
)
|
93
|
+
else:
|
94
|
+
return v
|
95
|
+
|
96
|
+
@classmethod
|
97
|
+
def from_dict(cls, obj: Dict[str, Any]) -> Self:
|
98
|
+
return cls.from_json(json.dumps(obj))
|
99
|
+
|
100
|
+
@classmethod
|
101
|
+
def from_json(cls, json_str: str) -> Self:
|
102
|
+
"""Returns the object represented by the json string"""
|
103
|
+
instance = cls.model_construct()
|
104
|
+
error_messages = []
|
105
|
+
# deserialize data into int
|
106
|
+
try:
|
107
|
+
# validation
|
108
|
+
instance.anyof_schema_1_validator = json.loads(json_str)
|
109
|
+
# assign value to actual_instance
|
110
|
+
instance.actual_instance = instance.anyof_schema_1_validator
|
111
|
+
return instance
|
112
|
+
except (ValidationError, ValueError) as e:
|
113
|
+
error_messages.append(str(e))
|
114
|
+
# deserialize data into str
|
115
|
+
try:
|
116
|
+
# validation
|
117
|
+
instance.anyof_schema_2_validator = json.loads(json_str)
|
118
|
+
# assign value to actual_instance
|
119
|
+
instance.actual_instance = instance.anyof_schema_2_validator
|
120
|
+
return instance
|
121
|
+
except (ValidationError, ValueError) as e:
|
122
|
+
error_messages.append(str(e))
|
123
|
+
|
124
|
+
if error_messages:
|
125
|
+
# no match
|
126
|
+
raise ValueError(
|
127
|
+
"No match found when deserializing the JSON string into ResponseGetuptime with anyOf schemas: int, str. Details: "
|
128
|
+
+ ", ".join(error_messages)
|
129
|
+
)
|
130
|
+
else:
|
131
|
+
return instance
|
132
|
+
|
133
|
+
def to_json(self) -> str:
|
134
|
+
"""Returns the JSON representation of the actual instance"""
|
135
|
+
if self.actual_instance is None:
|
136
|
+
return "null"
|
137
|
+
|
138
|
+
if hasattr(self.actual_instance, "to_json") and callable(
|
139
|
+
self.actual_instance.to_json
|
140
|
+
):
|
141
|
+
return self.actual_instance.to_json()
|
142
|
+
else:
|
143
|
+
return json.dumps(self.actual_instance)
|
144
|
+
|
145
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], int, str]]:
|
146
|
+
"""Returns the dict representation of the actual instance"""
|
147
|
+
if self.actual_instance is None:
|
148
|
+
return None
|
149
|
+
|
150
|
+
if hasattr(self.actual_instance, "to_dict") and callable(
|
151
|
+
self.actual_instance.to_dict
|
152
|
+
):
|
153
|
+
return self.actual_instance.to_dict()
|
154
|
+
else:
|
155
|
+
return self.actual_instance
|
156
|
+
|
157
|
+
def to_str(self) -> str:
|
158
|
+
"""Returns the string representation of the actual instance"""
|
159
|
+
return pprint.pformat(self.model_dump())
|
crypticorn/hive/main.py
CHANGED
@@ -8,9 +8,9 @@ from crypticorn.hive import (
|
|
8
8
|
DataApi,
|
9
9
|
StatusApi,
|
10
10
|
Configuration,
|
11
|
+
AdminApi,
|
11
12
|
)
|
12
13
|
from crypticorn.hive.utils import download_file
|
13
|
-
import logging
|
14
14
|
|
15
15
|
|
16
16
|
class DataApiWrapper(DataApi):
|
@@ -73,3 +73,4 @@ class HiveClient:
|
|
73
73
|
self.models = ModelsApi(self.base_client)
|
74
74
|
self.data = DataApiWrapper(self.base_client)
|
75
75
|
self.status = StatusApi(self.base_client)
|
76
|
+
self.admin = AdminApi(self.base_client)
|
@@ -17,6 +17,7 @@ Do not edit the class manually.
|
|
17
17
|
__version__ = "1.0.0"
|
18
18
|
|
19
19
|
# import apis into sdk package
|
20
|
+
from crypticorn.pay.client.api.admin_api import AdminApi
|
20
21
|
from crypticorn.pay.client.api.now_payments_api import NOWPaymentsApi
|
21
22
|
from crypticorn.pay.client.api.payments_api import PaymentsApi
|
22
23
|
from crypticorn.pay.client.api.products_api import ProductsApi
|
@@ -35,6 +36,7 @@ from crypticorn.pay.client.exceptions import ApiException
|
|
35
36
|
|
36
37
|
# import models into sdk package
|
37
38
|
from crypticorn.pay.client.models.exception_detail import ExceptionDetail
|
39
|
+
from crypticorn.pay.client.models.log_level import LogLevel
|
38
40
|
from crypticorn.pay.client.models.now_create_invoice_req import NowCreateInvoiceReq
|
39
41
|
from crypticorn.pay.client.models.now_create_invoice_res import NowCreateInvoiceRes
|
40
42
|
from crypticorn.pay.client.models.payment import Payment
|
@@ -44,4 +46,5 @@ from crypticorn.pay.client.models.product_read import ProductRead
|
|
44
46
|
from crypticorn.pay.client.models.product_sub_read import ProductSubRead
|
45
47
|
from crypticorn.pay.client.models.product_update import ProductUpdate
|
46
48
|
from crypticorn.pay.client.models.provider import Provider
|
49
|
+
from crypticorn.pay.client.models.response_getuptime import ResponseGetuptime
|
47
50
|
from crypticorn.pay.client.models.scope import Scope
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# flake8: noqa
|
2
2
|
|
3
3
|
# import apis into api package
|
4
|
+
from crypticorn.pay.client.api.admin_api import AdminApi
|
4
5
|
from crypticorn.pay.client.api.now_payments_api import NOWPaymentsApi
|
5
6
|
from crypticorn.pay.client.api.payments_api import PaymentsApi
|
6
7
|
from crypticorn.pay.client.api.products_api import ProductsApi
|