crypticorn 2.11.9__py3-none-any.whl → 2.12.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- crypticorn/common/errors.py +48 -8
- crypticorn/common/exceptions.py +11 -0
- crypticorn/hive/client/__init__.py +1 -0
- crypticorn/hive/client/models/__init__.py +1 -0
- crypticorn/hive/client/models/api_error_identifier.py +2 -0
- crypticorn/hive/client/models/coin_info.py +106 -0
- crypticorn/hive/client/models/data_info.py +17 -6
- crypticorn/hive/client/models/target_info.py +20 -6
- crypticorn/pay/client/__init__.py +5 -3
- crypticorn/pay/client/api/admin_api.py +35 -33
- crypticorn/pay/client/api/now_payments_api.py +476 -5
- crypticorn/pay/client/api/payments_api.py +43 -264
- crypticorn/pay/client/api/products_api.py +16 -16
- crypticorn/pay/client/models/__init__.py +5 -3
- crypticorn/pay/client/models/api_error_identifier.py +117 -0
- crypticorn/pay/client/models/api_error_level.py +37 -0
- crypticorn/pay/client/models/api_error_type.py +37 -0
- crypticorn/pay/client/models/exception_detail.py +7 -4
- crypticorn/pay/client/models/{product_read.py → product.py} +4 -4
- crypticorn/pay/client/models/product_create.py +1 -1
- crypticorn/pay/client/models/scope.py +1 -0
- crypticorn/pay/client/models/{product_sub_read.py → subscription.py} +5 -5
- crypticorn/trade/client/api/api_keys_api.py +61 -19
- crypticorn/trade/client/api/orders_api.py +3 -0
- crypticorn/trade/client/models/api_error_identifier.py +1 -1
- crypticorn/trade/client/models/bot.py +5 -5
- crypticorn/trade/client/models/exchange_key.py +13 -6
- crypticorn/trade/client/models/futures_trading_action.py +5 -5
- crypticorn/trade/client/models/notification.py +5 -5
- crypticorn/trade/client/models/order.py +5 -5
- crypticorn/trade/client/models/strategy.py +5 -5
- {crypticorn-2.11.9.dist-info → crypticorn-2.12.1.dist-info}/METADATA +1 -1
- {crypticorn-2.11.9.dist-info → crypticorn-2.12.1.dist-info}/RECORD +37 -34
- {crypticorn-2.11.9.dist-info → crypticorn-2.12.1.dist-info}/WHEEL +1 -1
- crypticorn/pay/client/models/response_getuptime.py +0 -159
- {crypticorn-2.11.9.dist-info → crypticorn-2.12.1.dist-info}/entry_points.txt +0 -0
- {crypticorn-2.11.9.dist-info → crypticorn-2.12.1.dist-info}/licenses/LICENSE +0 -0
- {crypticorn-2.11.9.dist-info → crypticorn-2.12.1.dist-info}/top_level.txt +0 -0
crypticorn/common/errors.py
CHANGED
@@ -33,6 +33,7 @@ class ApiErrorIdentifier(StrEnum):
|
|
33
33
|
BOT_DISABLED = "bot_disabled"
|
34
34
|
BOT_STOPPING_COMPLETED = "bot_stopping_completed"
|
35
35
|
BOT_STOPPING_STARTED = "bot_stopping_started"
|
36
|
+
CANCELLED_OPEN_ORDER = "cancelled_open_order"
|
36
37
|
CLIENT_ORDER_ID_REPEATED = "client_order_id_already_exists"
|
37
38
|
CONTENT_TYPE_ERROR = "invalid_content_type"
|
38
39
|
DELETE_BOT_ERROR = "delete_bot_error"
|
@@ -51,6 +52,7 @@ class ApiErrorIdentifier(StrEnum):
|
|
51
52
|
EXCHANGE_USER_FROZEN = "exchange_user_account_is_frozen"
|
52
53
|
EXPIRED_API_KEY = "api_key_expired"
|
53
54
|
EXPIRED_BEARER = "bearer_token_expired"
|
55
|
+
FAILED_OPEN_ORDER = "open_order_expired"
|
54
56
|
FORBIDDEN = "forbidden"
|
55
57
|
HEDGE_MODE_NOT_ACTIVE = "hedge_mode_not_active"
|
56
58
|
HTTP_ERROR = "http_request_error"
|
@@ -68,7 +70,7 @@ class ApiErrorIdentifier(StrEnum):
|
|
68
70
|
LEVERAGE_EXCEEDED = "leverage_limit_exceeded"
|
69
71
|
LIQUIDATION_PRICE_VIOLATION = "order_violates_liquidation_price_constraints"
|
70
72
|
MARGIN_MODE_CLASH = "margin_mode_clash"
|
71
|
-
|
73
|
+
NAME_NOT_UNIQUE = "name_not_unique"
|
72
74
|
NO_CREDENTIALS = "no_credentials"
|
73
75
|
NOW_API_DOWN = "now_api_down"
|
74
76
|
OBJECT_ALREADY_EXISTS = "object_already_exists"
|
@@ -84,6 +86,8 @@ class ApiErrorIdentifier(StrEnum):
|
|
84
86
|
ORDER_PRICE_INVALID = "order_price_is_invalid"
|
85
87
|
ORDER_SIZE_TOO_LARGE = "order_size_too_large"
|
86
88
|
ORDER_SIZE_TOO_SMALL = "order_size_too_small"
|
89
|
+
ORPHAN_OPEN_ORDER = "orphan_open_order"
|
90
|
+
ORPHAN_CLOSE_ORDER = "orphan_close_order"
|
87
91
|
POSITION_LIMIT_EXCEEDED = "position_limit_exceeded"
|
88
92
|
POSITION_NOT_FOUND = "position_does_not_exist"
|
89
93
|
POSITION_SUSPENDED = "position_opening_temporarily_suspended"
|
@@ -99,7 +103,7 @@ class ApiErrorIdentifier(StrEnum):
|
|
99
103
|
SUCCESS = "success"
|
100
104
|
SYMBOL_NOT_FOUND = "symbol_does_not_exist"
|
101
105
|
TRADING_ACTION_EXPIRED = "trading_action_expired"
|
102
|
-
|
106
|
+
TRADING_ACTION_SKIPPED_BOT_STOPPING = "TRADING_ACTION_SKIPPED_BOT_STOPPING"
|
103
107
|
TRADING_LOCKED = "trading_has_been_locked"
|
104
108
|
TRADING_SUSPENDED = "trading_is_suspended"
|
105
109
|
UNKNOWN_ERROR = "unknown_error_occurred"
|
@@ -158,6 +162,11 @@ class ApiError(Enum, metaclass=ApiErrorFallback):
|
|
158
162
|
ApiErrorType.NO_ERROR,
|
159
163
|
ApiErrorLevel.INFO,
|
160
164
|
)
|
165
|
+
CANCELLED_OPEN_ORDER = (
|
166
|
+
ApiErrorIdentifier.CANCELLED_OPEN_ORDER,
|
167
|
+
ApiErrorType.NO_ERROR,
|
168
|
+
ApiErrorLevel.INFO,
|
169
|
+
)
|
161
170
|
CLIENT_ORDER_ID_REPEATED = (
|
162
171
|
ApiErrorIdentifier.CLIENT_ORDER_ID_REPEATED,
|
163
172
|
ApiErrorType.SERVER_ERROR,
|
@@ -248,6 +257,11 @@ class ApiError(Enum, metaclass=ApiErrorFallback):
|
|
248
257
|
ApiErrorType.USER_ERROR,
|
249
258
|
ApiErrorLevel.ERROR,
|
250
259
|
)
|
260
|
+
FAILED_OPEN_ORDER = (
|
261
|
+
ApiErrorIdentifier.FAILED_OPEN_ORDER,
|
262
|
+
ApiErrorType.NO_ERROR,
|
263
|
+
ApiErrorLevel.INFO,
|
264
|
+
)
|
251
265
|
FORBIDDEN = (
|
252
266
|
ApiErrorIdentifier.FORBIDDEN,
|
253
267
|
ApiErrorType.USER_ERROR,
|
@@ -333,8 +347,8 @@ class ApiError(Enum, metaclass=ApiErrorFallback):
|
|
333
347
|
ApiErrorType.USER_ERROR,
|
334
348
|
ApiErrorLevel.ERROR,
|
335
349
|
)
|
336
|
-
|
337
|
-
ApiErrorIdentifier.
|
350
|
+
NAME_NOT_UNIQUE = (
|
351
|
+
ApiErrorIdentifier.NAME_NOT_UNIQUE,
|
338
352
|
ApiErrorType.USER_ERROR,
|
339
353
|
ApiErrorLevel.ERROR,
|
340
354
|
)
|
@@ -413,6 +427,16 @@ class ApiError(Enum, metaclass=ApiErrorFallback):
|
|
413
427
|
ApiErrorType.USER_ERROR,
|
414
428
|
ApiErrorLevel.WARNING,
|
415
429
|
)
|
430
|
+
ORPHAN_OPEN_ORDER = (
|
431
|
+
ApiErrorIdentifier.ORPHAN_OPEN_ORDER,
|
432
|
+
ApiErrorType.SERVER_ERROR,
|
433
|
+
ApiErrorLevel.INFO,
|
434
|
+
)
|
435
|
+
ORPHAN_CLOSE_ORDER = (
|
436
|
+
ApiErrorIdentifier.ORPHAN_CLOSE_ORDER,
|
437
|
+
ApiErrorType.NO_ERROR,
|
438
|
+
ApiErrorLevel.INFO,
|
439
|
+
)
|
416
440
|
POSITION_LIMIT_EXCEEDED = (
|
417
441
|
ApiErrorIdentifier.POSITION_LIMIT_EXCEEDED,
|
418
442
|
ApiErrorType.USER_ERROR,
|
@@ -484,8 +508,8 @@ class ApiError(Enum, metaclass=ApiErrorFallback):
|
|
484
508
|
ApiErrorType.NO_ERROR,
|
485
509
|
ApiErrorLevel.INFO,
|
486
510
|
)
|
487
|
-
|
488
|
-
ApiErrorIdentifier.
|
511
|
+
TRADING_ACTION_SKIPPED_BOT_STOPPING = (
|
512
|
+
ApiErrorIdentifier.TRADING_ACTION_SKIPPED_BOT_STOPPING,
|
489
513
|
ApiErrorType.NO_ERROR,
|
490
514
|
ApiErrorLevel.INFO,
|
491
515
|
)
|
@@ -623,7 +647,7 @@ class StatusCodeMapper:
|
|
623
647
|
status.HTTP_409_CONFLICT,
|
624
648
|
status.WS_1008_POLICY_VIOLATION,
|
625
649
|
),
|
626
|
-
ApiError.
|
650
|
+
ApiError.NAME_NOT_UNIQUE: (
|
627
651
|
status.HTTP_409_CONFLICT,
|
628
652
|
status.WS_1008_POLICY_VIOLATION,
|
629
653
|
),
|
@@ -797,6 +821,14 @@ class StatusCodeMapper:
|
|
797
821
|
status.HTTP_400_BAD_REQUEST,
|
798
822
|
status.WS_1008_POLICY_VIOLATION,
|
799
823
|
),
|
824
|
+
ApiError.ORPHAN_OPEN_ORDER: (
|
825
|
+
status.HTTP_400_BAD_REQUEST,
|
826
|
+
status.WS_1008_POLICY_VIOLATION,
|
827
|
+
),
|
828
|
+
ApiError.ORPHAN_CLOSE_ORDER: (
|
829
|
+
status.HTTP_400_BAD_REQUEST,
|
830
|
+
status.WS_1008_POLICY_VIOLATION,
|
831
|
+
),
|
800
832
|
ApiError.POSITION_LIMIT_EXCEEDED: (
|
801
833
|
status.HTTP_400_BAD_REQUEST,
|
802
834
|
status.WS_1008_POLICY_VIOLATION,
|
@@ -825,7 +857,7 @@ class StatusCodeMapper:
|
|
825
857
|
status.HTTP_400_BAD_REQUEST,
|
826
858
|
status.WS_1008_POLICY_VIOLATION,
|
827
859
|
),
|
828
|
-
ApiError.
|
860
|
+
ApiError.TRADING_ACTION_SKIPPED_BOT_STOPPING: (
|
829
861
|
status.HTTP_400_BAD_REQUEST,
|
830
862
|
status.WS_1008_POLICY_VIOLATION,
|
831
863
|
),
|
@@ -848,6 +880,14 @@ class StatusCodeMapper:
|
|
848
880
|
status.HTTP_204_NO_CONTENT,
|
849
881
|
status.WS_1000_NORMAL_CLOSURE,
|
850
882
|
),
|
883
|
+
ApiError.CANCELLED_OPEN_ORDER: (
|
884
|
+
status.HTTP_200_OK,
|
885
|
+
status.WS_1008_POLICY_VIOLATION,
|
886
|
+
),
|
887
|
+
ApiError.FAILED_OPEN_ORDER: (
|
888
|
+
status.HTTP_200_OK,
|
889
|
+
status.WS_1008_POLICY_VIOLATION,
|
890
|
+
),
|
851
891
|
# Miscellaneous
|
852
892
|
ApiError.OBJECT_LOCKED: (
|
853
893
|
status.HTTP_423_LOCKED,
|
crypticorn/common/exceptions.py
CHANGED
@@ -154,3 +154,14 @@ def register_exception_handlers(app: FastAPI):
|
|
154
154
|
exception_response = {
|
155
155
|
"default": {"model": ExceptionDetail, "description": "Error response"}
|
156
156
|
}
|
157
|
+
|
158
|
+
|
159
|
+
class CrypticornException(Exception):
|
160
|
+
"""A custom exception class for Crypticorn."""
|
161
|
+
|
162
|
+
def __init__(self, error: ApiError, message: str = None):
|
163
|
+
self.message = message
|
164
|
+
self.error = error
|
165
|
+
|
166
|
+
def __str__(self):
|
167
|
+
return f"{self.error.identifier}: {self.message}"
|
@@ -37,6 +37,7 @@ from crypticorn.hive.client.exceptions import ApiException
|
|
37
37
|
from crypticorn.hive.client.models.api_error_identifier import ApiErrorIdentifier
|
38
38
|
from crypticorn.hive.client.models.api_error_level import ApiErrorLevel
|
39
39
|
from crypticorn.hive.client.models.api_error_type import ApiErrorType
|
40
|
+
from crypticorn.hive.client.models.coin_info import CoinInfo
|
40
41
|
from crypticorn.hive.client.models.coins import Coins
|
41
42
|
from crypticorn.hive.client.models.data_download_response import DataDownloadResponse
|
42
43
|
from crypticorn.hive.client.models.data_info import DataInfo
|
@@ -17,6 +17,7 @@ Do not edit the class manually.
|
|
17
17
|
from crypticorn.hive.client.models.api_error_identifier import ApiErrorIdentifier
|
18
18
|
from crypticorn.hive.client.models.api_error_level import ApiErrorLevel
|
19
19
|
from crypticorn.hive.client.models.api_error_type import ApiErrorType
|
20
|
+
from crypticorn.hive.client.models.coin_info import CoinInfo
|
20
21
|
from crypticorn.hive.client.models.coins import Coins
|
21
22
|
from crypticorn.hive.client.models.data_download_response import DataDownloadResponse
|
22
23
|
from crypticorn.hive.client.models.data_info import DataInfo
|
@@ -73,12 +73,14 @@ class ApiErrorIdentifier(str, Enum):
|
|
73
73
|
ORDER_VIOLATES_LIQUIDATION_PRICE_CONSTRAINTS = (
|
74
74
|
"order_violates_liquidation_price_constraints"
|
75
75
|
)
|
76
|
+
MARGIN_MODE_CLASH = "margin_mode_clash"
|
76
77
|
MODEL_NAME_NOT_UNIQUE = "model_name_not_unique"
|
77
78
|
NO_CREDENTIALS = "no_credentials"
|
78
79
|
NOW_API_DOWN = "now_api_down"
|
79
80
|
OBJECT_ALREADY_EXISTS = "object_already_exists"
|
80
81
|
OBJECT_CREATED = "object_created"
|
81
82
|
OBJECT_DELETED = "object_deleted"
|
83
|
+
OBJECT_LOCKED = "object_locked"
|
82
84
|
OBJECT_NOT_FOUND = "object_not_found"
|
83
85
|
OBJECT_UPDATED = "object_updated"
|
84
86
|
ORDER_IS_ALREADY_FILLED = "order_is_already_filled"
|
@@ -0,0 +1,106 @@
|
|
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 pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
+
from crypticorn.hive.client.models.coins import Coins
|
23
|
+
from crypticorn.hive.client.models.data_version import DataVersion
|
24
|
+
from typing import Optional, Set
|
25
|
+
from typing_extensions import Self
|
26
|
+
|
27
|
+
|
28
|
+
class CoinInfo(BaseModel):
|
29
|
+
"""
|
30
|
+
Information about a coin
|
31
|
+
""" # noqa: E501
|
32
|
+
|
33
|
+
identifier: Coins = Field(
|
34
|
+
description="The identifier of the coin. Obfuscated for public use."
|
35
|
+
)
|
36
|
+
version_added: DataVersion = Field(
|
37
|
+
description="The data version the coin got introduced in"
|
38
|
+
)
|
39
|
+
version_removed: Optional[DataVersion] = None
|
40
|
+
__properties: ClassVar[List[str]] = [
|
41
|
+
"identifier",
|
42
|
+
"version_added",
|
43
|
+
"version_removed",
|
44
|
+
]
|
45
|
+
|
46
|
+
model_config = ConfigDict(
|
47
|
+
populate_by_name=True,
|
48
|
+
validate_assignment=True,
|
49
|
+
protected_namespaces=(),
|
50
|
+
)
|
51
|
+
|
52
|
+
def to_str(self) -> str:
|
53
|
+
"""Returns the string representation of the model using alias"""
|
54
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
55
|
+
|
56
|
+
def to_json(self) -> str:
|
57
|
+
"""Returns the JSON representation of the model using alias"""
|
58
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
59
|
+
return json.dumps(self.to_dict())
|
60
|
+
|
61
|
+
@classmethod
|
62
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
63
|
+
"""Create an instance of CoinInfo from a JSON string"""
|
64
|
+
return cls.from_dict(json.loads(json_str))
|
65
|
+
|
66
|
+
def to_dict(self) -> Dict[str, Any]:
|
67
|
+
"""Return the dictionary representation of the model using alias.
|
68
|
+
|
69
|
+
This has the following differences from calling pydantic's
|
70
|
+
`self.model_dump(by_alias=True)`:
|
71
|
+
|
72
|
+
* `None` is only added to the output dict for nullable fields that
|
73
|
+
were set at model initialization. Other fields with value `None`
|
74
|
+
are ignored.
|
75
|
+
"""
|
76
|
+
excluded_fields: Set[str] = set([])
|
77
|
+
|
78
|
+
_dict = self.model_dump(
|
79
|
+
by_alias=True,
|
80
|
+
exclude=excluded_fields,
|
81
|
+
exclude_none=True,
|
82
|
+
)
|
83
|
+
# set to None if version_removed (nullable) is None
|
84
|
+
# and model_fields_set contains the field
|
85
|
+
if self.version_removed is None and "version_removed" in self.model_fields_set:
|
86
|
+
_dict["version_removed"] = None
|
87
|
+
|
88
|
+
return _dict
|
89
|
+
|
90
|
+
@classmethod
|
91
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
92
|
+
"""Create an instance of CoinInfo from a dict"""
|
93
|
+
if obj is None:
|
94
|
+
return None
|
95
|
+
|
96
|
+
if not isinstance(obj, dict):
|
97
|
+
return cls.model_validate(obj)
|
98
|
+
|
99
|
+
_obj = cls.model_validate(
|
100
|
+
{
|
101
|
+
"identifier": obj.get("identifier"),
|
102
|
+
"version_added": obj.get("version_added"),
|
103
|
+
"version_removed": obj.get("version_removed"),
|
104
|
+
}
|
105
|
+
)
|
106
|
+
return _obj
|
@@ -19,7 +19,7 @@ import json
|
|
19
19
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
22
|
-
from crypticorn.hive.client.models.
|
22
|
+
from crypticorn.hive.client.models.coin_info import CoinInfo
|
23
23
|
from crypticorn.hive.client.models.data_options import DataOptions
|
24
24
|
from crypticorn.hive.client.models.data_version_info import DataVersionInfo
|
25
25
|
from crypticorn.hive.client.models.feature_size import FeatureSize
|
@@ -36,14 +36,14 @@ class DataInfo(BaseModel):
|
|
36
36
|
data: Dict[str, Dict[str, DataOptions]] = Field(
|
37
37
|
description="The complete data information for all versions, coins, feature sizes and targets."
|
38
38
|
)
|
39
|
-
coins: List[
|
40
|
-
description="The coins available
|
39
|
+
coins: List[CoinInfo] = Field(
|
40
|
+
description="The coins available for all data versions."
|
41
41
|
)
|
42
42
|
feature_sizes: List[FeatureSize] = Field(
|
43
|
-
description="The feature sizes available
|
43
|
+
description="The feature sizes available for all data versions."
|
44
44
|
)
|
45
45
|
targets: List[TargetInfo] = Field(
|
46
|
-
description="The targets available
|
46
|
+
description="The targets available for all data versions."
|
47
47
|
)
|
48
48
|
all_versions: List[DataVersionInfo] = Field(
|
49
49
|
description="All ever existing data versions. Some may not be publicly available yet."
|
@@ -104,6 +104,13 @@ class DataInfo(BaseModel):
|
|
104
104
|
if self.data[_key_data]:
|
105
105
|
_field_dict[_key_data] = self.data[_key_data].to_dict()
|
106
106
|
_dict["data"] = _field_dict
|
107
|
+
# override the default output from pydantic by calling `to_dict()` of each item in coins (list)
|
108
|
+
_items = []
|
109
|
+
if self.coins:
|
110
|
+
for _item_coins in self.coins:
|
111
|
+
if _item_coins:
|
112
|
+
_items.append(_item_coins.to_dict())
|
113
|
+
_dict["coins"] = _items
|
107
114
|
# override the default output from pydantic by calling `to_dict()` of each item in targets (list)
|
108
115
|
_items = []
|
109
116
|
if self.targets:
|
@@ -156,7 +163,11 @@ class DataInfo(BaseModel):
|
|
156
163
|
if obj.get("data") is not None
|
157
164
|
else None
|
158
165
|
),
|
159
|
-
"coins":
|
166
|
+
"coins": (
|
167
|
+
[CoinInfo.from_dict(_item) for _item in obj["coins"]]
|
168
|
+
if obj.get("coins") is not None
|
169
|
+
else None
|
170
|
+
),
|
160
171
|
"feature_sizes": obj.get("feature_sizes"),
|
161
172
|
"targets": (
|
162
173
|
[TargetInfo.from_dict(_item) for _item in obj["targets"]]
|
@@ -18,7 +18,7 @@ import re # noqa: F401
|
|
18
18
|
import json
|
19
19
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
22
22
|
from crypticorn.hive.client.models.data_version import DataVersion
|
23
23
|
from crypticorn.hive.client.models.target import Target
|
24
24
|
from crypticorn.hive.client.models.target_type import TargetType
|
@@ -31,10 +31,18 @@ class TargetInfo(BaseModel):
|
|
31
31
|
Information about a target
|
32
32
|
""" # noqa: E501
|
33
33
|
|
34
|
-
name: Target = Field(description="
|
35
|
-
type: TargetType = Field(description="
|
36
|
-
|
37
|
-
|
34
|
+
name: Target = Field(description="The name of the target.")
|
35
|
+
type: TargetType = Field(description="The type of the target.")
|
36
|
+
version_added: DataVersion = Field(
|
37
|
+
description="The data version the target got introduced in."
|
38
|
+
)
|
39
|
+
version_removed: Optional[DataVersion] = None
|
40
|
+
__properties: ClassVar[List[str]] = [
|
41
|
+
"name",
|
42
|
+
"type",
|
43
|
+
"version_added",
|
44
|
+
"version_removed",
|
45
|
+
]
|
38
46
|
|
39
47
|
model_config = ConfigDict(
|
40
48
|
populate_by_name=True,
|
@@ -73,6 +81,11 @@ class TargetInfo(BaseModel):
|
|
73
81
|
exclude=excluded_fields,
|
74
82
|
exclude_none=True,
|
75
83
|
)
|
84
|
+
# set to None if version_removed (nullable) is None
|
85
|
+
# and model_fields_set contains the field
|
86
|
+
if self.version_removed is None and "version_removed" in self.model_fields_set:
|
87
|
+
_dict["version_removed"] = None
|
88
|
+
|
76
89
|
return _dict
|
77
90
|
|
78
91
|
@classmethod
|
@@ -88,7 +101,8 @@ class TargetInfo(BaseModel):
|
|
88
101
|
{
|
89
102
|
"name": obj.get("name"),
|
90
103
|
"type": obj.get("type"),
|
91
|
-
"
|
104
|
+
"version_added": obj.get("version_added"),
|
105
|
+
"version_removed": obj.get("version_removed"),
|
92
106
|
}
|
93
107
|
)
|
94
108
|
return _obj
|
@@ -35,16 +35,18 @@ from crypticorn.pay.client.exceptions import ApiAttributeError
|
|
35
35
|
from crypticorn.pay.client.exceptions import ApiException
|
36
36
|
|
37
37
|
# import models into sdk package
|
38
|
+
from crypticorn.pay.client.models.api_error_identifier import ApiErrorIdentifier
|
39
|
+
from crypticorn.pay.client.models.api_error_level import ApiErrorLevel
|
40
|
+
from crypticorn.pay.client.models.api_error_type import ApiErrorType
|
38
41
|
from crypticorn.pay.client.models.exception_detail import ExceptionDetail
|
39
42
|
from crypticorn.pay.client.models.log_level import LogLevel
|
40
43
|
from crypticorn.pay.client.models.now_create_invoice_req import NowCreateInvoiceReq
|
41
44
|
from crypticorn.pay.client.models.now_create_invoice_res import NowCreateInvoiceRes
|
42
45
|
from crypticorn.pay.client.models.payment import Payment
|
43
46
|
from crypticorn.pay.client.models.payment_status import PaymentStatus
|
47
|
+
from crypticorn.pay.client.models.product import Product
|
44
48
|
from crypticorn.pay.client.models.product_create import ProductCreate
|
45
|
-
from crypticorn.pay.client.models.product_read import ProductRead
|
46
|
-
from crypticorn.pay.client.models.product_sub_read import ProductSubRead
|
47
49
|
from crypticorn.pay.client.models.product_update import ProductUpdate
|
48
50
|
from crypticorn.pay.client.models.provider import Provider
|
49
|
-
from crypticorn.pay.client.models.response_getuptime import ResponseGetuptime
|
50
51
|
from crypticorn.pay.client.models.scope import Scope
|
52
|
+
from crypticorn.pay.client.models.subscription import Subscription
|