crypticorn 2.2.1__py3-none-any.whl → 2.2.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.
- crypticorn/auth/client/models/authorize_user_request.py +10 -4
- crypticorn/auth/client/models/create_api_key_request.py +19 -19
- crypticorn/auth/client/models/get_api_keys200_response_inner.py +18 -10
- crypticorn/auth/client/models/refresh_token_info200_response_user_session.py +11 -7
- crypticorn/auth/client/models/verify200_response.py +15 -9
- crypticorn/auth/client/models/verify_email200_response_auth_auth.py +15 -9
- crypticorn/client.py +17 -10
- crypticorn/common/__init__.py +2 -1
- crypticorn/common/auth.py +1 -0
- crypticorn/common/errors.py +63 -16
- crypticorn/common/pydantic.py +14 -8
- crypticorn/common/scopes.py +3 -3
- crypticorn/common/sorter.py +8 -6
- crypticorn/common/urls.py +2 -0
- crypticorn/klines/client/configuration.py +1 -3
- crypticorn/metrics/__init__.py +3 -1
- crypticorn/metrics/main.py +6 -5
- crypticorn/pay/client/__init__.py +3 -0
- crypticorn/pay/client/api/now_payments_api.py +3 -3
- crypticorn/pay/client/api/payments_api.py +47 -19
- crypticorn/pay/client/api/products_api.py +72 -63
- crypticorn/pay/client/models/__init__.py +3 -0
- crypticorn/pay/client/models/now_webhook_payload.py +1 -1
- crypticorn/pay/client/models/partial_product_update_model.py +150 -0
- crypticorn/pay/client/models/product_update_model.py +150 -0
- crypticorn/trade/client/api/api_keys_api.py +50 -50
- crypticorn/trade/client/api/bots_api.py +3 -3
- crypticorn/trade/client/api/futures_trading_panel_api.py +15 -15
- {crypticorn-2.2.1.dist-info → crypticorn-2.2.3.dist-info}/METADATA +1 -1
- {crypticorn-2.2.1.dist-info → crypticorn-2.2.3.dist-info}/RECORD +32 -30
- {crypticorn-2.2.1.dist-info → crypticorn-2.2.3.dist-info}/WHEEL +0 -0
- {crypticorn-2.2.1.dist-info → crypticorn-2.2.3.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,150 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Payment API
|
5
|
+
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 0.1.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 (
|
21
|
+
BaseModel,
|
22
|
+
ConfigDict,
|
23
|
+
StrictBool,
|
24
|
+
StrictFloat,
|
25
|
+
StrictInt,
|
26
|
+
StrictStr,
|
27
|
+
)
|
28
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
29
|
+
from crypticorn.pay.client.models.scope import Scope
|
30
|
+
from typing import Optional, Set
|
31
|
+
from typing_extensions import Self
|
32
|
+
|
33
|
+
|
34
|
+
class PartialProductUpdateModel(BaseModel):
|
35
|
+
"""
|
36
|
+
PartialProductUpdateModel
|
37
|
+
""" # noqa: E501
|
38
|
+
|
39
|
+
id: Optional[StrictStr] = None
|
40
|
+
name: Optional[StrictStr] = None
|
41
|
+
price: Optional[Union[StrictFloat, StrictInt]] = None
|
42
|
+
scopes: Optional[List[Scope]] = None
|
43
|
+
duration: Optional[StrictInt] = None
|
44
|
+
description: Optional[StrictStr] = None
|
45
|
+
is_active: Optional[StrictBool] = None
|
46
|
+
__properties: ClassVar[List[str]] = [
|
47
|
+
"id",
|
48
|
+
"name",
|
49
|
+
"price",
|
50
|
+
"scopes",
|
51
|
+
"duration",
|
52
|
+
"description",
|
53
|
+
"is_active",
|
54
|
+
]
|
55
|
+
|
56
|
+
model_config = ConfigDict(
|
57
|
+
populate_by_name=True,
|
58
|
+
validate_assignment=True,
|
59
|
+
protected_namespaces=(),
|
60
|
+
)
|
61
|
+
|
62
|
+
def to_str(self) -> str:
|
63
|
+
"""Returns the string representation of the model using alias"""
|
64
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
65
|
+
|
66
|
+
def to_json(self) -> str:
|
67
|
+
"""Returns the JSON representation of the model using alias"""
|
68
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
69
|
+
return json.dumps(self.to_dict())
|
70
|
+
|
71
|
+
@classmethod
|
72
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
73
|
+
"""Create an instance of PartialProductUpdateModel from a JSON string"""
|
74
|
+
return cls.from_dict(json.loads(json_str))
|
75
|
+
|
76
|
+
def to_dict(self) -> Dict[str, Any]:
|
77
|
+
"""Return the dictionary representation of the model using alias.
|
78
|
+
|
79
|
+
This has the following differences from calling pydantic's
|
80
|
+
`self.model_dump(by_alias=True)`:
|
81
|
+
|
82
|
+
* `None` is only added to the output dict for nullable fields that
|
83
|
+
were set at model initialization. Other fields with value `None`
|
84
|
+
are ignored.
|
85
|
+
"""
|
86
|
+
excluded_fields: Set[str] = set([])
|
87
|
+
|
88
|
+
_dict = self.model_dump(
|
89
|
+
by_alias=True,
|
90
|
+
exclude=excluded_fields,
|
91
|
+
exclude_none=True,
|
92
|
+
)
|
93
|
+
# set to None if id (nullable) is None
|
94
|
+
# and model_fields_set contains the field
|
95
|
+
if self.id is None and "id" in self.model_fields_set:
|
96
|
+
_dict["id"] = None
|
97
|
+
|
98
|
+
# set to None if name (nullable) is None
|
99
|
+
# and model_fields_set contains the field
|
100
|
+
if self.name is None and "name" in self.model_fields_set:
|
101
|
+
_dict["name"] = None
|
102
|
+
|
103
|
+
# set to None if price (nullable) is None
|
104
|
+
# and model_fields_set contains the field
|
105
|
+
if self.price is None and "price" in self.model_fields_set:
|
106
|
+
_dict["price"] = None
|
107
|
+
|
108
|
+
# set to None if scopes (nullable) is None
|
109
|
+
# and model_fields_set contains the field
|
110
|
+
if self.scopes is None and "scopes" in self.model_fields_set:
|
111
|
+
_dict["scopes"] = None
|
112
|
+
|
113
|
+
# set to None if duration (nullable) is None
|
114
|
+
# and model_fields_set contains the field
|
115
|
+
if self.duration is None and "duration" in self.model_fields_set:
|
116
|
+
_dict["duration"] = None
|
117
|
+
|
118
|
+
# set to None if description (nullable) is None
|
119
|
+
# and model_fields_set contains the field
|
120
|
+
if self.description is None and "description" in self.model_fields_set:
|
121
|
+
_dict["description"] = None
|
122
|
+
|
123
|
+
# set to None if is_active (nullable) is None
|
124
|
+
# and model_fields_set contains the field
|
125
|
+
if self.is_active is None and "is_active" in self.model_fields_set:
|
126
|
+
_dict["is_active"] = None
|
127
|
+
|
128
|
+
return _dict
|
129
|
+
|
130
|
+
@classmethod
|
131
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
132
|
+
"""Create an instance of PartialProductUpdateModel from a dict"""
|
133
|
+
if obj is None:
|
134
|
+
return None
|
135
|
+
|
136
|
+
if not isinstance(obj, dict):
|
137
|
+
return cls.model_validate(obj)
|
138
|
+
|
139
|
+
_obj = cls.model_validate(
|
140
|
+
{
|
141
|
+
"id": obj.get("id"),
|
142
|
+
"name": obj.get("name"),
|
143
|
+
"price": obj.get("price"),
|
144
|
+
"scopes": obj.get("scopes"),
|
145
|
+
"duration": obj.get("duration"),
|
146
|
+
"description": obj.get("description"),
|
147
|
+
"is_active": obj.get("is_active"),
|
148
|
+
}
|
149
|
+
)
|
150
|
+
return _obj
|
@@ -0,0 +1,150 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Payment API
|
5
|
+
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 0.1.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 (
|
21
|
+
BaseModel,
|
22
|
+
ConfigDict,
|
23
|
+
StrictBool,
|
24
|
+
StrictFloat,
|
25
|
+
StrictInt,
|
26
|
+
StrictStr,
|
27
|
+
)
|
28
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
29
|
+
from crypticorn.pay.client.models.scope import Scope
|
30
|
+
from typing import Optional, Set
|
31
|
+
from typing_extensions import Self
|
32
|
+
|
33
|
+
|
34
|
+
class ProductUpdateModel(BaseModel):
|
35
|
+
"""
|
36
|
+
ProductUpdateModel
|
37
|
+
""" # noqa: E501
|
38
|
+
|
39
|
+
id: Optional[StrictStr] = None
|
40
|
+
name: Optional[StrictStr]
|
41
|
+
price: Optional[Union[StrictFloat, StrictInt]]
|
42
|
+
scopes: Optional[List[Scope]]
|
43
|
+
duration: Optional[StrictInt]
|
44
|
+
description: Optional[StrictStr]
|
45
|
+
is_active: Optional[StrictBool]
|
46
|
+
__properties: ClassVar[List[str]] = [
|
47
|
+
"id",
|
48
|
+
"name",
|
49
|
+
"price",
|
50
|
+
"scopes",
|
51
|
+
"duration",
|
52
|
+
"description",
|
53
|
+
"is_active",
|
54
|
+
]
|
55
|
+
|
56
|
+
model_config = ConfigDict(
|
57
|
+
populate_by_name=True,
|
58
|
+
validate_assignment=True,
|
59
|
+
protected_namespaces=(),
|
60
|
+
)
|
61
|
+
|
62
|
+
def to_str(self) -> str:
|
63
|
+
"""Returns the string representation of the model using alias"""
|
64
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
65
|
+
|
66
|
+
def to_json(self) -> str:
|
67
|
+
"""Returns the JSON representation of the model using alias"""
|
68
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
69
|
+
return json.dumps(self.to_dict())
|
70
|
+
|
71
|
+
@classmethod
|
72
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
73
|
+
"""Create an instance of ProductUpdateModel from a JSON string"""
|
74
|
+
return cls.from_dict(json.loads(json_str))
|
75
|
+
|
76
|
+
def to_dict(self) -> Dict[str, Any]:
|
77
|
+
"""Return the dictionary representation of the model using alias.
|
78
|
+
|
79
|
+
This has the following differences from calling pydantic's
|
80
|
+
`self.model_dump(by_alias=True)`:
|
81
|
+
|
82
|
+
* `None` is only added to the output dict for nullable fields that
|
83
|
+
were set at model initialization. Other fields with value `None`
|
84
|
+
are ignored.
|
85
|
+
"""
|
86
|
+
excluded_fields: Set[str] = set([])
|
87
|
+
|
88
|
+
_dict = self.model_dump(
|
89
|
+
by_alias=True,
|
90
|
+
exclude=excluded_fields,
|
91
|
+
exclude_none=True,
|
92
|
+
)
|
93
|
+
# set to None if id (nullable) is None
|
94
|
+
# and model_fields_set contains the field
|
95
|
+
if self.id is None and "id" in self.model_fields_set:
|
96
|
+
_dict["id"] = None
|
97
|
+
|
98
|
+
# set to None if name (nullable) is None
|
99
|
+
# and model_fields_set contains the field
|
100
|
+
if self.name is None and "name" in self.model_fields_set:
|
101
|
+
_dict["name"] = None
|
102
|
+
|
103
|
+
# set to None if price (nullable) is None
|
104
|
+
# and model_fields_set contains the field
|
105
|
+
if self.price is None and "price" in self.model_fields_set:
|
106
|
+
_dict["price"] = None
|
107
|
+
|
108
|
+
# set to None if scopes (nullable) is None
|
109
|
+
# and model_fields_set contains the field
|
110
|
+
if self.scopes is None and "scopes" in self.model_fields_set:
|
111
|
+
_dict["scopes"] = None
|
112
|
+
|
113
|
+
# set to None if duration (nullable) is None
|
114
|
+
# and model_fields_set contains the field
|
115
|
+
if self.duration is None and "duration" in self.model_fields_set:
|
116
|
+
_dict["duration"] = None
|
117
|
+
|
118
|
+
# set to None if description (nullable) is None
|
119
|
+
# and model_fields_set contains the field
|
120
|
+
if self.description is None and "description" in self.model_fields_set:
|
121
|
+
_dict["description"] = None
|
122
|
+
|
123
|
+
# set to None if is_active (nullable) is None
|
124
|
+
# and model_fields_set contains the field
|
125
|
+
if self.is_active is None and "is_active" in self.model_fields_set:
|
126
|
+
_dict["is_active"] = None
|
127
|
+
|
128
|
+
return _dict
|
129
|
+
|
130
|
+
@classmethod
|
131
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
132
|
+
"""Create an instance of ProductUpdateModel from a dict"""
|
133
|
+
if obj is None:
|
134
|
+
return None
|
135
|
+
|
136
|
+
if not isinstance(obj, dict):
|
137
|
+
return cls.model_validate(obj)
|
138
|
+
|
139
|
+
_obj = cls.model_validate(
|
140
|
+
{
|
141
|
+
"id": obj.get("id"),
|
142
|
+
"name": obj.get("name"),
|
143
|
+
"price": obj.get("price"),
|
144
|
+
"scopes": obj.get("scopes"),
|
145
|
+
"duration": obj.get("duration"),
|
146
|
+
"description": obj.get("description"),
|
147
|
+
"is_active": obj.get("is_active"),
|
148
|
+
}
|
149
|
+
)
|
150
|
+
return _obj
|