crypticorn 2.5.1__py3-none-any.whl → 2.5.2__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/__init__.py +1 -0
- crypticorn/common/enums.py +3 -1
- crypticorn/common/errors.py +40 -4
- crypticorn/common/mixins.py +1 -0
- crypticorn/common/status_router.py +42 -0
- crypticorn/common/utils.py +5 -12
- crypticorn/klines/client/__init__.py +0 -5
- crypticorn/klines/client/api/change_in_timeframe_api.py +8 -9
- crypticorn/klines/client/api/ohlcv_data_api.py +7 -8
- crypticorn/klines/client/api/symbols_api.py +7 -8
- crypticorn/klines/client/models/__init__.py +0 -5
- crypticorn/klines/client/models/exception_detail.py +3 -6
- crypticorn/klines/client/models/search_symbol.py +4 -3
- crypticorn/klines/client/models/udf_config.py +1 -2
- crypticorn/metrics/client/__init__.py +1 -6
- crypticorn/metrics/client/api/exchanges_api.py +29 -31
- crypticorn/metrics/client/api/indicators_api.py +15 -16
- crypticorn/metrics/client/api/logs_api.py +1 -1
- crypticorn/metrics/client/api/marketcap_api.py +15 -16
- crypticorn/metrics/client/api/markets_api.py +15 -16
- crypticorn/metrics/client/api/status_api.py +1 -1
- crypticorn/metrics/client/api/tokens_api.py +1 -1
- crypticorn/metrics/client/api_client.py +1 -1
- crypticorn/metrics/client/configuration.py +3 -5
- crypticorn/metrics/client/exceptions.py +1 -1
- crypticorn/metrics/client/models/__init__.py +1 -6
- crypticorn/metrics/client/models/exception_detail.py +4 -7
- crypticorn/metrics/client/models/severity.py +1 -1
- crypticorn/metrics/client/models/time_interval.py +1 -1
- crypticorn/metrics/client/models/trading_status.py +1 -1
- crypticorn/metrics/client/rest.py +1 -1
- crypticorn/trade/client/__init__.py +1 -2
- crypticorn/trade/client/api/exchanges_api.py +6 -6
- crypticorn/trade/client/api/trading_actions_api.py +16 -15
- crypticorn/trade/client/configuration.py +2 -2
- crypticorn/trade/client/models/__init__.py +1 -2
- crypticorn/trade/client/models/action_model.py +1 -2
- crypticorn/trade/client/models/exchange_key_model.py +2 -11
- crypticorn/trade/client/models/futures_trading_action.py +1 -2
- crypticorn/trade/client/models/order_model.py +4 -14
- crypticorn/trade/client/models/spot_trading_action.py +1 -2
- crypticorn/trade/client/models/strategy_exchange_info.py +2 -3
- crypticorn/trade/client/models/strategy_model_input.py +1 -2
- crypticorn/trade/client/models/strategy_model_output.py +1 -2
- crypticorn/trade/client/models/tpsl.py +3 -1
- {crypticorn-2.5.1.dist-info → crypticorn-2.5.2.dist-info}/METADATA +1 -1
- {crypticorn-2.5.1.dist-info → crypticorn-2.5.2.dist-info}/RECORD +50 -127
- crypticorn/klines/client/api/health_check_api.py +0 -265
- crypticorn/klines/client/models/api_error_identifier.py +0 -108
- crypticorn/klines/client/models/api_error_level.py +0 -37
- crypticorn/klines/client/models/api_error_type.py +0 -37
- crypticorn/klines/client/models/base_response_health_check_response.py +0 -114
- crypticorn/klines/client/models/base_response_list_change_in_timeframe_response.py +0 -123
- crypticorn/klines/client/models/base_response_list_funding_rate_response.py +0 -118
- crypticorn/klines/client/models/base_response_list_str.py +0 -106
- crypticorn/klines/client/models/base_response_ohlcv_response.py +0 -114
- crypticorn/klines/client/models/change_in_timeframe_response.py +0 -86
- crypticorn/klines/client/models/error_response.py +0 -109
- crypticorn/klines/client/models/exchange.py +0 -91
- crypticorn/klines/client/models/funding_rate_response.py +0 -92
- crypticorn/klines/client/models/health_check_response.py +0 -91
- crypticorn/klines/client/models/history_error_response.py +0 -89
- crypticorn/klines/client/models/history_no_data_response.py +0 -99
- crypticorn/klines/client/models/history_success_response.py +0 -99
- crypticorn/klines/client/models/http_validation_error.py +0 -99
- crypticorn/klines/client/models/internal_exchange.py +0 -39
- crypticorn/klines/client/models/market.py +0 -35
- crypticorn/klines/client/models/market_type.py +0 -35
- crypticorn/klines/client/models/ohlcv_response.py +0 -105
- crypticorn/klines/client/models/response_get_history_udf_history_get.py +0 -198
- crypticorn/klines/client/models/response_get_udf_history.py +0 -198
- crypticorn/klines/client/models/search_symbol_response.py +0 -104
- crypticorn/klines/client/models/symbol_group_response.py +0 -83
- crypticorn/klines/client/models/symbol_info_response.py +0 -131
- crypticorn/klines/client/models/udf_config_response.py +0 -160
- crypticorn/klines/client/models/validation_error.py +0 -105
- crypticorn/klines/client/models/validation_error_loc_inner.py +0 -159
- crypticorn/metrics/client/api/health_check_api.py +0 -265
- crypticorn/metrics/client/models/api_error_identifier.py +0 -108
- crypticorn/metrics/client/models/api_error_level.py +0 -37
- crypticorn/metrics/client/models/api_error_type.py +0 -37
- crypticorn/metrics/client/models/base_response_dict.py +0 -106
- crypticorn/metrics/client/models/base_response_health_check_response.py +0 -114
- crypticorn/metrics/client/models/base_response_list_dict.py +0 -106
- crypticorn/metrics/client/models/base_response_list_exchange_mapping.py +0 -118
- crypticorn/metrics/client/models/base_response_list_str.py +0 -106
- crypticorn/metrics/client/models/error_response.py +0 -109
- crypticorn/metrics/client/models/exchange_mapping.py +0 -134
- crypticorn/metrics/client/models/health_check_response.py +0 -91
- crypticorn/metrics/client/models/http_validation_error.py +0 -99
- crypticorn/metrics/client/models/internal_exchange.py +0 -39
- crypticorn/metrics/client/models/market.py +0 -35
- crypticorn/metrics/client/models/market_type.py +0 -35
- crypticorn/metrics/client/models/validation_error.py +0 -105
- crypticorn/metrics/client/models/validation_error_loc_inner.py +0 -159
- crypticorn/pay/client/models/api_status_res.py +0 -83
- crypticorn/pay/client/models/body_create_now_invoice.py +0 -98
- crypticorn/pay/client/models/body_create_product.py +0 -98
- crypticorn/pay/client/models/body_get_products.py +0 -87
- crypticorn/pay/client/models/body_handle_now_webhook.py +0 -98
- crypticorn/pay/client/models/body_update_product.py +0 -98
- crypticorn/pay/client/models/combined_payment_history.py +0 -101
- crypticorn/pay/client/models/create_invoice_req.py +0 -188
- crypticorn/pay/client/models/create_invoice_res.py +0 -188
- crypticorn/pay/client/models/currency.py +0 -165
- crypticorn/pay/client/models/estimate_price_req.py +0 -91
- crypticorn/pay/client/models/estimate_price_res.py +0 -102
- crypticorn/pay/client/models/get_currencies_res.py +0 -99
- crypticorn/pay/client/models/get_payment_status_res.py +0 -222
- crypticorn/pay/client/models/get_payments_list_res.py +0 -109
- crypticorn/pay/client/models/min_amount_req.py +0 -124
- crypticorn/pay/client/models/min_amount_res.py +0 -105
- crypticorn/pay/client/models/now_fee_structure.py +0 -104
- crypticorn/pay/client/models/now_payment_model.py +0 -124
- crypticorn/pay/client/models/now_payment_status.py +0 -42
- crypticorn/pay/client/models/now_webhook_payload.py +0 -181
- crypticorn/pay/client/models/partial_product_update_model.py +0 -150
- crypticorn/pay/client/models/product.py +0 -87
- crypticorn/pay/client/models/product_model.py +0 -128
- crypticorn/pay/client/models/product_subs_model.py +0 -108
- crypticorn/pay/client/models/product_update_model.py +0 -150
- crypticorn/pay/client/models/unified_payment_model.py +0 -112
- crypticorn/trade/client/models/api_key_model.py +0 -156
- crypticorn/trade/client/models/exchange.py +0 -35
- crypticorn/trade/client/models/market_type.py +0 -35
- {crypticorn-2.5.1.dist-info → crypticorn-2.5.2.dist-info}/WHEEL +0 -0
- {crypticorn-2.5.1.dist-info → crypticorn-2.5.2.dist-info}/entry_points.txt +0 -0
- {crypticorn-2.5.1.dist-info → crypticorn-2.5.2.dist-info}/top_level.txt +0 -0
@@ -1,98 +0,0 @@
|
|
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 BaseModel, ConfigDict
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
-
from crypticorn.pay.client.models.product_model import ProductModel
|
23
|
-
from crypticorn.pay.client.models.scope import Scope
|
24
|
-
from typing import Optional, Set
|
25
|
-
from typing_extensions import Self
|
26
|
-
|
27
|
-
|
28
|
-
class BodyCreateProduct(BaseModel):
|
29
|
-
"""
|
30
|
-
BodyCreateProduct
|
31
|
-
""" # noqa: E501
|
32
|
-
|
33
|
-
product: ProductModel
|
34
|
-
scopes: Optional[List[Scope]] = None
|
35
|
-
__properties: ClassVar[List[str]] = ["product", "scopes"]
|
36
|
-
|
37
|
-
model_config = ConfigDict(
|
38
|
-
populate_by_name=True,
|
39
|
-
validate_assignment=True,
|
40
|
-
protected_namespaces=(),
|
41
|
-
)
|
42
|
-
|
43
|
-
def to_str(self) -> str:
|
44
|
-
"""Returns the string representation of the model using alias"""
|
45
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
46
|
-
|
47
|
-
def to_json(self) -> str:
|
48
|
-
"""Returns the JSON representation of the model using alias"""
|
49
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
50
|
-
return json.dumps(self.to_dict())
|
51
|
-
|
52
|
-
@classmethod
|
53
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
54
|
-
"""Create an instance of BodyCreateProduct from a JSON string"""
|
55
|
-
return cls.from_dict(json.loads(json_str))
|
56
|
-
|
57
|
-
def to_dict(self) -> Dict[str, Any]:
|
58
|
-
"""Return the dictionary representation of the model using alias.
|
59
|
-
|
60
|
-
This has the following differences from calling pydantic's
|
61
|
-
`self.model_dump(by_alias=True)`:
|
62
|
-
|
63
|
-
* `None` is only added to the output dict for nullable fields that
|
64
|
-
were set at model initialization. Other fields with value `None`
|
65
|
-
are ignored.
|
66
|
-
"""
|
67
|
-
excluded_fields: Set[str] = set([])
|
68
|
-
|
69
|
-
_dict = self.model_dump(
|
70
|
-
by_alias=True,
|
71
|
-
exclude=excluded_fields,
|
72
|
-
exclude_none=True,
|
73
|
-
)
|
74
|
-
# override the default output from pydantic by calling `to_dict()` of product
|
75
|
-
if self.product:
|
76
|
-
_dict["product"] = self.product.to_dict()
|
77
|
-
return _dict
|
78
|
-
|
79
|
-
@classmethod
|
80
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
81
|
-
"""Create an instance of BodyCreateProduct from a dict"""
|
82
|
-
if obj is None:
|
83
|
-
return None
|
84
|
-
|
85
|
-
if not isinstance(obj, dict):
|
86
|
-
return cls.model_validate(obj)
|
87
|
-
|
88
|
-
_obj = cls.model_validate(
|
89
|
-
{
|
90
|
-
"product": (
|
91
|
-
ProductModel.from_dict(obj["product"])
|
92
|
-
if obj.get("product") is not None
|
93
|
-
else None
|
94
|
-
),
|
95
|
-
"scopes": obj.get("scopes"),
|
96
|
-
}
|
97
|
-
)
|
98
|
-
return _obj
|
@@ -1,87 +0,0 @@
|
|
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 BaseModel, ConfigDict
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
-
from crypticorn.pay.client.models.scope import Scope
|
23
|
-
from typing import Optional, Set
|
24
|
-
from typing_extensions import Self
|
25
|
-
|
26
|
-
|
27
|
-
class BodyGetProducts(BaseModel):
|
28
|
-
"""
|
29
|
-
BodyGetProducts
|
30
|
-
""" # noqa: E501
|
31
|
-
|
32
|
-
query: Optional[Dict[str, Any]] = None
|
33
|
-
scopes: Optional[List[Scope]] = None
|
34
|
-
__properties: ClassVar[List[str]] = ["query", "scopes"]
|
35
|
-
|
36
|
-
model_config = ConfigDict(
|
37
|
-
populate_by_name=True,
|
38
|
-
validate_assignment=True,
|
39
|
-
protected_namespaces=(),
|
40
|
-
)
|
41
|
-
|
42
|
-
def to_str(self) -> str:
|
43
|
-
"""Returns the string representation of the model using alias"""
|
44
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
45
|
-
|
46
|
-
def to_json(self) -> str:
|
47
|
-
"""Returns the JSON representation of the model using alias"""
|
48
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
49
|
-
return json.dumps(self.to_dict())
|
50
|
-
|
51
|
-
@classmethod
|
52
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
53
|
-
"""Create an instance of BodyGetProducts from a JSON string"""
|
54
|
-
return cls.from_dict(json.loads(json_str))
|
55
|
-
|
56
|
-
def to_dict(self) -> Dict[str, Any]:
|
57
|
-
"""Return the dictionary representation of the model using alias.
|
58
|
-
|
59
|
-
This has the following differences from calling pydantic's
|
60
|
-
`self.model_dump(by_alias=True)`:
|
61
|
-
|
62
|
-
* `None` is only added to the output dict for nullable fields that
|
63
|
-
were set at model initialization. Other fields with value `None`
|
64
|
-
are ignored.
|
65
|
-
"""
|
66
|
-
excluded_fields: Set[str] = set([])
|
67
|
-
|
68
|
-
_dict = self.model_dump(
|
69
|
-
by_alias=True,
|
70
|
-
exclude=excluded_fields,
|
71
|
-
exclude_none=True,
|
72
|
-
)
|
73
|
-
return _dict
|
74
|
-
|
75
|
-
@classmethod
|
76
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
77
|
-
"""Create an instance of BodyGetProducts from a dict"""
|
78
|
-
if obj is None:
|
79
|
-
return None
|
80
|
-
|
81
|
-
if not isinstance(obj, dict):
|
82
|
-
return cls.model_validate(obj)
|
83
|
-
|
84
|
-
_obj = cls.model_validate(
|
85
|
-
{"query": obj.get("query"), "scopes": obj.get("scopes")}
|
86
|
-
)
|
87
|
-
return _obj
|
@@ -1,98 +0,0 @@
|
|
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 BaseModel, ConfigDict
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
-
from crypticorn.pay.client.models.now_webhook_payload import NowWebhookPayload
|
23
|
-
from crypticorn.pay.client.models.scope import Scope
|
24
|
-
from typing import Optional, Set
|
25
|
-
from typing_extensions import Self
|
26
|
-
|
27
|
-
|
28
|
-
class BodyHandleNowWebhook(BaseModel):
|
29
|
-
"""
|
30
|
-
BodyHandleNowWebhook
|
31
|
-
""" # noqa: E501
|
32
|
-
|
33
|
-
body: NowWebhookPayload
|
34
|
-
scopes: Optional[List[Scope]] = None
|
35
|
-
__properties: ClassVar[List[str]] = ["body", "scopes"]
|
36
|
-
|
37
|
-
model_config = ConfigDict(
|
38
|
-
populate_by_name=True,
|
39
|
-
validate_assignment=True,
|
40
|
-
protected_namespaces=(),
|
41
|
-
)
|
42
|
-
|
43
|
-
def to_str(self) -> str:
|
44
|
-
"""Returns the string representation of the model using alias"""
|
45
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
46
|
-
|
47
|
-
def to_json(self) -> str:
|
48
|
-
"""Returns the JSON representation of the model using alias"""
|
49
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
50
|
-
return json.dumps(self.to_dict())
|
51
|
-
|
52
|
-
@classmethod
|
53
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
54
|
-
"""Create an instance of BodyHandleNowWebhook from a JSON string"""
|
55
|
-
return cls.from_dict(json.loads(json_str))
|
56
|
-
|
57
|
-
def to_dict(self) -> Dict[str, Any]:
|
58
|
-
"""Return the dictionary representation of the model using alias.
|
59
|
-
|
60
|
-
This has the following differences from calling pydantic's
|
61
|
-
`self.model_dump(by_alias=True)`:
|
62
|
-
|
63
|
-
* `None` is only added to the output dict for nullable fields that
|
64
|
-
were set at model initialization. Other fields with value `None`
|
65
|
-
are ignored.
|
66
|
-
"""
|
67
|
-
excluded_fields: Set[str] = set([])
|
68
|
-
|
69
|
-
_dict = self.model_dump(
|
70
|
-
by_alias=True,
|
71
|
-
exclude=excluded_fields,
|
72
|
-
exclude_none=True,
|
73
|
-
)
|
74
|
-
# override the default output from pydantic by calling `to_dict()` of body
|
75
|
-
if self.body:
|
76
|
-
_dict["body"] = self.body.to_dict()
|
77
|
-
return _dict
|
78
|
-
|
79
|
-
@classmethod
|
80
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
81
|
-
"""Create an instance of BodyHandleNowWebhook from a dict"""
|
82
|
-
if obj is None:
|
83
|
-
return None
|
84
|
-
|
85
|
-
if not isinstance(obj, dict):
|
86
|
-
return cls.model_validate(obj)
|
87
|
-
|
88
|
-
_obj = cls.model_validate(
|
89
|
-
{
|
90
|
-
"body": (
|
91
|
-
NowWebhookPayload.from_dict(obj["body"])
|
92
|
-
if obj.get("body") is not None
|
93
|
-
else None
|
94
|
-
),
|
95
|
-
"scopes": obj.get("scopes"),
|
96
|
-
}
|
97
|
-
)
|
98
|
-
return _obj
|
@@ -1,98 +0,0 @@
|
|
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 BaseModel, ConfigDict
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
-
from crypticorn.pay.client.models.product_model import ProductModel
|
23
|
-
from crypticorn.pay.client.models.scope import Scope
|
24
|
-
from typing import Optional, Set
|
25
|
-
from typing_extensions import Self
|
26
|
-
|
27
|
-
|
28
|
-
class BodyUpdateProduct(BaseModel):
|
29
|
-
"""
|
30
|
-
BodyUpdateProduct
|
31
|
-
""" # noqa: E501
|
32
|
-
|
33
|
-
product: ProductModel
|
34
|
-
scopes: Optional[List[Scope]] = None
|
35
|
-
__properties: ClassVar[List[str]] = ["product", "scopes"]
|
36
|
-
|
37
|
-
model_config = ConfigDict(
|
38
|
-
populate_by_name=True,
|
39
|
-
validate_assignment=True,
|
40
|
-
protected_namespaces=(),
|
41
|
-
)
|
42
|
-
|
43
|
-
def to_str(self) -> str:
|
44
|
-
"""Returns the string representation of the model using alias"""
|
45
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
46
|
-
|
47
|
-
def to_json(self) -> str:
|
48
|
-
"""Returns the JSON representation of the model using alias"""
|
49
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
50
|
-
return json.dumps(self.to_dict())
|
51
|
-
|
52
|
-
@classmethod
|
53
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
54
|
-
"""Create an instance of BodyUpdateProduct from a JSON string"""
|
55
|
-
return cls.from_dict(json.loads(json_str))
|
56
|
-
|
57
|
-
def to_dict(self) -> Dict[str, Any]:
|
58
|
-
"""Return the dictionary representation of the model using alias.
|
59
|
-
|
60
|
-
This has the following differences from calling pydantic's
|
61
|
-
`self.model_dump(by_alias=True)`:
|
62
|
-
|
63
|
-
* `None` is only added to the output dict for nullable fields that
|
64
|
-
were set at model initialization. Other fields with value `None`
|
65
|
-
are ignored.
|
66
|
-
"""
|
67
|
-
excluded_fields: Set[str] = set([])
|
68
|
-
|
69
|
-
_dict = self.model_dump(
|
70
|
-
by_alias=True,
|
71
|
-
exclude=excluded_fields,
|
72
|
-
exclude_none=True,
|
73
|
-
)
|
74
|
-
# override the default output from pydantic by calling `to_dict()` of product
|
75
|
-
if self.product:
|
76
|
-
_dict["product"] = self.product.to_dict()
|
77
|
-
return _dict
|
78
|
-
|
79
|
-
@classmethod
|
80
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
81
|
-
"""Create an instance of BodyUpdateProduct from a dict"""
|
82
|
-
if obj is None:
|
83
|
-
return None
|
84
|
-
|
85
|
-
if not isinstance(obj, dict):
|
86
|
-
return cls.model_validate(obj)
|
87
|
-
|
88
|
-
_obj = cls.model_validate(
|
89
|
-
{
|
90
|
-
"product": (
|
91
|
-
ProductModel.from_dict(obj["product"])
|
92
|
-
if obj.get("product") is not None
|
93
|
-
else None
|
94
|
-
),
|
95
|
-
"scopes": obj.get("scopes"),
|
96
|
-
}
|
97
|
-
)
|
98
|
-
return _obj
|
@@ -1,101 +0,0 @@
|
|
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 BaseModel, ConfigDict, Field
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
-
from crypticorn.pay.client.models.now_payment_model import NowPaymentModel
|
23
|
-
from typing import Optional, Set
|
24
|
-
from typing_extensions import Self
|
25
|
-
|
26
|
-
|
27
|
-
class CombinedPaymentHistory(BaseModel):
|
28
|
-
"""
|
29
|
-
Combined payment history across all services
|
30
|
-
""" # noqa: E501
|
31
|
-
|
32
|
-
now: Optional[List[NowPaymentModel]] = Field(
|
33
|
-
default=None, description="NOWPayments payment history"
|
34
|
-
)
|
35
|
-
__properties: ClassVar[List[str]] = ["now"]
|
36
|
-
|
37
|
-
model_config = ConfigDict(
|
38
|
-
populate_by_name=True,
|
39
|
-
validate_assignment=True,
|
40
|
-
protected_namespaces=(),
|
41
|
-
)
|
42
|
-
|
43
|
-
def to_str(self) -> str:
|
44
|
-
"""Returns the string representation of the model using alias"""
|
45
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
46
|
-
|
47
|
-
def to_json(self) -> str:
|
48
|
-
"""Returns the JSON representation of the model using alias"""
|
49
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
50
|
-
return json.dumps(self.to_dict())
|
51
|
-
|
52
|
-
@classmethod
|
53
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
54
|
-
"""Create an instance of CombinedPaymentHistory from a JSON string"""
|
55
|
-
return cls.from_dict(json.loads(json_str))
|
56
|
-
|
57
|
-
def to_dict(self) -> Dict[str, Any]:
|
58
|
-
"""Return the dictionary representation of the model using alias.
|
59
|
-
|
60
|
-
This has the following differences from calling pydantic's
|
61
|
-
`self.model_dump(by_alias=True)`:
|
62
|
-
|
63
|
-
* `None` is only added to the output dict for nullable fields that
|
64
|
-
were set at model initialization. Other fields with value `None`
|
65
|
-
are ignored.
|
66
|
-
"""
|
67
|
-
excluded_fields: Set[str] = set([])
|
68
|
-
|
69
|
-
_dict = self.model_dump(
|
70
|
-
by_alias=True,
|
71
|
-
exclude=excluded_fields,
|
72
|
-
exclude_none=True,
|
73
|
-
)
|
74
|
-
# override the default output from pydantic by calling `to_dict()` of each item in now (list)
|
75
|
-
_items = []
|
76
|
-
if self.now:
|
77
|
-
for _item_now in self.now:
|
78
|
-
if _item_now:
|
79
|
-
_items.append(_item_now.to_dict())
|
80
|
-
_dict["now"] = _items
|
81
|
-
return _dict
|
82
|
-
|
83
|
-
@classmethod
|
84
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
85
|
-
"""Create an instance of CombinedPaymentHistory from a dict"""
|
86
|
-
if obj is None:
|
87
|
-
return None
|
88
|
-
|
89
|
-
if not isinstance(obj, dict):
|
90
|
-
return cls.model_validate(obj)
|
91
|
-
|
92
|
-
_obj = cls.model_validate(
|
93
|
-
{
|
94
|
-
"now": (
|
95
|
-
[NowPaymentModel.from_dict(_item) for _item in obj["now"]]
|
96
|
-
if obj.get("now") is not None
|
97
|
-
else None
|
98
|
-
)
|
99
|
-
}
|
100
|
-
)
|
101
|
-
return _obj
|
@@ -1,188 +0,0 @@
|
|
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
|
-
Field,
|
24
|
-
StrictBool,
|
25
|
-
StrictFloat,
|
26
|
-
StrictInt,
|
27
|
-
StrictStr,
|
28
|
-
)
|
29
|
-
from typing import Any, ClassVar, Dict, List, Optional, Union
|
30
|
-
from typing import Optional, Set
|
31
|
-
from typing_extensions import Self
|
32
|
-
|
33
|
-
|
34
|
-
class CreateInvoiceReq(BaseModel):
|
35
|
-
"""
|
36
|
-
Request model for creating a payment invoice. Creates a payment link where the customer can complete the payment. With this method, the customer is required to follow the generated url to complete the payment. https://documenter.getpostman.com/view/7907941/2s93JusNJt#f5e4e645-dce2-4b06-b2ca-2a29aaa5e845
|
37
|
-
""" # noqa: E501
|
38
|
-
|
39
|
-
price_amount: Union[StrictFloat, StrictInt] = Field(
|
40
|
-
description="Amount to pay in fiat currency"
|
41
|
-
)
|
42
|
-
price_currency: StrictStr = Field(
|
43
|
-
description="Fiat currency for the price (usd, eur, etc)"
|
44
|
-
)
|
45
|
-
pay_currency: Optional[StrictStr] = None
|
46
|
-
ipn_callback_url: Optional[StrictStr] = None
|
47
|
-
order_id: Optional[StrictStr] = None
|
48
|
-
order_description: Optional[StrictStr] = None
|
49
|
-
success_url: Optional[StrictStr] = None
|
50
|
-
cancel_url: Optional[StrictStr] = None
|
51
|
-
partially_paid_url: Optional[StrictStr] = None
|
52
|
-
is_fixed_rate: Optional[StrictBool] = None
|
53
|
-
is_fee_paid_by_user: Optional[StrictBool] = None
|
54
|
-
__properties: ClassVar[List[str]] = [
|
55
|
-
"price_amount",
|
56
|
-
"price_currency",
|
57
|
-
"pay_currency",
|
58
|
-
"ipn_callback_url",
|
59
|
-
"order_id",
|
60
|
-
"order_description",
|
61
|
-
"success_url",
|
62
|
-
"cancel_url",
|
63
|
-
"partially_paid_url",
|
64
|
-
"is_fixed_rate",
|
65
|
-
"is_fee_paid_by_user",
|
66
|
-
]
|
67
|
-
|
68
|
-
model_config = ConfigDict(
|
69
|
-
populate_by_name=True,
|
70
|
-
validate_assignment=True,
|
71
|
-
protected_namespaces=(),
|
72
|
-
)
|
73
|
-
|
74
|
-
def to_str(self) -> str:
|
75
|
-
"""Returns the string representation of the model using alias"""
|
76
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
77
|
-
|
78
|
-
def to_json(self) -> str:
|
79
|
-
"""Returns the JSON representation of the model using alias"""
|
80
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
81
|
-
return json.dumps(self.to_dict())
|
82
|
-
|
83
|
-
@classmethod
|
84
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
85
|
-
"""Create an instance of CreateInvoiceReq from a JSON string"""
|
86
|
-
return cls.from_dict(json.loads(json_str))
|
87
|
-
|
88
|
-
def to_dict(self) -> Dict[str, Any]:
|
89
|
-
"""Return the dictionary representation of the model using alias.
|
90
|
-
|
91
|
-
This has the following differences from calling pydantic's
|
92
|
-
`self.model_dump(by_alias=True)`:
|
93
|
-
|
94
|
-
* `None` is only added to the output dict for nullable fields that
|
95
|
-
were set at model initialization. Other fields with value `None`
|
96
|
-
are ignored.
|
97
|
-
"""
|
98
|
-
excluded_fields: Set[str] = set([])
|
99
|
-
|
100
|
-
_dict = self.model_dump(
|
101
|
-
by_alias=True,
|
102
|
-
exclude=excluded_fields,
|
103
|
-
exclude_none=True,
|
104
|
-
)
|
105
|
-
# set to None if pay_currency (nullable) is None
|
106
|
-
# and model_fields_set contains the field
|
107
|
-
if self.pay_currency is None and "pay_currency" in self.model_fields_set:
|
108
|
-
_dict["pay_currency"] = None
|
109
|
-
|
110
|
-
# set to None if ipn_callback_url (nullable) is None
|
111
|
-
# and model_fields_set contains the field
|
112
|
-
if (
|
113
|
-
self.ipn_callback_url is None
|
114
|
-
and "ipn_callback_url" in self.model_fields_set
|
115
|
-
):
|
116
|
-
_dict["ipn_callback_url"] = None
|
117
|
-
|
118
|
-
# set to None if order_id (nullable) is None
|
119
|
-
# and model_fields_set contains the field
|
120
|
-
if self.order_id is None and "order_id" in self.model_fields_set:
|
121
|
-
_dict["order_id"] = None
|
122
|
-
|
123
|
-
# set to None if order_description (nullable) is None
|
124
|
-
# and model_fields_set contains the field
|
125
|
-
if (
|
126
|
-
self.order_description is None
|
127
|
-
and "order_description" in self.model_fields_set
|
128
|
-
):
|
129
|
-
_dict["order_description"] = None
|
130
|
-
|
131
|
-
# set to None if success_url (nullable) is None
|
132
|
-
# and model_fields_set contains the field
|
133
|
-
if self.success_url is None and "success_url" in self.model_fields_set:
|
134
|
-
_dict["success_url"] = None
|
135
|
-
|
136
|
-
# set to None if cancel_url (nullable) is None
|
137
|
-
# and model_fields_set contains the field
|
138
|
-
if self.cancel_url is None and "cancel_url" in self.model_fields_set:
|
139
|
-
_dict["cancel_url"] = None
|
140
|
-
|
141
|
-
# set to None if partially_paid_url (nullable) is None
|
142
|
-
# and model_fields_set contains the field
|
143
|
-
if (
|
144
|
-
self.partially_paid_url is None
|
145
|
-
and "partially_paid_url" in self.model_fields_set
|
146
|
-
):
|
147
|
-
_dict["partially_paid_url"] = None
|
148
|
-
|
149
|
-
# set to None if is_fixed_rate (nullable) is None
|
150
|
-
# and model_fields_set contains the field
|
151
|
-
if self.is_fixed_rate is None and "is_fixed_rate" in self.model_fields_set:
|
152
|
-
_dict["is_fixed_rate"] = None
|
153
|
-
|
154
|
-
# set to None if is_fee_paid_by_user (nullable) is None
|
155
|
-
# and model_fields_set contains the field
|
156
|
-
if (
|
157
|
-
self.is_fee_paid_by_user is None
|
158
|
-
and "is_fee_paid_by_user" in self.model_fields_set
|
159
|
-
):
|
160
|
-
_dict["is_fee_paid_by_user"] = None
|
161
|
-
|
162
|
-
return _dict
|
163
|
-
|
164
|
-
@classmethod
|
165
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
166
|
-
"""Create an instance of CreateInvoiceReq from a dict"""
|
167
|
-
if obj is None:
|
168
|
-
return None
|
169
|
-
|
170
|
-
if not isinstance(obj, dict):
|
171
|
-
return cls.model_validate(obj)
|
172
|
-
|
173
|
-
_obj = cls.model_validate(
|
174
|
-
{
|
175
|
-
"price_amount": obj.get("price_amount"),
|
176
|
-
"price_currency": obj.get("price_currency"),
|
177
|
-
"pay_currency": obj.get("pay_currency"),
|
178
|
-
"ipn_callback_url": obj.get("ipn_callback_url"),
|
179
|
-
"order_id": obj.get("order_id"),
|
180
|
-
"order_description": obj.get("order_description"),
|
181
|
-
"success_url": obj.get("success_url"),
|
182
|
-
"cancel_url": obj.get("cancel_url"),
|
183
|
-
"partially_paid_url": obj.get("partially_paid_url"),
|
184
|
-
"is_fixed_rate": obj.get("is_fixed_rate"),
|
185
|
-
"is_fee_paid_by_user": obj.get("is_fee_paid_by_user"),
|
186
|
-
}
|
187
|
-
)
|
188
|
-
return _obj
|