crypticorn 1.0.2rc3__py3-none-any.whl → 2.0.0__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 (259) hide show
  1. crypticorn/__init__.py +3 -3
  2. crypticorn/auth/__init__.py +2 -0
  3. crypticorn/auth/client/__init__.py +112 -0
  4. crypticorn/auth/client/api/__init__.py +8 -0
  5. crypticorn/auth/client/api/admin_api.py +522 -0
  6. crypticorn/auth/client/api/auth_api.py +2089 -0
  7. crypticorn/auth/client/api/service_api.py +309 -0
  8. crypticorn/auth/client/api/user_api.py +2540 -0
  9. crypticorn/auth/client/api/wallet_api.py +1698 -0
  10. crypticorn/auth/client/api_client.py +758 -0
  11. crypticorn/auth/client/api_response.py +20 -0
  12. crypticorn/auth/client/configuration.py +584 -0
  13. crypticorn/auth/client/exceptions.py +220 -0
  14. crypticorn/auth/client/models/__init__.py +91 -0
  15. crypticorn/auth/client/models/add_wallet200_response.py +86 -0
  16. crypticorn/auth/client/models/add_wallet_request.py +107 -0
  17. crypticorn/auth/client/models/authorize_user200_response.py +107 -0
  18. crypticorn/auth/client/models/authorize_user200_response_auth.py +101 -0
  19. crypticorn/auth/client/models/authorize_user_request.py +96 -0
  20. crypticorn/auth/client/models/create_user_request.py +114 -0
  21. crypticorn/auth/client/models/list_wallets200_response.py +137 -0
  22. crypticorn/auth/client/models/list_wallets200_response_balances_inner.py +115 -0
  23. crypticorn/auth/client/models/list_wallets200_response_balances_inner_sale_round.py +115 -0
  24. crypticorn/auth/client/models/list_wallets200_response_balances_inner_wallet.py +168 -0
  25. crypticorn/auth/client/models/list_wallets200_response_balances_inner_wallet_vesting_wallets_inner.py +191 -0
  26. crypticorn/auth/client/models/list_wallets200_response_data_inner.py +102 -0
  27. crypticorn/auth/client/models/list_wallets200_response_user_value.py +118 -0
  28. crypticorn/auth/client/models/logout_default_response.py +108 -0
  29. crypticorn/auth/client/models/logout_default_response_issues_inner.py +83 -0
  30. crypticorn/auth/client/models/refresh_token_info200_response.py +97 -0
  31. crypticorn/auth/client/models/refresh_token_info200_response_user_session.py +105 -0
  32. crypticorn/auth/client/models/resend_verification_email_request.py +84 -0
  33. crypticorn/auth/client/models/revoke_user_tokens_request.py +83 -0
  34. crypticorn/auth/client/models/rotate_tokens200_response.py +110 -0
  35. crypticorn/auth/client/models/token_info200_response.py +97 -0
  36. crypticorn/auth/client/models/unlink_wallet_request.py +83 -0
  37. crypticorn/auth/client/models/update_user_request.py +93 -0
  38. crypticorn/auth/client/models/user_reset_password_request.py +87 -0
  39. crypticorn/auth/client/models/user_set_password_request.py +89 -0
  40. crypticorn/auth/client/models/verify200_response.py +110 -0
  41. crypticorn/auth/client/models/verify_email200_response.py +107 -0
  42. crypticorn/auth/client/models/verify_email200_response_auth.py +101 -0
  43. crypticorn/auth/client/models/verify_email200_response_auth_auth.py +110 -0
  44. crypticorn/auth/client/models/verify_email_request.py +83 -0
  45. crypticorn/auth/client/models/verify_wallet_request.py +91 -0
  46. crypticorn/auth/client/models/wallet_verified200_response.py +83 -0
  47. crypticorn/auth/client/models/whoami200_response.py +104 -0
  48. crypticorn/auth/client/rest.py +195 -0
  49. crypticorn/auth/main.py +45 -0
  50. crypticorn/client.py +46 -8
  51. crypticorn/common/__init__.py +5 -0
  52. crypticorn/common/auth.py +43 -0
  53. crypticorn/common/auth_client.py +163 -0
  54. crypticorn/common/errors.py +432 -0
  55. crypticorn/common/scopes.py +29 -0
  56. crypticorn/common/urls.py +25 -0
  57. crypticorn/hive/__init__.py +2 -1
  58. crypticorn/hive/client/__init__.py +57 -0
  59. crypticorn/hive/client/api/__init__.py +6 -0
  60. crypticorn/hive/client/api/data_api.py +594 -0
  61. crypticorn/hive/client/api/models_api.py +1680 -0
  62. crypticorn/hive/client/api/status_api.py +263 -0
  63. crypticorn/hive/client/api_client.py +758 -0
  64. crypticorn/hive/client/api_response.py +20 -0
  65. crypticorn/hive/client/configuration.py +612 -0
  66. crypticorn/hive/client/exceptions.py +220 -0
  67. crypticorn/hive/client/models/__init__.py +38 -0
  68. crypticorn/hive/client/models/coins.py +44 -0
  69. crypticorn/hive/client/models/data_download_response.py +113 -0
  70. crypticorn/hive/client/models/data_info.py +115 -0
  71. crypticorn/hive/client/models/data_value_value_value_inner.py +154 -0
  72. crypticorn/hive/client/models/data_version.py +35 -0
  73. crypticorn/hive/client/models/download_links.py +91 -0
  74. crypticorn/hive/client/models/evaluation.py +86 -0
  75. crypticorn/hive/client/models/evaluation_response.py +85 -0
  76. crypticorn/hive/client/models/feature_size.py +36 -0
  77. crypticorn/hive/client/models/http_validation_error.py +99 -0
  78. crypticorn/hive/client/models/model.py +133 -0
  79. crypticorn/hive/client/models/model_create.py +93 -0
  80. crypticorn/hive/client/models/model_status.py +35 -0
  81. crypticorn/hive/client/models/model_update.py +83 -0
  82. crypticorn/hive/client/models/target.py +36 -0
  83. crypticorn/hive/client/models/target_type.py +35 -0
  84. crypticorn/hive/client/models/validation_error.py +105 -0
  85. crypticorn/hive/client/models/validation_error_loc_inner.py +159 -0
  86. crypticorn/hive/client/py.typed +0 -0
  87. crypticorn/hive/client/rest.py +195 -0
  88. crypticorn/hive/main.py +27 -100
  89. crypticorn/klines/client/__init__.py +21 -7
  90. crypticorn/klines/client/api/__init__.py +0 -1
  91. crypticorn/klines/client/api/funding_rates_api.py +90 -79
  92. crypticorn/klines/client/api/health_check_api.py +29 -45
  93. crypticorn/klines/client/api/ohlcv_data_api.py +104 -87
  94. crypticorn/klines/client/api/symbols_api.py +36 -54
  95. crypticorn/klines/client/api/udf_api.py +228 -352
  96. crypticorn/klines/client/api_client.py +106 -148
  97. crypticorn/klines/client/api_response.py +2 -3
  98. crypticorn/klines/client/configuration.py +64 -50
  99. crypticorn/klines/client/exceptions.py +20 -16
  100. crypticorn/klines/client/models/__init__.py +21 -7
  101. crypticorn/klines/client/models/base_response_health_check_response.py +21 -15
  102. crypticorn/klines/client/models/base_response_list_funding_rate_response.py +21 -15
  103. crypticorn/klines/client/models/base_response_list_str.py +16 -14
  104. crypticorn/klines/client/models/base_response_ohlcv_response.py +21 -15
  105. crypticorn/klines/client/models/error_response.py +23 -15
  106. crypticorn/klines/client/models/exchange.py +11 -11
  107. crypticorn/klines/client/models/funding_rate_response.py +11 -11
  108. crypticorn/klines/client/models/health_check_response.py +14 -12
  109. crypticorn/klines/client/models/history_error_response.py +11 -11
  110. crypticorn/klines/client/models/history_no_data_response.py +16 -16
  111. crypticorn/klines/client/models/history_success_response.py +16 -16
  112. crypticorn/klines/client/models/http_validation_error.py +14 -10
  113. crypticorn/klines/client/models/market.py +2 -4
  114. crypticorn/klines/client/models/ohlcv_response.py +22 -15
  115. crypticorn/klines/client/models/resolution.py +5 -7
  116. crypticorn/klines/client/models/response_get_history_udf_history_get.py +71 -22
  117. crypticorn/klines/client/models/search_symbol_response.py +22 -15
  118. crypticorn/klines/client/models/sort_direction.py +2 -4
  119. crypticorn/klines/client/models/symbol_group_response.py +5 -9
  120. crypticorn/klines/client/models/symbol_info_response.py +40 -24
  121. crypticorn/klines/client/models/symbol_type.py +5 -10
  122. crypticorn/klines/client/models/timeframe.py +5 -7
  123. crypticorn/klines/client/models/udf_config_response.py +60 -21
  124. crypticorn/klines/client/models/validation_error.py +19 -13
  125. crypticorn/klines/client/models/validation_error_loc_inner.py +32 -11
  126. crypticorn/klines/client/rest.py +30 -41
  127. crypticorn/klines/main.py +52 -15
  128. crypticorn/pay/__init__.py +2 -0
  129. crypticorn/pay/client/__init__.py +52 -0
  130. crypticorn/pay/client/api/__init__.py +7 -0
  131. crypticorn/pay/client/api/now_payments_api.py +813 -0
  132. crypticorn/pay/client/api/payments_api.py +799 -0
  133. crypticorn/pay/client/api/products_api.py +891 -0
  134. crypticorn/pay/client/api/status_api.py +260 -0
  135. crypticorn/pay/client/api_client.py +758 -0
  136. crypticorn/pay/client/api_response.py +20 -0
  137. crypticorn/pay/client/configuration.py +612 -0
  138. crypticorn/pay/client/exceptions.py +220 -0
  139. crypticorn/pay/client/models/__init__.py +32 -0
  140. crypticorn/pay/client/models/api_status_res.py +83 -0
  141. crypticorn/pay/client/models/combined_payment_history.py +101 -0
  142. crypticorn/pay/client/models/create_invoice_req.py +188 -0
  143. crypticorn/pay/client/models/create_invoice_res.py +188 -0
  144. crypticorn/pay/client/models/currency.py +165 -0
  145. crypticorn/pay/client/models/estimate_price_req.py +91 -0
  146. crypticorn/pay/client/models/estimate_price_res.py +102 -0
  147. crypticorn/pay/client/models/get_currencies_res.py +99 -0
  148. crypticorn/pay/client/models/get_payment_status_res.py +222 -0
  149. crypticorn/pay/client/models/get_payments_list_res.py +109 -0
  150. crypticorn/pay/client/models/http_validation_error.py +99 -0
  151. crypticorn/pay/client/models/min_amount_req.py +124 -0
  152. crypticorn/pay/client/models/min_amount_res.py +105 -0
  153. crypticorn/pay/client/models/now_api_status_res.py +83 -0
  154. crypticorn/pay/client/models/now_create_invoice_req.py +188 -0
  155. crypticorn/pay/client/models/now_create_invoice_res.py +188 -0
  156. crypticorn/pay/client/models/now_fee_structure.py +104 -0
  157. crypticorn/pay/client/models/now_payment_model.py +124 -0
  158. crypticorn/pay/client/models/now_payment_status.py +42 -0
  159. crypticorn/pay/client/models/now_webhook_payload.py +181 -0
  160. crypticorn/pay/client/models/payment.py +231 -0
  161. crypticorn/pay/client/models/payment_status.py +40 -0
  162. crypticorn/pay/client/models/product.py +87 -0
  163. crypticorn/pay/client/models/product_model.py +119 -0
  164. crypticorn/pay/client/models/product_subs_model.py +108 -0
  165. crypticorn/pay/client/models/services.py +34 -0
  166. crypticorn/pay/client/models/unified_payment_model.py +112 -0
  167. crypticorn/pay/client/models/validation_error.py +105 -0
  168. crypticorn/pay/client/models/validation_error_loc_inner.py +159 -0
  169. crypticorn/pay/client/py.typed +0 -0
  170. crypticorn/pay/client/rest.py +195 -0
  171. crypticorn/pay/main.py +35 -0
  172. crypticorn/trade/client/__init__.py +9 -4
  173. crypticorn/trade/client/api/__init__.py +0 -1
  174. crypticorn/trade/client/api/api_keys_api.py +203 -304
  175. crypticorn/trade/client/api/bots_api.py +177 -250
  176. crypticorn/trade/client/api/exchanges_api.py +38 -57
  177. crypticorn/trade/client/api/futures_trading_panel_api.py +223 -321
  178. crypticorn/trade/client/api/notifications_api.py +247 -364
  179. crypticorn/trade/client/api/orders_api.py +44 -63
  180. crypticorn/trade/client/api/status_api.py +35 -53
  181. crypticorn/trade/client/api/strategies_api.py +852 -64
  182. crypticorn/trade/client/api/trading_actions_api.py +126 -203
  183. crypticorn/trade/client/api_client.py +115 -154
  184. crypticorn/trade/client/api_response.py +2 -3
  185. crypticorn/trade/client/configuration.py +128 -90
  186. crypticorn/trade/client/exceptions.py +21 -17
  187. crypticorn/trade/client/models/__init__.py +9 -4
  188. crypticorn/trade/client/models/action_model.py +114 -50
  189. crypticorn/trade/client/models/api_error_identifier.py +60 -51
  190. crypticorn/trade/client/models/api_error_level.py +37 -0
  191. crypticorn/trade/client/models/api_error_type.py +37 -0
  192. crypticorn/trade/client/models/api_key_model.py +49 -28
  193. crypticorn/trade/client/models/bot_model.py +76 -31
  194. crypticorn/trade/client/models/bot_status.py +37 -0
  195. crypticorn/trade/client/models/exchange.py +3 -5
  196. crypticorn/trade/client/models/execution_ids.py +14 -14
  197. crypticorn/trade/client/models/futures_balance.py +39 -23
  198. crypticorn/trade/client/models/futures_trading_action.py +98 -46
  199. crypticorn/trade/client/models/http_validation_error.py +15 -11
  200. crypticorn/trade/client/models/margin_mode.py +3 -5
  201. crypticorn/trade/client/models/market_type.py +3 -5
  202. crypticorn/trade/client/models/notification_model.py +60 -27
  203. crypticorn/trade/client/models/notification_type.py +4 -6
  204. crypticorn/trade/client/models/order_model.py +125 -65
  205. crypticorn/trade/client/models/order_status.py +6 -8
  206. crypticorn/trade/client/models/post_futures_action.py +16 -12
  207. crypticorn/trade/client/models/strategy_exchange_info.py +11 -12
  208. crypticorn/trade/client/models/strategy_model.py +66 -27
  209. crypticorn/trade/client/models/strategy_model_input.py +160 -0
  210. crypticorn/trade/client/models/strategy_model_output.py +160 -0
  211. crypticorn/trade/client/models/tpsl.py +35 -21
  212. crypticorn/trade/client/models/trading_action_type.py +5 -7
  213. crypticorn/trade/client/models/update_notification.py +17 -13
  214. crypticorn/trade/client/models/validation_error.py +20 -14
  215. crypticorn/trade/client/models/validation_error_loc_inner.py +33 -12
  216. crypticorn/trade/client/rest.py +108 -170
  217. crypticorn/trade/main.py +26 -19
  218. crypticorn-2.0.0.dist-info/METADATA +74 -0
  219. crypticorn-2.0.0.dist-info/RECORD +226 -0
  220. {crypticorn-1.0.2rc3.dist-info → crypticorn-2.0.0.dist-info}/WHEEL +1 -1
  221. crypticorn/hive/requirements.txt +0 -4
  222. crypticorn/hive/utils.py +0 -109
  223. crypticorn/klines/requirements.txt +0 -4
  224. crypticorn/klines/test/test_base_response_health_check_response.py +0 -56
  225. crypticorn/klines/test/test_base_response_list_funding_rate_response.py +0 -59
  226. crypticorn/klines/test/test_base_response_list_str.py +0 -56
  227. crypticorn/klines/test/test_base_response_ohlcv_response.py +0 -72
  228. crypticorn/klines/test/test_error_response.py +0 -57
  229. crypticorn/klines/test/test_exchange.py +0 -56
  230. crypticorn/klines/test/test_funding_rate_response.py +0 -56
  231. crypticorn/klines/test/test_funding_rates_api.py +0 -38
  232. crypticorn/klines/test/test_health_check_api.py +0 -38
  233. crypticorn/klines/test/test_health_check_response.py +0 -52
  234. crypticorn/klines/test/test_history_error_response.py +0 -53
  235. crypticorn/klines/test/test_history_no_data_response.py +0 -69
  236. crypticorn/klines/test/test_history_success_response.py +0 -87
  237. crypticorn/klines/test/test_http_validation_error.py +0 -58
  238. crypticorn/klines/test/test_market.py +0 -33
  239. crypticorn/klines/test/test_ohlcv_data_api.py +0 -38
  240. crypticorn/klines/test/test_ohlcv_response.py +0 -86
  241. crypticorn/klines/test/test_resolution.py +0 -33
  242. crypticorn/klines/test/test_response_get_history_udf_history_get.py +0 -89
  243. crypticorn/klines/test/test_search_symbol_response.py +0 -62
  244. crypticorn/klines/test/test_sort_direction.py +0 -33
  245. crypticorn/klines/test/test_symbol_group_response.py +0 -53
  246. crypticorn/klines/test/test_symbol_info_response.py +0 -84
  247. crypticorn/klines/test/test_symbol_type.py +0 -54
  248. crypticorn/klines/test/test_symbols_api.py +0 -38
  249. crypticorn/klines/test/test_timeframe.py +0 -33
  250. crypticorn/klines/test/test_udf_api.py +0 -80
  251. crypticorn/klines/test/test_udf_config_response.py +0 -95
  252. crypticorn/klines/test/test_validation_error.py +0 -60
  253. crypticorn/klines/test/test_validation_error_loc_inner.py +0 -50
  254. crypticorn/trade/requirements.txt +0 -4
  255. crypticorn-1.0.2rc3.dist-info/LICENSE.md +0 -19
  256. crypticorn-1.0.2rc3.dist-info/METADATA +0 -47
  257. crypticorn-1.0.2rc3.dist-info/RECORD +0 -128
  258. /crypticorn/{klines/test/__init__.py → auth/client/py.typed} +0 -0
  259. {crypticorn-1.0.2rc3.dist-info → crypticorn-2.0.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,220 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Hive AI API
5
+
6
+ API for Hive AI model training and evaluation
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ from typing import Any, Optional
15
+ from typing_extensions import Self
16
+
17
+
18
+ class OpenApiException(Exception):
19
+ """The base exception class for all OpenAPIExceptions"""
20
+
21
+
22
+ class ApiTypeError(OpenApiException, TypeError):
23
+ def __init__(
24
+ self, msg, path_to_item=None, valid_classes=None, key_type=None
25
+ ) -> None:
26
+ """Raises an exception for TypeErrors
27
+
28
+ Args:
29
+ msg (str): the exception message
30
+
31
+ Keyword Args:
32
+ path_to_item (list): a list of keys an indices to get to the
33
+ current_item
34
+ None if unset
35
+ valid_classes (tuple): the primitive classes that current item
36
+ should be an instance of
37
+ None if unset
38
+ key_type (bool): False if our value is a value in a dict
39
+ True if it is a key in a dict
40
+ False if our item is an item in a list
41
+ None if unset
42
+ """
43
+ self.path_to_item = path_to_item
44
+ self.valid_classes = valid_classes
45
+ self.key_type = key_type
46
+ full_msg = msg
47
+ if path_to_item:
48
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
49
+ super(ApiTypeError, self).__init__(full_msg)
50
+
51
+
52
+ class ApiValueError(OpenApiException, ValueError):
53
+ def __init__(self, msg, path_to_item=None) -> None:
54
+ """
55
+ Args:
56
+ msg (str): the exception message
57
+
58
+ Keyword Args:
59
+ path_to_item (list) the path to the exception in the
60
+ received_data dict. None if unset
61
+ """
62
+
63
+ self.path_to_item = path_to_item
64
+ full_msg = msg
65
+ if path_to_item:
66
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
67
+ super(ApiValueError, self).__init__(full_msg)
68
+
69
+
70
+ class ApiAttributeError(OpenApiException, AttributeError):
71
+ def __init__(self, msg, path_to_item=None) -> None:
72
+ """
73
+ Raised when an attribute reference or assignment fails.
74
+
75
+ Args:
76
+ msg (str): the exception message
77
+
78
+ Keyword Args:
79
+ path_to_item (None/list) the path to the exception in the
80
+ received_data dict
81
+ """
82
+ self.path_to_item = path_to_item
83
+ full_msg = msg
84
+ if path_to_item:
85
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
86
+ super(ApiAttributeError, self).__init__(full_msg)
87
+
88
+
89
+ class ApiKeyError(OpenApiException, KeyError):
90
+ def __init__(self, msg, path_to_item=None) -> None:
91
+ """
92
+ Args:
93
+ msg (str): the exception message
94
+
95
+ Keyword Args:
96
+ path_to_item (None/list) the path to the exception in the
97
+ received_data dict
98
+ """
99
+ self.path_to_item = path_to_item
100
+ full_msg = msg
101
+ if path_to_item:
102
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
103
+ super(ApiKeyError, self).__init__(full_msg)
104
+
105
+
106
+ class ApiException(OpenApiException):
107
+
108
+ def __init__(
109
+ self,
110
+ status=None,
111
+ reason=None,
112
+ http_resp=None,
113
+ *,
114
+ body: Optional[str] = None,
115
+ data: Optional[Any] = None,
116
+ ) -> None:
117
+ self.status = status
118
+ self.reason = reason
119
+ self.body = body
120
+ self.data = data
121
+ self.headers = None
122
+
123
+ if http_resp:
124
+ if self.status is None:
125
+ self.status = http_resp.status
126
+ if self.reason is None:
127
+ self.reason = http_resp.reason
128
+ if self.body is None:
129
+ try:
130
+ self.body = http_resp.data.decode("utf-8")
131
+ except Exception:
132
+ pass
133
+ self.headers = http_resp.getheaders()
134
+
135
+ @classmethod
136
+ def from_response(
137
+ cls,
138
+ *,
139
+ http_resp,
140
+ body: Optional[str],
141
+ data: Optional[Any],
142
+ ) -> Self:
143
+ if http_resp.status == 400:
144
+ raise BadRequestException(http_resp=http_resp, body=body, data=data)
145
+
146
+ if http_resp.status == 401:
147
+ raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
148
+
149
+ if http_resp.status == 403:
150
+ raise ForbiddenException(http_resp=http_resp, body=body, data=data)
151
+
152
+ if http_resp.status == 404:
153
+ raise NotFoundException(http_resp=http_resp, body=body, data=data)
154
+
155
+ # Added new conditions for 409 and 422
156
+ if http_resp.status == 409:
157
+ raise ConflictException(http_resp=http_resp, body=body, data=data)
158
+
159
+ if http_resp.status == 422:
160
+ raise UnprocessableEntityException(
161
+ http_resp=http_resp, body=body, data=data
162
+ )
163
+
164
+ if 500 <= http_resp.status <= 599:
165
+ raise ServiceException(http_resp=http_resp, body=body, data=data)
166
+ raise ApiException(http_resp=http_resp, body=body, data=data)
167
+
168
+ def __str__(self):
169
+ """Custom error messages for exception"""
170
+ error_message = "({0})\n" "Reason: {1}\n".format(self.status, self.reason)
171
+ if self.headers:
172
+ error_message += "HTTP response headers: {0}\n".format(self.headers)
173
+
174
+ if self.data or self.body:
175
+ error_message += "HTTP response body: {0}\n".format(self.data or self.body)
176
+
177
+ return error_message
178
+
179
+
180
+ class BadRequestException(ApiException):
181
+ pass
182
+
183
+
184
+ class NotFoundException(ApiException):
185
+ pass
186
+
187
+
188
+ class UnauthorizedException(ApiException):
189
+ pass
190
+
191
+
192
+ class ForbiddenException(ApiException):
193
+ pass
194
+
195
+
196
+ class ServiceException(ApiException):
197
+ pass
198
+
199
+
200
+ class ConflictException(ApiException):
201
+ """Exception for HTTP 409 Conflict."""
202
+
203
+ pass
204
+
205
+
206
+ class UnprocessableEntityException(ApiException):
207
+ """Exception for HTTP 422 Unprocessable Entity."""
208
+
209
+ pass
210
+
211
+
212
+ def render_path(path_to_item):
213
+ """Returns a string representation of a path"""
214
+ result = ""
215
+ for pth in path_to_item:
216
+ if isinstance(pth, int):
217
+ result += "[{0}]".format(pth)
218
+ else:
219
+ result += "['{0}']".format(pth)
220
+ return result
@@ -0,0 +1,38 @@
1
+ # coding: utf-8
2
+
3
+ # flake8: noqa
4
+ """
5
+ Hive AI API
6
+
7
+ API for Hive AI model training and evaluation
8
+
9
+ The version of the OpenAPI document: 1.0.0
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ # import models into model package
17
+ from crypticorn.hive.client.models.coins import Coins
18
+ from crypticorn.hive.client.models.data_download_response import DataDownloadResponse
19
+ from crypticorn.hive.client.models.data_info import DataInfo
20
+ from crypticorn.hive.client.models.data_value_value_value_inner import (
21
+ DataValueValueValueInner,
22
+ )
23
+ from crypticorn.hive.client.models.data_version import DataVersion
24
+ from crypticorn.hive.client.models.download_links import DownloadLinks
25
+ from crypticorn.hive.client.models.evaluation import Evaluation
26
+ from crypticorn.hive.client.models.evaluation_response import EvaluationResponse
27
+ from crypticorn.hive.client.models.feature_size import FeatureSize
28
+ from crypticorn.hive.client.models.http_validation_error import HTTPValidationError
29
+ from crypticorn.hive.client.models.model import Model
30
+ from crypticorn.hive.client.models.model_create import ModelCreate
31
+ from crypticorn.hive.client.models.model_status import ModelStatus
32
+ from crypticorn.hive.client.models.model_update import ModelUpdate
33
+ from crypticorn.hive.client.models.target import Target
34
+ from crypticorn.hive.client.models.target_type import TargetType
35
+ from crypticorn.hive.client.models.validation_error import ValidationError
36
+ from crypticorn.hive.client.models.validation_error_loc_inner import (
37
+ ValidationErrorLocInner,
38
+ )
@@ -0,0 +1,44 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Hive AI API
5
+
6
+ API for Hive AI model training and evaluation
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import json
17
+ from enum import Enum
18
+ from typing_extensions import Self
19
+
20
+
21
+ class Coins(str, Enum):
22
+ """
23
+ All ever existing coins
24
+ """
25
+
26
+ """
27
+ allowed enum values
28
+ """
29
+ ENUM_1 = "1"
30
+ ENUM_2 = "2"
31
+ ENUM_3 = "3"
32
+ ENUM_4 = "4"
33
+ ENUM_5 = "5"
34
+ ENUM_6 = "6"
35
+ ENUM_7 = "7"
36
+ ENUM_8 = "8"
37
+ ENUM_9 = "9"
38
+ ENUM_10 = "10"
39
+ ENUM_11 = "11"
40
+
41
+ @classmethod
42
+ def from_json(cls, json_str: str) -> Self:
43
+ """Create an instance of Coins from a JSON string"""
44
+ return cls(json.loads(json_str))
@@ -0,0 +1,113 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Hive AI API
5
+
6
+ API for Hive AI model training and evaluation
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict
21
+ from typing import Any, ClassVar, Dict, List
22
+ from crypticorn.hive.client.models.coins import Coins
23
+ from crypticorn.hive.client.models.data_version import DataVersion
24
+ from crypticorn.hive.client.models.download_links import DownloadLinks
25
+ from crypticorn.hive.client.models.feature_size import FeatureSize
26
+ from crypticorn.hive.client.models.target import Target
27
+ from typing import Optional, Set
28
+ from typing_extensions import Self
29
+
30
+
31
+ class DataDownloadResponse(BaseModel):
32
+ """
33
+ DataDownloadResponse
34
+ """ # noqa: E501
35
+
36
+ coin: Coins
37
+ feature_size: FeatureSize
38
+ version: DataVersion
39
+ target: Target
40
+ links: DownloadLinks
41
+ __properties: ClassVar[List[str]] = [
42
+ "coin",
43
+ "feature_size",
44
+ "version",
45
+ "target",
46
+ "links",
47
+ ]
48
+
49
+ model_config = ConfigDict(
50
+ populate_by_name=True,
51
+ validate_assignment=True,
52
+ protected_namespaces=(),
53
+ )
54
+
55
+ def to_str(self) -> str:
56
+ """Returns the string representation of the model using alias"""
57
+ return pprint.pformat(self.model_dump(by_alias=True))
58
+
59
+ def to_json(self) -> str:
60
+ """Returns the JSON representation of the model using alias"""
61
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
62
+ return json.dumps(self.to_dict())
63
+
64
+ @classmethod
65
+ def from_json(cls, json_str: str) -> Optional[Self]:
66
+ """Create an instance of DataDownloadResponse from a JSON string"""
67
+ return cls.from_dict(json.loads(json_str))
68
+
69
+ def to_dict(self) -> Dict[str, Any]:
70
+ """Return the dictionary representation of the model using alias.
71
+
72
+ This has the following differences from calling pydantic's
73
+ `self.model_dump(by_alias=True)`:
74
+
75
+ * `None` is only added to the output dict for nullable fields that
76
+ were set at model initialization. Other fields with value `None`
77
+ are ignored.
78
+ """
79
+ excluded_fields: Set[str] = set([])
80
+
81
+ _dict = self.model_dump(
82
+ by_alias=True,
83
+ exclude=excluded_fields,
84
+ exclude_none=True,
85
+ )
86
+ # override the default output from pydantic by calling `to_dict()` of links
87
+ if self.links:
88
+ _dict["links"] = self.links.to_dict()
89
+ return _dict
90
+
91
+ @classmethod
92
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
93
+ """Create an instance of DataDownloadResponse 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
+ "coin": obj.get("coin"),
103
+ "feature_size": obj.get("feature_size"),
104
+ "version": obj.get("version"),
105
+ "target": obj.get("target"),
106
+ "links": (
107
+ DownloadLinks.from_dict(obj["links"])
108
+ if obj.get("links") is not None
109
+ else None
110
+ ),
111
+ }
112
+ )
113
+ return _obj
@@ -0,0 +1,115 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Hive AI API
5
+
6
+ API for Hive AI model training and evaluation
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt
21
+ from typing import Any, ClassVar, Dict, List, Union
22
+ from crypticorn.hive.client.models.coins import Coins
23
+ from crypticorn.hive.client.models.data_value_value_value_inner import (
24
+ DataValueValueValueInner,
25
+ )
26
+ from crypticorn.hive.client.models.data_version import DataVersion
27
+ from crypticorn.hive.client.models.feature_size import FeatureSize
28
+ from crypticorn.hive.client.models.target_type import TargetType
29
+ from typing import Optional, Set
30
+ from typing_extensions import Self
31
+
32
+
33
+ class DataInfo(BaseModel):
34
+ """
35
+ DataInfo
36
+ """ # noqa: E501
37
+
38
+ data: Dict[str, Dict[str, Dict[str, List[DataValueValueValueInner]]]]
39
+ coins: List[Coins]
40
+ feature_sizes: List[FeatureSize]
41
+ targets: Dict[str, TargetType]
42
+ versions: Dict[str, Union[StrictFloat, StrictInt]]
43
+ latest_version: DataVersion
44
+ __properties: ClassVar[List[str]] = [
45
+ "data",
46
+ "coins",
47
+ "feature_sizes",
48
+ "targets",
49
+ "versions",
50
+ "latest_version",
51
+ ]
52
+
53
+ model_config = ConfigDict(
54
+ populate_by_name=True,
55
+ validate_assignment=True,
56
+ protected_namespaces=(),
57
+ )
58
+
59
+ def to_str(self) -> str:
60
+ """Returns the string representation of the model using alias"""
61
+ return pprint.pformat(self.model_dump(by_alias=True))
62
+
63
+ def to_json(self) -> str:
64
+ """Returns the JSON representation of the model using alias"""
65
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
66
+ return json.dumps(self.to_dict())
67
+
68
+ @classmethod
69
+ def from_json(cls, json_str: str) -> Optional[Self]:
70
+ """Create an instance of DataInfo from a JSON string"""
71
+ return cls.from_dict(json.loads(json_str))
72
+
73
+ def to_dict(self) -> Dict[str, Any]:
74
+ """Return the dictionary representation of the model using alias.
75
+
76
+ This has the following differences from calling pydantic's
77
+ `self.model_dump(by_alias=True)`:
78
+
79
+ * `None` is only added to the output dict for nullable fields that
80
+ were set at model initialization. Other fields with value `None`
81
+ are ignored.
82
+ """
83
+ excluded_fields: Set[str] = set([])
84
+
85
+ _dict = self.model_dump(
86
+ by_alias=True,
87
+ exclude=excluded_fields,
88
+ exclude_none=True,
89
+ )
90
+ return _dict
91
+
92
+ @classmethod
93
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
94
+ """Create an instance of DataInfo from a dict"""
95
+ if obj is None:
96
+ return None
97
+
98
+ if not isinstance(obj, dict):
99
+ return cls.model_validate(obj)
100
+
101
+ _obj = cls.model_validate(
102
+ {
103
+ "data": obj.get("data"),
104
+ "coins": obj.get("coins"),
105
+ "feature_sizes": obj.get("feature_sizes"),
106
+ "targets": (
107
+ dict((_k, _v) for _k, _v in obj.get("targets").items())
108
+ if obj.get("targets") is not None
109
+ else None
110
+ ),
111
+ "versions": obj.get("versions"),
112
+ "latest_version": obj.get("latest_version"),
113
+ }
114
+ )
115
+ return _obj
@@ -0,0 +1,154 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Hive AI API
5
+
6
+ API for Hive AI model training and evaluation
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ 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
+ StrictStr,
25
+ ValidationError,
26
+ field_validator,
27
+ )
28
+ from typing import Optional
29
+ from crypticorn.hive.client.models.feature_size import FeatureSize
30
+ from crypticorn.hive.client.models.target import Target
31
+ from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
32
+ from typing_extensions import Literal, Self
33
+ from pydantic import Field
34
+
35
+ DATAVALUEVALUEVALUEINNER_ANY_OF_SCHEMAS = ["FeatureSize", "Target"]
36
+
37
+
38
+ class DataValueValueValueInner(BaseModel):
39
+ """
40
+ DataValueValueValueInner
41
+ """
42
+
43
+ # data type: FeatureSize
44
+ anyof_schema_1_validator: Optional[FeatureSize] = None
45
+ # data type: Target
46
+ anyof_schema_2_validator: Optional[Target] = None
47
+ if TYPE_CHECKING:
48
+ actual_instance: Optional[Union[FeatureSize, Target]] = None
49
+ else:
50
+ actual_instance: Any = None
51
+ any_of_schemas: Set[str] = {"FeatureSize", "Target"}
52
+
53
+ model_config = {
54
+ "validate_assignment": True,
55
+ "protected_namespaces": (),
56
+ }
57
+
58
+ def __init__(self, *args, **kwargs) -> None:
59
+ if args:
60
+ if len(args) > 1:
61
+ raise ValueError(
62
+ "If a position argument is used, only 1 is allowed to set `actual_instance`"
63
+ )
64
+ if kwargs:
65
+ raise ValueError(
66
+ "If a position argument is used, keyword arguments cannot be used."
67
+ )
68
+ super().__init__(actual_instance=args[0])
69
+ else:
70
+ super().__init__(**kwargs)
71
+
72
+ @field_validator("actual_instance")
73
+ def actual_instance_must_validate_anyof(cls, v):
74
+ instance = DataValueValueValueInner.model_construct()
75
+ error_messages = []
76
+ # validate data type: FeatureSize
77
+ if not isinstance(v, FeatureSize):
78
+ error_messages.append(f"Error! Input type `{type(v)}` is not `FeatureSize`")
79
+ else:
80
+ return v
81
+
82
+ # validate data type: Target
83
+ if not isinstance(v, Target):
84
+ error_messages.append(f"Error! Input type `{type(v)}` is not `Target`")
85
+ else:
86
+ return v
87
+
88
+ if error_messages:
89
+ # no match
90
+ raise ValueError(
91
+ "No match found when setting the actual_instance in DataValueValueValueInner with anyOf schemas: FeatureSize, Target. Details: "
92
+ + ", ".join(error_messages)
93
+ )
94
+ else:
95
+ return v
96
+
97
+ @classmethod
98
+ def from_dict(cls, obj: Dict[str, Any]) -> Self:
99
+ return cls.from_json(json.dumps(obj))
100
+
101
+ @classmethod
102
+ def from_json(cls, json_str: str) -> Self:
103
+ """Returns the object represented by the json string"""
104
+ instance = cls.model_construct()
105
+ error_messages = []
106
+ # anyof_schema_1_validator: Optional[FeatureSize] = None
107
+ try:
108
+ instance.actual_instance = FeatureSize.from_json(json_str)
109
+ return instance
110
+ except (ValidationError, ValueError) as e:
111
+ error_messages.append(str(e))
112
+ # anyof_schema_2_validator: Optional[Target] = None
113
+ try:
114
+ instance.actual_instance = Target.from_json(json_str)
115
+ return instance
116
+ except (ValidationError, ValueError) as e:
117
+ error_messages.append(str(e))
118
+
119
+ if error_messages:
120
+ # no match
121
+ raise ValueError(
122
+ "No match found when deserializing the JSON string into DataValueValueValueInner with anyOf schemas: FeatureSize, Target. Details: "
123
+ + ", ".join(error_messages)
124
+ )
125
+ else:
126
+ return instance
127
+
128
+ def to_json(self) -> str:
129
+ """Returns the JSON representation of the actual instance"""
130
+ if self.actual_instance is None:
131
+ return "null"
132
+
133
+ if hasattr(self.actual_instance, "to_json") and callable(
134
+ self.actual_instance.to_json
135
+ ):
136
+ return self.actual_instance.to_json()
137
+ else:
138
+ return json.dumps(self.actual_instance)
139
+
140
+ def to_dict(self) -> Optional[Union[Dict[str, Any], FeatureSize, Target]]:
141
+ """Returns the dict representation of the actual instance"""
142
+ if self.actual_instance is None:
143
+ return None
144
+
145
+ if hasattr(self.actual_instance, "to_dict") and callable(
146
+ self.actual_instance.to_dict
147
+ ):
148
+ return self.actual_instance.to_dict()
149
+ else:
150
+ return self.actual_instance
151
+
152
+ def to_str(self) -> str:
153
+ """Returns the string representation of the actual instance"""
154
+ return pprint.pformat(self.model_dump())