crypticorn 2.5.0rc5__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.
Files changed (144) hide show
  1. crypticorn/auth/main.py +2 -0
  2. crypticorn/client.py +60 -69
  3. crypticorn/common/__init__.py +3 -1
  4. crypticorn/common/auth.py +38 -20
  5. crypticorn/common/enums.py +4 -31
  6. crypticorn/common/errors.py +72 -17
  7. crypticorn/common/exceptions.py +29 -15
  8. crypticorn/common/mixins.py +37 -0
  9. crypticorn/common/status_router.py +42 -0
  10. crypticorn/common/urls.py +2 -1
  11. crypticorn/common/utils.py +9 -14
  12. crypticorn/hive/main.py +2 -0
  13. crypticorn/klines/client/__init__.py +10 -43
  14. crypticorn/klines/client/api/__init__.py +1 -1
  15. crypticorn/klines/client/api/change_in_timeframe_api.py +16 -31
  16. crypticorn/klines/client/api/funding_rates_api.py +8 -22
  17. crypticorn/klines/client/api/ohlcv_data_api.py +17 -38
  18. crypticorn/klines/client/api/{health_check_api.py → status_api.py} +18 -23
  19. crypticorn/klines/client/api/symbols_api.py +18 -34
  20. crypticorn/klines/client/api/udf_api.py +48 -59
  21. crypticorn/klines/client/api_client.py +1 -1
  22. crypticorn/klines/client/configuration.py +1 -1
  23. crypticorn/klines/client/exceptions.py +1 -1
  24. crypticorn/klines/client/models/__init__.py +9 -42
  25. crypticorn/klines/client/models/{change_in_timeframe_response.py → change_in_timeframe.py} +5 -5
  26. crypticorn/klines/client/models/{error_response.py → exception_detail.py} +25 -20
  27. crypticorn/klines/client/models/{funding_rate_response.py → funding_rate.py} +5 -5
  28. crypticorn/klines/client/models/{ohlcv_response.py → ohlcv_history.py} +14 -14
  29. crypticorn/klines/client/models/resolution.py +1 -1
  30. crypticorn/klines/client/models/{exchange.py → search_symbol.py} +17 -13
  31. crypticorn/klines/client/models/sort_direction.py +1 -1
  32. crypticorn/klines/client/models/{symbol_group_response.py → symbol_group.py} +5 -5
  33. crypticorn/klines/client/models/{symbol_info_response.py → symbol_info.py} +5 -5
  34. crypticorn/klines/client/models/symbol_type.py +1 -1
  35. crypticorn/klines/client/models/timeframe.py +1 -1
  36. crypticorn/klines/client/models/{udf_config_response.py → udf_config.py} +7 -19
  37. crypticorn/klines/client/rest.py +1 -1
  38. crypticorn/klines/main.py +40 -23
  39. crypticorn/metrics/client/__init__.py +3 -22
  40. crypticorn/metrics/client/api/__init__.py +1 -1
  41. crypticorn/metrics/client/api/exchanges_api.py +53 -97
  42. crypticorn/metrics/client/api/indicators_api.py +26 -52
  43. crypticorn/metrics/client/api/logs_api.py +8 -23
  44. crypticorn/metrics/client/api/marketcap_api.py +36 -88
  45. crypticorn/metrics/client/api/markets_api.py +26 -55
  46. crypticorn/metrics/client/api/{health_check_api.py → status_api.py} +18 -23
  47. crypticorn/metrics/client/api/tokens_api.py +7 -21
  48. crypticorn/metrics/client/api_client.py +1 -1
  49. crypticorn/metrics/client/configuration.py +1 -1
  50. crypticorn/metrics/client/exceptions.py +1 -1
  51. crypticorn/metrics/client/models/__init__.py +2 -21
  52. crypticorn/metrics/client/models/{error_response.py → exception_detail.py} +25 -20
  53. crypticorn/metrics/client/models/severity.py +1 -1
  54. crypticorn/metrics/client/models/time_interval.py +1 -1
  55. crypticorn/metrics/client/models/trading_status.py +1 -1
  56. crypticorn/metrics/client/rest.py +1 -1
  57. crypticorn/metrics/main.py +51 -43
  58. crypticorn/pay/main.py +2 -0
  59. crypticorn/trade/client/__init__.py +1 -5
  60. crypticorn/trade/client/api/exchanges_api.py +6 -6
  61. crypticorn/trade/client/api/trading_actions_api.py +16 -15
  62. crypticorn/trade/client/models/__init__.py +1 -5
  63. crypticorn/trade/client/models/action_model.py +1 -2
  64. crypticorn/trade/client/models/bot_model.py +3 -7
  65. crypticorn/trade/client/models/exchange_key_model.py +2 -11
  66. crypticorn/trade/client/models/execution_ids.py +1 -1
  67. crypticorn/trade/client/models/futures_trading_action.py +1 -2
  68. crypticorn/trade/client/models/notification_model.py +3 -12
  69. crypticorn/trade/client/models/order_model.py +7 -21
  70. crypticorn/trade/client/models/spot_trading_action.py +230 -0
  71. crypticorn/trade/client/models/strategy_exchange_info.py +2 -3
  72. crypticorn/trade/client/models/strategy_model_input.py +1 -2
  73. crypticorn/trade/client/models/strategy_model_output.py +1 -2
  74. crypticorn/trade/client/models/tpsl.py +3 -1
  75. crypticorn/trade/main.py +2 -0
  76. {crypticorn-2.5.0rc5.dist-info → crypticorn-2.5.2.dist-info}/METADATA +7 -5
  77. {crypticorn-2.5.0rc5.dist-info → crypticorn-2.5.2.dist-info}/RECORD +81 -141
  78. {crypticorn-2.5.0rc5.dist-info → crypticorn-2.5.2.dist-info}/WHEEL +1 -1
  79. crypticorn/common/sorter.py +0 -40
  80. crypticorn/klines/client/models/base_response_health_check_response.py +0 -114
  81. crypticorn/klines/client/models/base_response_list_change_in_timeframe_response.py +0 -123
  82. crypticorn/klines/client/models/base_response_list_funding_rate_response.py +0 -118
  83. crypticorn/klines/client/models/base_response_list_str.py +0 -106
  84. crypticorn/klines/client/models/base_response_ohlcv_response.py +0 -114
  85. crypticorn/klines/client/models/health_check_response.py +0 -91
  86. crypticorn/klines/client/models/history_error_response.py +0 -89
  87. crypticorn/klines/client/models/history_no_data_response.py +0 -99
  88. crypticorn/klines/client/models/history_success_response.py +0 -99
  89. crypticorn/klines/client/models/http_validation_error.py +0 -99
  90. crypticorn/klines/client/models/market.py +0 -35
  91. crypticorn/klines/client/models/market_type.py +0 -35
  92. crypticorn/klines/client/models/response_get_history_udf_history_get.py +0 -198
  93. crypticorn/klines/client/models/response_get_udf_history.py +0 -198
  94. crypticorn/klines/client/models/search_symbol_response.py +0 -104
  95. crypticorn/klines/client/models/validation_error.py +0 -105
  96. crypticorn/klines/client/models/validation_error_loc_inner.py +0 -159
  97. crypticorn/metrics/client/models/base_response_dict.py +0 -106
  98. crypticorn/metrics/client/models/base_response_health_check_response.py +0 -114
  99. crypticorn/metrics/client/models/base_response_list_dict.py +0 -106
  100. crypticorn/metrics/client/models/base_response_list_exchange_mapping.py +0 -118
  101. crypticorn/metrics/client/models/base_response_list_str.py +0 -106
  102. crypticorn/metrics/client/models/exchange_mapping.py +0 -134
  103. crypticorn/metrics/client/models/health_check_response.py +0 -91
  104. crypticorn/metrics/client/models/http_validation_error.py +0 -99
  105. crypticorn/metrics/client/models/market.py +0 -35
  106. crypticorn/metrics/client/models/market_type.py +0 -35
  107. crypticorn/metrics/client/models/validation_error.py +0 -105
  108. crypticorn/metrics/client/models/validation_error_loc_inner.py +0 -159
  109. crypticorn/pay/client/models/api_status_res.py +0 -83
  110. crypticorn/pay/client/models/body_create_now_invoice.py +0 -98
  111. crypticorn/pay/client/models/body_create_product.py +0 -98
  112. crypticorn/pay/client/models/body_get_products.py +0 -87
  113. crypticorn/pay/client/models/body_handle_now_webhook.py +0 -98
  114. crypticorn/pay/client/models/body_update_product.py +0 -98
  115. crypticorn/pay/client/models/combined_payment_history.py +0 -101
  116. crypticorn/pay/client/models/create_invoice_req.py +0 -188
  117. crypticorn/pay/client/models/create_invoice_res.py +0 -188
  118. crypticorn/pay/client/models/currency.py +0 -165
  119. crypticorn/pay/client/models/estimate_price_req.py +0 -91
  120. crypticorn/pay/client/models/estimate_price_res.py +0 -102
  121. crypticorn/pay/client/models/get_currencies_res.py +0 -99
  122. crypticorn/pay/client/models/get_payment_status_res.py +0 -222
  123. crypticorn/pay/client/models/get_payments_list_res.py +0 -109
  124. crypticorn/pay/client/models/min_amount_req.py +0 -124
  125. crypticorn/pay/client/models/min_amount_res.py +0 -105
  126. crypticorn/pay/client/models/now_fee_structure.py +0 -104
  127. crypticorn/pay/client/models/now_payment_model.py +0 -124
  128. crypticorn/pay/client/models/now_payment_status.py +0 -42
  129. crypticorn/pay/client/models/now_webhook_payload.py +0 -181
  130. crypticorn/pay/client/models/partial_product_update_model.py +0 -150
  131. crypticorn/pay/client/models/product.py +0 -87
  132. crypticorn/pay/client/models/product_model.py +0 -128
  133. crypticorn/pay/client/models/product_subs_model.py +0 -108
  134. crypticorn/pay/client/models/product_update_model.py +0 -150
  135. crypticorn/pay/client/models/unified_payment_model.py +0 -112
  136. crypticorn/trade/client/models/api_error_identifier.py +0 -104
  137. crypticorn/trade/client/models/api_error_level.py +0 -37
  138. crypticorn/trade/client/models/api_error_type.py +0 -37
  139. crypticorn/trade/client/models/api_key_model.py +0 -156
  140. crypticorn/trade/client/models/exchange.py +0 -35
  141. crypticorn/trade/client/models/market_type.py +0 -35
  142. /crypticorn/common/{pydantic.py → decorators.py} +0 -0
  143. {crypticorn-2.5.0rc5.dist-info → crypticorn-2.5.2.dist-info}/entry_points.txt +0 -0
  144. {crypticorn-2.5.0rc5.dist-info → crypticorn-2.5.2.dist-info}/top_level.txt +0 -0
@@ -1,104 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Klines Service API
5
-
6
- API for retrieving OHLCV data, funding rates, and symbol information from Binance. ## WebSocket Support Connect to `/ws` to receive real-time OHLCV updates. Example subscription message: ```json { \"action\": \"subscribe\", \"market\": \"spot\", \"symbol\": \"BTCUSDT\", \"timeframe\": \"15m\" } ```
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, 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 SearchSymbolResponse(BaseModel):
27
- """
28
- SearchSymbolResponse
29
- """ # noqa: E501
30
-
31
- symbol: StrictStr
32
- full_name: StrictStr
33
- description: StrictStr
34
- exchange: StrictStr
35
- ticker: StrictStr
36
- type: StrictStr
37
- __properties: ClassVar[List[str]] = [
38
- "symbol",
39
- "full_name",
40
- "description",
41
- "exchange",
42
- "ticker",
43
- "type",
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 SearchSymbolResponse 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
- return _dict
84
-
85
- @classmethod
86
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
87
- """Create an instance of SearchSymbolResponse from a dict"""
88
- if obj is None:
89
- return None
90
-
91
- if not isinstance(obj, dict):
92
- return cls.model_validate(obj)
93
-
94
- _obj = cls.model_validate(
95
- {
96
- "symbol": obj.get("symbol"),
97
- "full_name": obj.get("full_name"),
98
- "description": obj.get("description"),
99
- "exchange": obj.get("exchange"),
100
- "ticker": obj.get("ticker"),
101
- "type": obj.get("type"),
102
- }
103
- )
104
- return _obj
@@ -1,105 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Klines Service API
5
-
6
- API for retrieving OHLCV data, funding rates, and symbol information from Binance. ## WebSocket Support Connect to `/ws` to receive real-time OHLCV updates. Example subscription message: ```json { \"action\": \"subscribe\", \"market\": \"spot\", \"symbol\": \"BTCUSDT\", \"timeframe\": \"15m\" } ```
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, StrictStr
21
- from typing import Any, ClassVar, Dict, List
22
- from crypticorn.klines.client.models.validation_error_loc_inner import (
23
- ValidationErrorLocInner,
24
- )
25
- from typing import Optional, Set
26
- from typing_extensions import Self
27
-
28
-
29
- class ValidationError(BaseModel):
30
- """
31
- ValidationError
32
- """ # noqa: E501
33
-
34
- loc: List[ValidationErrorLocInner]
35
- msg: StrictStr
36
- type: StrictStr
37
- __properties: ClassVar[List[str]] = ["loc", "msg", "type"]
38
-
39
- model_config = ConfigDict(
40
- populate_by_name=True,
41
- validate_assignment=True,
42
- protected_namespaces=(),
43
- )
44
-
45
- def to_str(self) -> str:
46
- """Returns the string representation of the model using alias"""
47
- return pprint.pformat(self.model_dump(by_alias=True))
48
-
49
- def to_json(self) -> str:
50
- """Returns the JSON representation of the model using alias"""
51
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
- return json.dumps(self.to_dict())
53
-
54
- @classmethod
55
- def from_json(cls, json_str: str) -> Optional[Self]:
56
- """Create an instance of ValidationError from a JSON string"""
57
- return cls.from_dict(json.loads(json_str))
58
-
59
- def to_dict(self) -> Dict[str, Any]:
60
- """Return the dictionary representation of the model using alias.
61
-
62
- This has the following differences from calling pydantic's
63
- `self.model_dump(by_alias=True)`:
64
-
65
- * `None` is only added to the output dict for nullable fields that
66
- were set at model initialization. Other fields with value `None`
67
- are ignored.
68
- """
69
- excluded_fields: Set[str] = set([])
70
-
71
- _dict = self.model_dump(
72
- by_alias=True,
73
- exclude=excluded_fields,
74
- exclude_none=True,
75
- )
76
- # override the default output from pydantic by calling `to_dict()` of each item in loc (list)
77
- _items = []
78
- if self.loc:
79
- for _item_loc in self.loc:
80
- if _item_loc:
81
- _items.append(_item_loc.to_dict())
82
- _dict["loc"] = _items
83
- return _dict
84
-
85
- @classmethod
86
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
87
- """Create an instance of ValidationError from a dict"""
88
- if obj is None:
89
- return None
90
-
91
- if not isinstance(obj, dict):
92
- return cls.model_validate(obj)
93
-
94
- _obj = cls.model_validate(
95
- {
96
- "loc": (
97
- [ValidationErrorLocInner.from_dict(_item) for _item in obj["loc"]]
98
- if obj.get("loc") is not None
99
- else None
100
- ),
101
- "msg": obj.get("msg"),
102
- "type": obj.get("type"),
103
- }
104
- )
105
- return _obj
@@ -1,159 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Klines Service API
5
-
6
- API for retrieving OHLCV data, funding rates, and symbol information from Binance. ## WebSocket Support Connect to `/ws` to receive real-time OHLCV updates. Example subscription message: ```json { \"action\": \"subscribe\", \"market\": \"spot\", \"symbol\": \"BTCUSDT\", \"timeframe\": \"15m\" } ```
7
-
8
- The version of the OpenAPI document: 1.0.0
9
- Generated by OpenAPI Generator (https://openapi-generator.tech)
10
-
11
- Do not edit the class manually.
12
- """ # noqa: E501
13
-
14
-
15
- from __future__ import annotations
16
- from inspect import getfullargspec
17
- import json
18
- import pprint
19
- import re # noqa: F401
20
- from pydantic import (
21
- BaseModel,
22
- ConfigDict,
23
- Field,
24
- StrictInt,
25
- StrictStr,
26
- ValidationError,
27
- field_validator,
28
- )
29
- from typing import Optional
30
- from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
31
- from typing_extensions import Literal, Self
32
- from pydantic import Field
33
-
34
- VALIDATIONERRORLOCINNER_ANY_OF_SCHEMAS = ["int", "str"]
35
-
36
-
37
- class ValidationErrorLocInner(BaseModel):
38
- """
39
- ValidationErrorLocInner
40
- """
41
-
42
- # data type: str
43
- anyof_schema_1_validator: Optional[StrictStr] = None
44
- # data type: int
45
- anyof_schema_2_validator: Optional[StrictInt] = None
46
- if TYPE_CHECKING:
47
- actual_instance: Optional[Union[int, str]] = None
48
- else:
49
- actual_instance: Any = None
50
- any_of_schemas: Set[str] = {"int", "str"}
51
-
52
- model_config = {
53
- "validate_assignment": True,
54
- "protected_namespaces": (),
55
- }
56
-
57
- def __init__(self, *args, **kwargs) -> None:
58
- if args:
59
- if len(args) > 1:
60
- raise ValueError(
61
- "If a position argument is used, only 1 is allowed to set `actual_instance`"
62
- )
63
- if kwargs:
64
- raise ValueError(
65
- "If a position argument is used, keyword arguments cannot be used."
66
- )
67
- super().__init__(actual_instance=args[0])
68
- else:
69
- super().__init__(**kwargs)
70
-
71
- @field_validator("actual_instance")
72
- def actual_instance_must_validate_anyof(cls, v):
73
- instance = ValidationErrorLocInner.model_construct()
74
- error_messages = []
75
- # validate data type: str
76
- try:
77
- instance.anyof_schema_1_validator = v
78
- return v
79
- except (ValidationError, ValueError) as e:
80
- error_messages.append(str(e))
81
- # validate data type: int
82
- try:
83
- instance.anyof_schema_2_validator = v
84
- return v
85
- except (ValidationError, ValueError) as e:
86
- error_messages.append(str(e))
87
- if error_messages:
88
- # no match
89
- raise ValueError(
90
- "No match found when setting the actual_instance in ValidationErrorLocInner with anyOf schemas: int, str. Details: "
91
- + ", ".join(error_messages)
92
- )
93
- else:
94
- return v
95
-
96
- @classmethod
97
- def from_dict(cls, obj: Dict[str, Any]) -> Self:
98
- return cls.from_json(json.dumps(obj))
99
-
100
- @classmethod
101
- def from_json(cls, json_str: str) -> Self:
102
- """Returns the object represented by the json string"""
103
- instance = cls.model_construct()
104
- error_messages = []
105
- # deserialize data into str
106
- try:
107
- # validation
108
- instance.anyof_schema_1_validator = json.loads(json_str)
109
- # assign value to actual_instance
110
- instance.actual_instance = instance.anyof_schema_1_validator
111
- return instance
112
- except (ValidationError, ValueError) as e:
113
- error_messages.append(str(e))
114
- # deserialize data into int
115
- try:
116
- # validation
117
- instance.anyof_schema_2_validator = json.loads(json_str)
118
- # assign value to actual_instance
119
- instance.actual_instance = instance.anyof_schema_2_validator
120
- return instance
121
- except (ValidationError, ValueError) as e:
122
- error_messages.append(str(e))
123
-
124
- if error_messages:
125
- # no match
126
- raise ValueError(
127
- "No match found when deserializing the JSON string into ValidationErrorLocInner with anyOf schemas: int, str. Details: "
128
- + ", ".join(error_messages)
129
- )
130
- else:
131
- return instance
132
-
133
- def to_json(self) -> str:
134
- """Returns the JSON representation of the actual instance"""
135
- if self.actual_instance is None:
136
- return "null"
137
-
138
- if hasattr(self.actual_instance, "to_json") and callable(
139
- self.actual_instance.to_json
140
- ):
141
- return self.actual_instance.to_json()
142
- else:
143
- return json.dumps(self.actual_instance)
144
-
145
- def to_dict(self) -> Optional[Union[Dict[str, Any], int, str]]:
146
- """Returns the dict representation of the actual instance"""
147
- if self.actual_instance is None:
148
- return None
149
-
150
- if hasattr(self.actual_instance, "to_dict") and callable(
151
- self.actual_instance.to_dict
152
- ):
153
- return self.actual_instance.to_dict()
154
- else:
155
- return self.actual_instance
156
-
157
- def to_str(self) -> str:
158
- """Returns the string representation of the actual instance"""
159
- return pprint.pformat(self.model_dump())
@@ -1,106 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Marketcap Service API
5
-
6
- API for retrieving historical marketcap data, available exchanges, and indicators. ## Features - Historical marketcap data - OHLCV data with marketcap - Technical indicators (KER, SMA) - Exchange and symbol mappings - Error logs
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 datetime import datetime
21
- from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
22
- from typing import Any, ClassVar, Dict, List, Optional
23
- from typing import Optional, Set
24
- from typing_extensions import Self
25
-
26
-
27
- class BaseResponseDict(BaseModel):
28
- """
29
- BaseResponseDict
30
- """ # noqa: E501
31
-
32
- success: Optional[StrictBool] = True
33
- message: Optional[StrictStr] = None
34
- data: Optional[Dict[str, Any]] = None
35
- timestamp: Optional[datetime] = None
36
- __properties: ClassVar[List[str]] = ["success", "message", "data", "timestamp"]
37
-
38
- model_config = ConfigDict(
39
- populate_by_name=True,
40
- validate_assignment=True,
41
- protected_namespaces=(),
42
- )
43
-
44
- def to_str(self) -> str:
45
- """Returns the string representation of the model using alias"""
46
- return pprint.pformat(self.model_dump(by_alias=True))
47
-
48
- def to_json(self) -> str:
49
- """Returns the JSON representation of the model using alias"""
50
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
- return json.dumps(self.to_dict())
52
-
53
- @classmethod
54
- def from_json(cls, json_str: str) -> Optional[Self]:
55
- """Create an instance of BaseResponseDict from a JSON string"""
56
- return cls.from_dict(json.loads(json_str))
57
-
58
- def to_dict(self) -> Dict[str, Any]:
59
- """Return the dictionary representation of the model using alias.
60
-
61
- This has the following differences from calling pydantic's
62
- `self.model_dump(by_alias=True)`:
63
-
64
- * `None` is only added to the output dict for nullable fields that
65
- were set at model initialization. Other fields with value `None`
66
- are ignored.
67
- """
68
- excluded_fields: Set[str] = set([])
69
-
70
- _dict = self.model_dump(
71
- by_alias=True,
72
- exclude=excluded_fields,
73
- exclude_none=True,
74
- )
75
- # set to None if message (nullable) is None
76
- # and model_fields_set contains the field
77
- if self.message is None and "message" in self.model_fields_set:
78
- _dict["message"] = None
79
-
80
- # set to None if data (nullable) is None
81
- # and model_fields_set contains the field
82
- if self.data is None and "data" in self.model_fields_set:
83
- _dict["data"] = None
84
-
85
- return _dict
86
-
87
- @classmethod
88
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
- """Create an instance of BaseResponseDict 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
- "success": (
99
- obj.get("success") if obj.get("success") is not None else True
100
- ),
101
- "message": obj.get("message"),
102
- "data": obj.get("data"),
103
- "timestamp": obj.get("timestamp"),
104
- }
105
- )
106
- return _obj
@@ -1,114 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Marketcap Service API
5
-
6
- API for retrieving historical marketcap data, available exchanges, and indicators. ## Features - Historical marketcap data - OHLCV data with marketcap - Technical indicators (KER, SMA) - Exchange and symbol mappings - Error logs
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 datetime import datetime
21
- from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
22
- from typing import Any, ClassVar, Dict, List, Optional
23
- from crypticorn.metrics.client.models.health_check_response import HealthCheckResponse
24
- from typing import Optional, Set
25
- from typing_extensions import Self
26
-
27
-
28
- class BaseResponseHealthCheckResponse(BaseModel):
29
- """
30
- BaseResponseHealthCheckResponse
31
- """ # noqa: E501
32
-
33
- success: Optional[StrictBool] = True
34
- message: Optional[StrictStr] = None
35
- data: Optional[HealthCheckResponse] = None
36
- timestamp: Optional[datetime] = None
37
- __properties: ClassVar[List[str]] = ["success", "message", "data", "timestamp"]
38
-
39
- model_config = ConfigDict(
40
- populate_by_name=True,
41
- validate_assignment=True,
42
- protected_namespaces=(),
43
- )
44
-
45
- def to_str(self) -> str:
46
- """Returns the string representation of the model using alias"""
47
- return pprint.pformat(self.model_dump(by_alias=True))
48
-
49
- def to_json(self) -> str:
50
- """Returns the JSON representation of the model using alias"""
51
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
- return json.dumps(self.to_dict())
53
-
54
- @classmethod
55
- def from_json(cls, json_str: str) -> Optional[Self]:
56
- """Create an instance of BaseResponseHealthCheckResponse from a JSON string"""
57
- return cls.from_dict(json.loads(json_str))
58
-
59
- def to_dict(self) -> Dict[str, Any]:
60
- """Return the dictionary representation of the model using alias.
61
-
62
- This has the following differences from calling pydantic's
63
- `self.model_dump(by_alias=True)`:
64
-
65
- * `None` is only added to the output dict for nullable fields that
66
- were set at model initialization. Other fields with value `None`
67
- are ignored.
68
- """
69
- excluded_fields: Set[str] = set([])
70
-
71
- _dict = self.model_dump(
72
- by_alias=True,
73
- exclude=excluded_fields,
74
- exclude_none=True,
75
- )
76
- # override the default output from pydantic by calling `to_dict()` of data
77
- if self.data:
78
- _dict["data"] = self.data.to_dict()
79
- # set to None if message (nullable) is None
80
- # and model_fields_set contains the field
81
- if self.message is None and "message" in self.model_fields_set:
82
- _dict["message"] = None
83
-
84
- # set to None if data (nullable) is None
85
- # and model_fields_set contains the field
86
- if self.data is None and "data" in self.model_fields_set:
87
- _dict["data"] = None
88
-
89
- return _dict
90
-
91
- @classmethod
92
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
93
- """Create an instance of BaseResponseHealthCheckResponse from a dict"""
94
- if obj is None:
95
- return None
96
-
97
- if not isinstance(obj, dict):
98
- return cls.model_validate(obj)
99
-
100
- _obj = cls.model_validate(
101
- {
102
- "success": (
103
- obj.get("success") if obj.get("success") is not None else True
104
- ),
105
- "message": obj.get("message"),
106
- "data": (
107
- HealthCheckResponse.from_dict(obj["data"])
108
- if obj.get("data") is not None
109
- else None
110
- ),
111
- "timestamp": obj.get("timestamp"),
112
- }
113
- )
114
- return _obj
@@ -1,106 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Marketcap Service API
5
-
6
- API for retrieving historical marketcap data, available exchanges, and indicators. ## Features - Historical marketcap data - OHLCV data with marketcap - Technical indicators (KER, SMA) - Exchange and symbol mappings - Error logs
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 datetime import datetime
21
- from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
22
- from typing import Any, ClassVar, Dict, List, Optional
23
- from typing import Optional, Set
24
- from typing_extensions import Self
25
-
26
-
27
- class BaseResponseListDict(BaseModel):
28
- """
29
- BaseResponseListDict
30
- """ # noqa: E501
31
-
32
- success: Optional[StrictBool] = True
33
- message: Optional[StrictStr] = None
34
- data: Optional[List[Dict[str, Any]]] = None
35
- timestamp: Optional[datetime] = None
36
- __properties: ClassVar[List[str]] = ["success", "message", "data", "timestamp"]
37
-
38
- model_config = ConfigDict(
39
- populate_by_name=True,
40
- validate_assignment=True,
41
- protected_namespaces=(),
42
- )
43
-
44
- def to_str(self) -> str:
45
- """Returns the string representation of the model using alias"""
46
- return pprint.pformat(self.model_dump(by_alias=True))
47
-
48
- def to_json(self) -> str:
49
- """Returns the JSON representation of the model using alias"""
50
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
- return json.dumps(self.to_dict())
52
-
53
- @classmethod
54
- def from_json(cls, json_str: str) -> Optional[Self]:
55
- """Create an instance of BaseResponseListDict from a JSON string"""
56
- return cls.from_dict(json.loads(json_str))
57
-
58
- def to_dict(self) -> Dict[str, Any]:
59
- """Return the dictionary representation of the model using alias.
60
-
61
- This has the following differences from calling pydantic's
62
- `self.model_dump(by_alias=True)`:
63
-
64
- * `None` is only added to the output dict for nullable fields that
65
- were set at model initialization. Other fields with value `None`
66
- are ignored.
67
- """
68
- excluded_fields: Set[str] = set([])
69
-
70
- _dict = self.model_dump(
71
- by_alias=True,
72
- exclude=excluded_fields,
73
- exclude_none=True,
74
- )
75
- # set to None if message (nullable) is None
76
- # and model_fields_set contains the field
77
- if self.message is None and "message" in self.model_fields_set:
78
- _dict["message"] = None
79
-
80
- # set to None if data (nullable) is None
81
- # and model_fields_set contains the field
82
- if self.data is None and "data" in self.model_fields_set:
83
- _dict["data"] = None
84
-
85
- return _dict
86
-
87
- @classmethod
88
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
- """Create an instance of BaseResponseListDict 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
- "success": (
99
- obj.get("success") if obj.get("success") is not None else True
100
- ),
101
- "message": obj.get("message"),
102
- "data": obj.get("data"),
103
- "timestamp": obj.get("timestamp"),
104
- }
105
- )
106
- return _obj