crypticorn 2.5.1__py3-none-any.whl → 2.5.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 (191) hide show
  1. crypticorn/cli/init.py +3 -0
  2. crypticorn/common/__init__.py +1 -0
  3. crypticorn/common/enums.py +3 -1
  4. crypticorn/common/errors.py +42 -21
  5. crypticorn/common/mixins.py +20 -0
  6. crypticorn/common/scopes.py +4 -20
  7. crypticorn/common/status_router.py +44 -0
  8. crypticorn/common/utils.py +13 -14
  9. crypticorn/hive/client/__init__.py +1 -5
  10. crypticorn/hive/client/api/data_api.py +1 -33
  11. crypticorn/hive/client/api/models_api.py +8 -104
  12. crypticorn/hive/client/api/status_api.py +481 -9
  13. crypticorn/hive/client/configuration.py +12 -4
  14. crypticorn/hive/client/models/__init__.py +1 -5
  15. crypticorn/hive/client/models/coins.py +0 -1
  16. crypticorn/hive/client/models/data_version.py +0 -1
  17. crypticorn/{metrics/client/models/error_response.py → hive/client/models/exception_detail.py} +26 -21
  18. crypticorn/hive/client/rest.py +4 -1
  19. crypticorn/klines/client/__init__.py +0 -5
  20. crypticorn/klines/client/api/change_in_timeframe_api.py +8 -9
  21. crypticorn/klines/client/api/ohlcv_data_api.py +7 -8
  22. crypticorn/klines/client/api/status_api.py +481 -6
  23. crypticorn/klines/client/api/symbols_api.py +7 -8
  24. crypticorn/klines/client/api/udf_api.py +0 -227
  25. crypticorn/klines/client/models/__init__.py +0 -5
  26. crypticorn/klines/client/models/exception_detail.py +3 -6
  27. crypticorn/klines/client/models/search_symbol.py +4 -3
  28. crypticorn/klines/client/models/udf_config.py +1 -2
  29. crypticorn/metrics/client/__init__.py +1 -6
  30. crypticorn/metrics/client/api/exchanges_api.py +29 -31
  31. crypticorn/metrics/client/api/indicators_api.py +15 -16
  32. crypticorn/metrics/client/api/logs_api.py +1 -1
  33. crypticorn/metrics/client/api/marketcap_api.py +15 -16
  34. crypticorn/metrics/client/api/markets_api.py +15 -16
  35. crypticorn/metrics/client/api/status_api.py +477 -2
  36. crypticorn/metrics/client/api/tokens_api.py +1 -1
  37. crypticorn/metrics/client/api_client.py +1 -1
  38. crypticorn/metrics/client/configuration.py +3 -5
  39. crypticorn/metrics/client/exceptions.py +1 -1
  40. crypticorn/metrics/client/models/__init__.py +1 -6
  41. crypticorn/metrics/client/models/exception_detail.py +4 -7
  42. crypticorn/metrics/client/models/severity.py +1 -1
  43. crypticorn/metrics/client/models/time_interval.py +1 -1
  44. crypticorn/metrics/client/models/trading_status.py +1 -1
  45. crypticorn/metrics/client/rest.py +1 -1
  46. crypticorn/pay/client/__init__.py +3 -8
  47. crypticorn/pay/client/api/now_payments_api.py +14 -17
  48. crypticorn/pay/client/api/payments_api.py +2 -11
  49. crypticorn/pay/client/api/products_api.py +2 -11
  50. crypticorn/pay/client/api/status_api.py +483 -8
  51. crypticorn/pay/client/api_client.py +2 -2
  52. crypticorn/pay/client/configuration.py +3 -3
  53. crypticorn/pay/client/exceptions.py +2 -2
  54. crypticorn/pay/client/models/__init__.py +3 -8
  55. crypticorn/{metrics/client/models/base_response_dict.py → pay/client/models/exception_detail.py} +28 -20
  56. crypticorn/pay/client/models/now_create_invoice_req.py +2 -2
  57. crypticorn/pay/client/models/now_create_invoice_res.py +2 -2
  58. crypticorn/pay/client/models/payment.py +2 -2
  59. crypticorn/pay/client/models/payment_status.py +2 -2
  60. crypticorn/pay/client/models/product_create.py +2 -2
  61. crypticorn/pay/client/models/product_read.py +2 -2
  62. crypticorn/pay/client/models/product_sub_read.py +2 -2
  63. crypticorn/pay/client/models/product_update.py +2 -2
  64. crypticorn/pay/client/models/scope.py +2 -2
  65. crypticorn/pay/client/models/services.py +2 -2
  66. crypticorn/pay/client/rest.py +2 -2
  67. crypticorn/trade/client/__init__.py +4 -9
  68. crypticorn/trade/client/api/api_keys_api.py +5 -20
  69. crypticorn/trade/client/api/bots_api.py +7 -19
  70. crypticorn/trade/client/api/exchanges_api.py +8 -8
  71. crypticorn/trade/client/api/futures_trading_panel_api.py +10 -22
  72. crypticorn/trade/client/api/notifications_api.py +10 -25
  73. crypticorn/trade/client/api/orders_api.py +2 -5
  74. crypticorn/trade/client/api/status_api.py +483 -8
  75. crypticorn/trade/client/api/strategies_api.py +5 -17
  76. crypticorn/trade/client/api/trading_actions_api.py +18 -26
  77. crypticorn/trade/client/api_client.py +2 -2
  78. crypticorn/trade/client/configuration.py +5 -5
  79. crypticorn/trade/client/exceptions.py +2 -2
  80. crypticorn/trade/client/models/__init__.py +4 -9
  81. crypticorn/trade/client/models/action_model.py +3 -4
  82. crypticorn/trade/client/models/bot_model.py +2 -2
  83. crypticorn/trade/client/models/bot_status.py +2 -2
  84. crypticorn/{klines/client/models/error_response.py → trade/client/models/exception_detail.py} +26 -21
  85. crypticorn/trade/client/models/exchange_key_model.py +4 -13
  86. crypticorn/trade/client/models/execution_ids.py +2 -2
  87. crypticorn/trade/client/models/futures_balance.py +2 -2
  88. crypticorn/trade/client/models/futures_trading_action.py +3 -4
  89. crypticorn/trade/client/models/margin_mode.py +2 -2
  90. crypticorn/trade/client/models/notification_model.py +2 -2
  91. crypticorn/trade/client/models/order_model.py +6 -16
  92. crypticorn/trade/client/models/order_status.py +2 -2
  93. crypticorn/trade/client/models/post_futures_action.py +2 -2
  94. crypticorn/trade/client/models/spot_trading_action.py +3 -4
  95. crypticorn/trade/client/models/strategy_exchange_info.py +4 -5
  96. crypticorn/trade/client/models/strategy_model_input.py +3 -4
  97. crypticorn/trade/client/models/strategy_model_output.py +3 -4
  98. crypticorn/trade/client/models/tpsl.py +5 -3
  99. crypticorn/trade/client/models/trading_action_type.py +2 -2
  100. crypticorn/trade/client/rest.py +2 -2
  101. {crypticorn-2.5.1.dist-info → crypticorn-2.5.3.dist-info}/METADATA +1 -1
  102. crypticorn-2.5.3.dist-info/RECORD +223 -0
  103. crypticorn/hive/client/models/http_validation_error.py +0 -99
  104. crypticorn/hive/client/models/validation_error.py +0 -105
  105. crypticorn/hive/client/models/validation_error_loc_inner.py +0 -159
  106. crypticorn/klines/client/api/health_check_api.py +0 -265
  107. crypticorn/klines/client/models/api_error_identifier.py +0 -108
  108. crypticorn/klines/client/models/api_error_level.py +0 -37
  109. crypticorn/klines/client/models/api_error_type.py +0 -37
  110. crypticorn/klines/client/models/base_response_health_check_response.py +0 -114
  111. crypticorn/klines/client/models/base_response_list_change_in_timeframe_response.py +0 -123
  112. crypticorn/klines/client/models/base_response_list_funding_rate_response.py +0 -118
  113. crypticorn/klines/client/models/base_response_list_str.py +0 -106
  114. crypticorn/klines/client/models/base_response_ohlcv_response.py +0 -114
  115. crypticorn/klines/client/models/change_in_timeframe_response.py +0 -86
  116. crypticorn/klines/client/models/exchange.py +0 -91
  117. crypticorn/klines/client/models/funding_rate_response.py +0 -92
  118. crypticorn/klines/client/models/health_check_response.py +0 -91
  119. crypticorn/klines/client/models/history_error_response.py +0 -89
  120. crypticorn/klines/client/models/history_no_data_response.py +0 -99
  121. crypticorn/klines/client/models/history_success_response.py +0 -99
  122. crypticorn/klines/client/models/http_validation_error.py +0 -99
  123. crypticorn/klines/client/models/internal_exchange.py +0 -39
  124. crypticorn/klines/client/models/market.py +0 -35
  125. crypticorn/klines/client/models/market_type.py +0 -35
  126. crypticorn/klines/client/models/ohlcv_response.py +0 -105
  127. crypticorn/klines/client/models/response_get_history_udf_history_get.py +0 -198
  128. crypticorn/klines/client/models/response_get_udf_history.py +0 -198
  129. crypticorn/klines/client/models/search_symbol_response.py +0 -104
  130. crypticorn/klines/client/models/symbol_group_response.py +0 -83
  131. crypticorn/klines/client/models/symbol_info_response.py +0 -131
  132. crypticorn/klines/client/models/udf_config_response.py +0 -160
  133. crypticorn/klines/client/models/validation_error.py +0 -105
  134. crypticorn/klines/client/models/validation_error_loc_inner.py +0 -159
  135. crypticorn/metrics/client/api/health_check_api.py +0 -265
  136. crypticorn/metrics/client/models/api_error_identifier.py +0 -108
  137. crypticorn/metrics/client/models/api_error_level.py +0 -37
  138. crypticorn/metrics/client/models/api_error_type.py +0 -37
  139. crypticorn/metrics/client/models/base_response_health_check_response.py +0 -114
  140. crypticorn/metrics/client/models/base_response_list_dict.py +0 -106
  141. crypticorn/metrics/client/models/base_response_list_exchange_mapping.py +0 -118
  142. crypticorn/metrics/client/models/base_response_list_str.py +0 -106
  143. crypticorn/metrics/client/models/exchange_mapping.py +0 -134
  144. crypticorn/metrics/client/models/health_check_response.py +0 -91
  145. crypticorn/metrics/client/models/http_validation_error.py +0 -99
  146. crypticorn/metrics/client/models/internal_exchange.py +0 -39
  147. crypticorn/metrics/client/models/market.py +0 -35
  148. crypticorn/metrics/client/models/market_type.py +0 -35
  149. crypticorn/metrics/client/models/validation_error.py +0 -105
  150. crypticorn/metrics/client/models/validation_error_loc_inner.py +0 -159
  151. crypticorn/pay/client/models/api_status_res.py +0 -83
  152. crypticorn/pay/client/models/body_create_now_invoice.py +0 -98
  153. crypticorn/pay/client/models/body_create_product.py +0 -98
  154. crypticorn/pay/client/models/body_get_products.py +0 -87
  155. crypticorn/pay/client/models/body_handle_now_webhook.py +0 -98
  156. crypticorn/pay/client/models/body_update_product.py +0 -98
  157. crypticorn/pay/client/models/combined_payment_history.py +0 -101
  158. crypticorn/pay/client/models/create_invoice_req.py +0 -188
  159. crypticorn/pay/client/models/create_invoice_res.py +0 -188
  160. crypticorn/pay/client/models/currency.py +0 -165
  161. crypticorn/pay/client/models/estimate_price_req.py +0 -91
  162. crypticorn/pay/client/models/estimate_price_res.py +0 -102
  163. crypticorn/pay/client/models/get_currencies_res.py +0 -99
  164. crypticorn/pay/client/models/get_payment_status_res.py +0 -222
  165. crypticorn/pay/client/models/get_payments_list_res.py +0 -109
  166. crypticorn/pay/client/models/http_validation_error.py +0 -99
  167. crypticorn/pay/client/models/min_amount_req.py +0 -124
  168. crypticorn/pay/client/models/min_amount_res.py +0 -105
  169. crypticorn/pay/client/models/now_api_status_res.py +0 -83
  170. crypticorn/pay/client/models/now_fee_structure.py +0 -104
  171. crypticorn/pay/client/models/now_payment_model.py +0 -124
  172. crypticorn/pay/client/models/now_payment_status.py +0 -42
  173. crypticorn/pay/client/models/now_webhook_payload.py +0 -181
  174. crypticorn/pay/client/models/partial_product_update_model.py +0 -150
  175. crypticorn/pay/client/models/product.py +0 -87
  176. crypticorn/pay/client/models/product_model.py +0 -128
  177. crypticorn/pay/client/models/product_subs_model.py +0 -108
  178. crypticorn/pay/client/models/product_update_model.py +0 -150
  179. crypticorn/pay/client/models/unified_payment_model.py +0 -112
  180. crypticorn/pay/client/models/validation_error.py +0 -105
  181. crypticorn/pay/client/models/validation_error_loc_inner.py +0 -159
  182. crypticorn/trade/client/models/api_key_model.py +0 -156
  183. crypticorn/trade/client/models/exchange.py +0 -35
  184. crypticorn/trade/client/models/http_validation_error.py +0 -99
  185. crypticorn/trade/client/models/market_type.py +0 -35
  186. crypticorn/trade/client/models/validation_error.py +0 -105
  187. crypticorn/trade/client/models/validation_error_loc_inner.py +0 -159
  188. crypticorn-2.5.1.dist-info/RECORD +0 -307
  189. {crypticorn-2.5.1.dist-info → crypticorn-2.5.3.dist-info}/WHEEL +0 -0
  190. {crypticorn-2.5.1.dist-info → crypticorn-2.5.3.dist-info}/entry_points.txt +0 -0
  191. {crypticorn-2.5.1.dist-info → crypticorn-2.5.3.dist-info}/top_level.txt +0 -0
@@ -1,83 +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, StrictStr
21
- from typing import Any, ClassVar, Dict, List
22
- from typing import Optional, Set
23
- from typing_extensions import Self
24
-
25
-
26
- class NowAPIStatusRes(BaseModel):
27
- """
28
- Response for the API status.
29
- """ # noqa: E501
30
-
31
- message: StrictStr = Field(description="API status message")
32
- __properties: ClassVar[List[str]] = ["message"]
33
-
34
- model_config = ConfigDict(
35
- populate_by_name=True,
36
- validate_assignment=True,
37
- protected_namespaces=(),
38
- )
39
-
40
- def to_str(self) -> str:
41
- """Returns the string representation of the model using alias"""
42
- return pprint.pformat(self.model_dump(by_alias=True))
43
-
44
- def to_json(self) -> str:
45
- """Returns the JSON representation of the model using alias"""
46
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
- return json.dumps(self.to_dict())
48
-
49
- @classmethod
50
- def from_json(cls, json_str: str) -> Optional[Self]:
51
- """Create an instance of NowAPIStatusRes from a JSON string"""
52
- return cls.from_dict(json.loads(json_str))
53
-
54
- def to_dict(self) -> Dict[str, Any]:
55
- """Return the dictionary representation of the model using alias.
56
-
57
- This has the following differences from calling pydantic's
58
- `self.model_dump(by_alias=True)`:
59
-
60
- * `None` is only added to the output dict for nullable fields that
61
- were set at model initialization. Other fields with value `None`
62
- are ignored.
63
- """
64
- excluded_fields: Set[str] = set([])
65
-
66
- _dict = self.model_dump(
67
- by_alias=True,
68
- exclude=excluded_fields,
69
- exclude_none=True,
70
- )
71
- return _dict
72
-
73
- @classmethod
74
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
- """Create an instance of NowAPIStatusRes from a dict"""
76
- if obj is None:
77
- return None
78
-
79
- if not isinstance(obj, dict):
80
- return cls.model_validate(obj)
81
-
82
- _obj = cls.model_validate({"message": obj.get("message")})
83
- return _obj
@@ -1,104 +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, StrictFloat, StrictInt, StrictStr
21
- from typing import Any, ClassVar, Dict, List, Union
22
- from typing import Optional, Set
23
- from typing_extensions import Self
24
-
25
-
26
- class NowFeeStructure(BaseModel):
27
- """
28
- Fee structure for the payment
29
- """ # noqa: E501
30
-
31
- currency: StrictStr = Field(description="Currency of the fee")
32
- deposit_fee: Union[StrictFloat, StrictInt] = Field(
33
- description="Deposit fee amount", alias="depositFee"
34
- )
35
- service_fee: Union[StrictFloat, StrictInt] = Field(
36
- description="Service fee amount", alias="serviceFee"
37
- )
38
- withdrawal_fee: Union[StrictFloat, StrictInt] = Field(
39
- description="Withdrawal fee amount", alias="withdrawalFee"
40
- )
41
- __properties: ClassVar[List[str]] = [
42
- "currency",
43
- "depositFee",
44
- "serviceFee",
45
- "withdrawalFee",
46
- ]
47
-
48
- model_config = ConfigDict(
49
- populate_by_name=True,
50
- validate_assignment=True,
51
- protected_namespaces=(),
52
- )
53
-
54
- def to_str(self) -> str:
55
- """Returns the string representation of the model using alias"""
56
- return pprint.pformat(self.model_dump(by_alias=True))
57
-
58
- def to_json(self) -> str:
59
- """Returns the JSON representation of the model using alias"""
60
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
61
- return json.dumps(self.to_dict())
62
-
63
- @classmethod
64
- def from_json(cls, json_str: str) -> Optional[Self]:
65
- """Create an instance of NowFeeStructure from a JSON string"""
66
- return cls.from_dict(json.loads(json_str))
67
-
68
- def to_dict(self) -> Dict[str, Any]:
69
- """Return the dictionary representation of the model using alias.
70
-
71
- This has the following differences from calling pydantic's
72
- `self.model_dump(by_alias=True)`:
73
-
74
- * `None` is only added to the output dict for nullable fields that
75
- were set at model initialization. Other fields with value `None`
76
- are ignored.
77
- """
78
- excluded_fields: Set[str] = set([])
79
-
80
- _dict = self.model_dump(
81
- by_alias=True,
82
- exclude=excluded_fields,
83
- exclude_none=True,
84
- )
85
- return _dict
86
-
87
- @classmethod
88
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
- """Create an instance of NowFeeStructure from a dict"""
90
- if obj is None:
91
- return None
92
-
93
- if not isinstance(obj, dict):
94
- return cls.model_validate(obj)
95
-
96
- _obj = cls.model_validate(
97
- {
98
- "currency": obj.get("currency"),
99
- "depositFee": obj.get("depositFee"),
100
- "serviceFee": obj.get("serviceFee"),
101
- "withdrawalFee": obj.get("withdrawalFee"),
102
- }
103
- )
104
- return _obj
@@ -1,124 +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, StrictFloat, StrictInt, StrictStr
21
- from typing import Any, ClassVar, Dict, List, Union
22
- from crypticorn.pay.client.models.now_payment_status import NowPaymentStatus
23
- from typing import Optional, Set
24
- from typing_extensions import Self
25
-
26
-
27
- class NowPaymentModel(BaseModel):
28
- """
29
- NowPaymentModel
30
- """ # noqa: E501
31
-
32
- id: StrictStr = Field(description="Product ID")
33
- payment_id: StrictInt = Field(description="Unique payment identifier")
34
- invoice_id: StrictInt = Field(description="Associated invoice ID")
35
- product_id: StrictStr = Field(description="Product ID")
36
- user_id: StrictStr = Field(description="User ID")
37
- order_id: StrictStr = Field(description="Internal order ID")
38
- paid_amount: Union[StrictFloat, StrictInt] = Field(
39
- description="Actually paid amount"
40
- )
41
- pay_amount: Union[StrictFloat, StrictInt] = Field(description="Amount to pay")
42
- pay_currency: StrictStr = Field(description="Payment currency")
43
- status: NowPaymentStatus = Field(description="Current payment status")
44
- updated_at: StrictInt = Field(
45
- description="Payment last update timestamp in milliseconds"
46
- )
47
- __properties: ClassVar[List[str]] = [
48
- "id",
49
- "payment_id",
50
- "invoice_id",
51
- "product_id",
52
- "user_id",
53
- "order_id",
54
- "paid_amount",
55
- "pay_amount",
56
- "pay_currency",
57
- "status",
58
- "updated_at",
59
- ]
60
-
61
- model_config = ConfigDict(
62
- populate_by_name=True,
63
- validate_assignment=True,
64
- protected_namespaces=(),
65
- )
66
-
67
- def to_str(self) -> str:
68
- """Returns the string representation of the model using alias"""
69
- return pprint.pformat(self.model_dump(by_alias=True))
70
-
71
- def to_json(self) -> str:
72
- """Returns the JSON representation of the model using alias"""
73
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
74
- return json.dumps(self.to_dict())
75
-
76
- @classmethod
77
- def from_json(cls, json_str: str) -> Optional[Self]:
78
- """Create an instance of NowPaymentModel from a JSON string"""
79
- return cls.from_dict(json.loads(json_str))
80
-
81
- def to_dict(self) -> Dict[str, Any]:
82
- """Return the dictionary representation of the model using alias.
83
-
84
- This has the following differences from calling pydantic's
85
- `self.model_dump(by_alias=True)`:
86
-
87
- * `None` is only added to the output dict for nullable fields that
88
- were set at model initialization. Other fields with value `None`
89
- are ignored.
90
- """
91
- excluded_fields: Set[str] = set([])
92
-
93
- _dict = self.model_dump(
94
- by_alias=True,
95
- exclude=excluded_fields,
96
- exclude_none=True,
97
- )
98
- return _dict
99
-
100
- @classmethod
101
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
102
- """Create an instance of NowPaymentModel from a dict"""
103
- if obj is None:
104
- return None
105
-
106
- if not isinstance(obj, dict):
107
- return cls.model_validate(obj)
108
-
109
- _obj = cls.model_validate(
110
- {
111
- "id": obj.get("id"),
112
- "payment_id": obj.get("payment_id"),
113
- "invoice_id": obj.get("invoice_id"),
114
- "product_id": obj.get("product_id"),
115
- "user_id": obj.get("user_id"),
116
- "order_id": obj.get("order_id"),
117
- "paid_amount": obj.get("paid_amount"),
118
- "pay_amount": obj.get("pay_amount"),
119
- "pay_currency": obj.get("pay_currency"),
120
- "status": obj.get("status"),
121
- "updated_at": obj.get("updated_at"),
122
- }
123
- )
124
- return _obj
@@ -1,42 +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 json
17
- from enum import Enum
18
- from typing_extensions import Self
19
-
20
-
21
- class NowPaymentStatus(str, Enum):
22
- """
23
- Payment status for the payment
24
- """
25
-
26
- """
27
- allowed enum values
28
- """
29
- WAITING = "waiting"
30
- CONFIRMING = "confirming"
31
- CONFIRMED = "confirmed"
32
- SENDING = "sending"
33
- PARTIALLY_PAID = "partially_paid"
34
- FINISHED = "finished"
35
- FAILED = "failed"
36
- REFUNDED = "refunded"
37
- EXPIRED = "expired"
38
-
39
- @classmethod
40
- def from_json(cls, json_str: str) -> Self:
41
- """Create an instance of NowPaymentStatus from a JSON string"""
42
- return cls(json.loads(json_str))
@@ -1,181 +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, StrictFloat, StrictInt, StrictStr
21
- from typing import Any, ClassVar, Dict, List, Optional, Union
22
- from crypticorn.pay.client.models.now_fee_structure import NowFeeStructure
23
- from crypticorn.pay.client.models.now_payment_status import NowPaymentStatus
24
- from typing import Optional, Set
25
- from typing_extensions import Self
26
-
27
-
28
- class NowWebhookPayload(BaseModel):
29
- """
30
- Model for NOWPayments webhook (IPN) payload.
31
- """ # noqa: E501
32
-
33
- actually_paid: Union[StrictFloat, StrictInt] = Field(
34
- description="Actually paid amount"
35
- )
36
- actually_paid_at_fiat: Union[StrictFloat, StrictInt] = Field(
37
- description="Actually paid amount in fiat currency"
38
- )
39
- fee: NowFeeStructure
40
- invoice_id: StrictInt = Field(description="Associated invoice ID")
41
- order_description: StrictStr = Field(description="Order description")
42
- order_id: StrictStr = Field(description="Internal order ID")
43
- outcome_amount: Union[StrictFloat, StrictInt] = Field(description="Outcome amount")
44
- outcome_currency: StrictStr = Field(description="Outcome currency")
45
- parent_payment_id: Optional[StrictInt] = None
46
- pay_address: StrictStr = Field(description="Payment destination address")
47
- pay_amount: Union[StrictFloat, StrictInt] = Field(description="Amount to pay")
48
- pay_currency: StrictStr = Field(description="Payment currency")
49
- payment_id: StrictInt = Field(description="Unique payment identifier")
50
- payment_status: NowPaymentStatus = Field(description="Current payment status")
51
- price_amount: Union[StrictFloat, StrictInt] = Field(
52
- description="Original price amount"
53
- )
54
- price_currency: StrictStr = Field(description="Original price currency")
55
- purchase_id: StrictStr = Field(description="Purchase ID")
56
- updated_at: StrictInt = Field(
57
- description="Payment last update timestamp in milliseconds"
58
- )
59
- additional_properties: Dict[str, Any] = {}
60
- __properties: ClassVar[List[str]] = [
61
- "actually_paid",
62
- "actually_paid_at_fiat",
63
- "fee",
64
- "invoice_id",
65
- "order_description",
66
- "order_id",
67
- "outcome_amount",
68
- "outcome_currency",
69
- "parent_payment_id",
70
- "pay_address",
71
- "pay_amount",
72
- "pay_currency",
73
- "payment_id",
74
- "payment_status",
75
- "price_amount",
76
- "price_currency",
77
- "purchase_id",
78
- "updated_at",
79
- ]
80
-
81
- model_config = ConfigDict(
82
- populate_by_name=True,
83
- validate_assignment=True,
84
- protected_namespaces=(),
85
- )
86
-
87
- def to_str(self) -> str:
88
- """Returns the string representation of the model using alias"""
89
- return pprint.pformat(self.model_dump(by_alias=True))
90
-
91
- def to_json(self) -> str:
92
- """Returns the JSON representation of the model using alias"""
93
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
94
- return json.dumps(self.to_dict())
95
-
96
- @classmethod
97
- def from_json(cls, json_str: str) -> Optional[Self]:
98
- """Create an instance of NowWebhookPayload from a JSON string"""
99
- return cls.from_dict(json.loads(json_str))
100
-
101
- def to_dict(self) -> Dict[str, Any]:
102
- """Return the dictionary representation of the model using alias.
103
-
104
- This has the following differences from calling pydantic's
105
- `self.model_dump(by_alias=True)`:
106
-
107
- * `None` is only added to the output dict for nullable fields that
108
- were set at model initialization. Other fields with value `None`
109
- are ignored.
110
- * Fields in `self.additional_properties` are added to the output dict.
111
- """
112
- excluded_fields: Set[str] = set(
113
- [
114
- "additional_properties",
115
- ]
116
- )
117
-
118
- _dict = self.model_dump(
119
- by_alias=True,
120
- exclude=excluded_fields,
121
- exclude_none=True,
122
- )
123
- # override the default output from pydantic by calling `to_dict()` of fee
124
- if self.fee:
125
- _dict["fee"] = self.fee.to_dict()
126
- # puts key-value pairs in additional_properties in the top level
127
- if self.additional_properties is not None:
128
- for _key, _value in self.additional_properties.items():
129
- _dict[_key] = _value
130
-
131
- # set to None if parent_payment_id (nullable) is None
132
- # and model_fields_set contains the field
133
- if (
134
- self.parent_payment_id is None
135
- and "parent_payment_id" in self.model_fields_set
136
- ):
137
- _dict["parent_payment_id"] = None
138
-
139
- return _dict
140
-
141
- @classmethod
142
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
143
- """Create an instance of NowWebhookPayload from a dict"""
144
- if obj is None:
145
- return None
146
-
147
- if not isinstance(obj, dict):
148
- return cls.model_validate(obj)
149
-
150
- _obj = cls.model_validate(
151
- {
152
- "actually_paid": obj.get("actually_paid"),
153
- "actually_paid_at_fiat": obj.get("actually_paid_at_fiat"),
154
- "fee": (
155
- NowFeeStructure.from_dict(obj["fee"])
156
- if obj.get("fee") is not None
157
- else None
158
- ),
159
- "invoice_id": obj.get("invoice_id"),
160
- "order_description": obj.get("order_description"),
161
- "order_id": obj.get("order_id"),
162
- "outcome_amount": obj.get("outcome_amount"),
163
- "outcome_currency": obj.get("outcome_currency"),
164
- "parent_payment_id": obj.get("parent_payment_id"),
165
- "pay_address": obj.get("pay_address"),
166
- "pay_amount": obj.get("pay_amount"),
167
- "pay_currency": obj.get("pay_currency"),
168
- "payment_id": obj.get("payment_id"),
169
- "payment_status": obj.get("payment_status"),
170
- "price_amount": obj.get("price_amount"),
171
- "price_currency": obj.get("price_currency"),
172
- "purchase_id": obj.get("purchase_id"),
173
- "updated_at": obj.get("updated_at"),
174
- }
175
- )
176
- # store additional fields in additional_properties
177
- for _key in obj.keys():
178
- if _key not in cls.__properties:
179
- _obj.additional_properties[_key] = obj.get(_key)
180
-
181
- return _obj
@@ -1,150 +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
- 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