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
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- FastAPI
4
+ Trading API
5
5
 
6
6
  No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
7
 
@@ -17,8 +17,9 @@ from typing import Any, Dict, List, Optional, Tuple, Union
17
17
  from typing_extensions import Annotated
18
18
 
19
19
  from pydantic import StrictInt, StrictStr
20
- from typing import List, Optional
21
- from crypticorn.trade.client.models.strategy_model import StrategyModel
20
+ from typing import Any, List, Optional
21
+ from crypticorn.trade.client.models.strategy_model_input import StrategyModelInput
22
+ from crypticorn.trade.client.models.strategy_model_output import StrategyModelOutput
22
23
 
23
24
  from crypticorn.trade.client.api_client import ApiClient, RequestSerialized
24
25
  from crypticorn.trade.client.api_response import ApiResponse
@@ -37,9 +38,273 @@ class StrategiesApi:
37
38
  api_client = ApiClient.get_default()
38
39
  self.api_client = api_client
39
40
 
41
+ @validate_call
42
+ async def create_strategy(
43
+ self,
44
+ strategy_model_input: StrategyModelInput,
45
+ access_token: Optional[StrictStr] = None,
46
+ _request_timeout: Union[
47
+ None,
48
+ Annotated[StrictFloat, Field(gt=0)],
49
+ Tuple[
50
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
51
+ ],
52
+ ] = None,
53
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
54
+ _content_type: Optional[StrictStr] = None,
55
+ _headers: Optional[Dict[StrictStr, Any]] = None,
56
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
57
+ ) -> object:
58
+ """Create Strategy
59
+
60
+
61
+ :param strategy_model_input: (required)
62
+ :type strategy_model_input: StrategyModelInput
63
+ :param access_token:
64
+ :type access_token: str
65
+ :param _request_timeout: timeout setting for this request. If one
66
+ number provided, it will be total request
67
+ timeout. It can also be a pair (tuple) of
68
+ (connection, read) timeouts.
69
+ :type _request_timeout: int, tuple(int, int), optional
70
+ :param _request_auth: set to override the auth_settings for an a single
71
+ request; this effectively ignores the
72
+ authentication in the spec for a single request.
73
+ :type _request_auth: dict, optional
74
+ :param _content_type: force content-type for the request.
75
+ :type _content_type: str, Optional
76
+ :param _headers: set to override the headers for a single
77
+ request; this effectively ignores the headers
78
+ in the spec for a single request.
79
+ :type _headers: dict, optional
80
+ :param _host_index: set to override the host_index for a single
81
+ request; this effectively ignores the host_index
82
+ in the spec for a single request.
83
+ :type _host_index: int, optional
84
+ :return: Returns the result object.
85
+ """ # noqa: E501
86
+
87
+ _param = self._create_strategy_serialize(
88
+ strategy_model_input=strategy_model_input,
89
+ access_token=access_token,
90
+ _request_auth=_request_auth,
91
+ _content_type=_content_type,
92
+ _headers=_headers,
93
+ _host_index=_host_index,
94
+ )
95
+
96
+ _response_types_map: Dict[str, Optional[str]] = {
97
+ "200": "object",
98
+ "422": "HTTPValidationError",
99
+ }
100
+ response_data = await self.api_client.call_api(
101
+ *_param, _request_timeout=_request_timeout
102
+ )
103
+ await response_data.read()
104
+ return self.api_client.response_deserialize(
105
+ response_data=response_data,
106
+ response_types_map=_response_types_map,
107
+ ).data
108
+
109
+ @validate_call
110
+ async def create_strategy_with_http_info(
111
+ self,
112
+ strategy_model_input: StrategyModelInput,
113
+ access_token: Optional[StrictStr] = None,
114
+ _request_timeout: Union[
115
+ None,
116
+ Annotated[StrictFloat, Field(gt=0)],
117
+ Tuple[
118
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
119
+ ],
120
+ ] = None,
121
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
122
+ _content_type: Optional[StrictStr] = None,
123
+ _headers: Optional[Dict[StrictStr, Any]] = None,
124
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
125
+ ) -> ApiResponse[object]:
126
+ """Create Strategy
127
+
128
+
129
+ :param strategy_model_input: (required)
130
+ :type strategy_model_input: StrategyModelInput
131
+ :param access_token:
132
+ :type access_token: str
133
+ :param _request_timeout: timeout setting for this request. If one
134
+ number provided, it will be total request
135
+ timeout. It can also be a pair (tuple) of
136
+ (connection, read) timeouts.
137
+ :type _request_timeout: int, tuple(int, int), optional
138
+ :param _request_auth: set to override the auth_settings for an a single
139
+ request; this effectively ignores the
140
+ authentication in the spec for a single request.
141
+ :type _request_auth: dict, optional
142
+ :param _content_type: force content-type for the request.
143
+ :type _content_type: str, Optional
144
+ :param _headers: set to override the headers for a single
145
+ request; this effectively ignores the headers
146
+ in the spec for a single request.
147
+ :type _headers: dict, optional
148
+ :param _host_index: set to override the host_index for a single
149
+ request; this effectively ignores the host_index
150
+ in the spec for a single request.
151
+ :type _host_index: int, optional
152
+ :return: Returns the result object.
153
+ """ # noqa: E501
154
+
155
+ _param = self._create_strategy_serialize(
156
+ strategy_model_input=strategy_model_input,
157
+ access_token=access_token,
158
+ _request_auth=_request_auth,
159
+ _content_type=_content_type,
160
+ _headers=_headers,
161
+ _host_index=_host_index,
162
+ )
163
+
164
+ _response_types_map: Dict[str, Optional[str]] = {
165
+ "200": "object",
166
+ "422": "HTTPValidationError",
167
+ }
168
+ response_data = await self.api_client.call_api(
169
+ *_param, _request_timeout=_request_timeout
170
+ )
171
+ await response_data.read()
172
+ return self.api_client.response_deserialize(
173
+ response_data=response_data,
174
+ response_types_map=_response_types_map,
175
+ )
176
+
177
+ @validate_call
178
+ async def create_strategy_without_preload_content(
179
+ self,
180
+ strategy_model_input: StrategyModelInput,
181
+ access_token: Optional[StrictStr] = None,
182
+ _request_timeout: Union[
183
+ None,
184
+ Annotated[StrictFloat, Field(gt=0)],
185
+ Tuple[
186
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
187
+ ],
188
+ ] = None,
189
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
190
+ _content_type: Optional[StrictStr] = None,
191
+ _headers: Optional[Dict[StrictStr, Any]] = None,
192
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
193
+ ) -> RESTResponseType:
194
+ """Create Strategy
195
+
196
+
197
+ :param strategy_model_input: (required)
198
+ :type strategy_model_input: StrategyModelInput
199
+ :param access_token:
200
+ :type access_token: str
201
+ :param _request_timeout: timeout setting for this request. If one
202
+ number provided, it will be total request
203
+ timeout. It can also be a pair (tuple) of
204
+ (connection, read) timeouts.
205
+ :type _request_timeout: int, tuple(int, int), optional
206
+ :param _request_auth: set to override the auth_settings for an a single
207
+ request; this effectively ignores the
208
+ authentication in the spec for a single request.
209
+ :type _request_auth: dict, optional
210
+ :param _content_type: force content-type for the request.
211
+ :type _content_type: str, Optional
212
+ :param _headers: set to override the headers for a single
213
+ request; this effectively ignores the headers
214
+ in the spec for a single request.
215
+ :type _headers: dict, optional
216
+ :param _host_index: set to override the host_index for a single
217
+ request; this effectively ignores the host_index
218
+ in the spec for a single request.
219
+ :type _host_index: int, optional
220
+ :return: Returns the result object.
221
+ """ # noqa: E501
222
+
223
+ _param = self._create_strategy_serialize(
224
+ strategy_model_input=strategy_model_input,
225
+ access_token=access_token,
226
+ _request_auth=_request_auth,
227
+ _content_type=_content_type,
228
+ _headers=_headers,
229
+ _host_index=_host_index,
230
+ )
231
+
232
+ _response_types_map: Dict[str, Optional[str]] = {
233
+ "200": "object",
234
+ "422": "HTTPValidationError",
235
+ }
236
+ response_data = await self.api_client.call_api(
237
+ *_param, _request_timeout=_request_timeout
238
+ )
239
+ return response_data.response
240
+
241
+ def _create_strategy_serialize(
242
+ self,
243
+ strategy_model_input,
244
+ access_token,
245
+ _request_auth,
246
+ _content_type,
247
+ _headers,
248
+ _host_index,
249
+ ) -> RequestSerialized:
250
+
251
+ _host = None
252
+
253
+ _collection_formats: Dict[str, str] = {}
254
+
255
+ _path_params: Dict[str, str] = {}
256
+ _query_params: List[Tuple[str, str]] = []
257
+ _header_params: Dict[str, Optional[str]] = _headers or {}
258
+ _form_params: List[Tuple[str, str]] = []
259
+ _files: Dict[
260
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
261
+ ] = {}
262
+ _body_params: Optional[bytes] = None
263
+
264
+ # process the path parameters
265
+ # process the query parameters
266
+ # process the header parameters
267
+ # process the form parameters
268
+ # process the body parameter
269
+ if strategy_model_input is not None:
270
+ _body_params = strategy_model_input
271
+
272
+ # set the HTTP header `Accept`
273
+ if "Accept" not in _header_params:
274
+ _header_params["Accept"] = self.api_client.select_header_accept(
275
+ ["application/json"]
276
+ )
277
+
278
+ # set the HTTP header `Content-Type`
279
+ if _content_type:
280
+ _header_params["Content-Type"] = _content_type
281
+ else:
282
+ _default_content_type = self.api_client.select_header_content_type(
283
+ ["application/json"]
284
+ )
285
+ if _default_content_type is not None:
286
+ _header_params["Content-Type"] = _default_content_type
287
+
288
+ # authentication setting
289
+ _auth_settings: List[str] = ["HTTPBearer"]
290
+
291
+ return self.api_client.param_serialize(
292
+ method="POST",
293
+ resource_path="/strategies",
294
+ path_params=_path_params,
295
+ query_params=_query_params,
296
+ header_params=_header_params,
297
+ body=_body_params,
298
+ post_params=_form_params,
299
+ files=_files,
300
+ auth_settings=_auth_settings,
301
+ collection_formats=_collection_formats,
302
+ _host=_host,
303
+ _request_auth=_request_auth,
304
+ )
40
305
 
41
306
  @validate_call
42
- def get_strategies(
307
+ async def get_strategies(
43
308
  self,
44
309
  limit: Optional[StrictInt] = None,
45
310
  offset: Optional[StrictInt] = None,
@@ -48,15 +313,14 @@ class StrategiesApi:
48
313
  None,
49
314
  Annotated[StrictFloat, Field(gt=0)],
50
315
  Tuple[
51
- Annotated[StrictFloat, Field(gt=0)],
52
- Annotated[StrictFloat, Field(gt=0)]
53
- ]
316
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
317
+ ],
54
318
  ] = None,
55
319
  _request_auth: Optional[Dict[StrictStr, Any]] = None,
56
320
  _content_type: Optional[StrictStr] = None,
57
321
  _headers: Optional[Dict[StrictStr, Any]] = None,
58
322
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
59
- ) -> List[StrategyModel]:
323
+ ) -> List[StrategyModelOutput]:
60
324
  """Get Strategies
61
325
 
62
326
 
@@ -86,7 +350,7 @@ class StrategiesApi:
86
350
  in the spec for a single request.
87
351
  :type _host_index: int, optional
88
352
  :return: Returns the result object.
89
- """ # noqa: E501
353
+ """ # noqa: E501
90
354
 
91
355
  _param = self._get_strategies_serialize(
92
356
  limit=limit,
@@ -95,26 +359,24 @@ class StrategiesApi:
95
359
  _request_auth=_request_auth,
96
360
  _content_type=_content_type,
97
361
  _headers=_headers,
98
- _host_index=_host_index
362
+ _host_index=_host_index,
99
363
  )
100
364
 
101
365
  _response_types_map: Dict[str, Optional[str]] = {
102
- '200': "List[StrategyModel]",
103
- '422': "HTTPValidationError",
366
+ "200": "List[StrategyModelOutput]",
367
+ "422": "HTTPValidationError",
104
368
  }
105
- response_data = self.api_client.call_api(
106
- *_param,
107
- _request_timeout=_request_timeout
369
+ response_data = await self.api_client.call_api(
370
+ *_param, _request_timeout=_request_timeout
108
371
  )
109
- response_data.read()
372
+ await response_data.read()
110
373
  return self.api_client.response_deserialize(
111
374
  response_data=response_data,
112
375
  response_types_map=_response_types_map,
113
376
  ).data
114
377
 
115
-
116
378
  @validate_call
117
- def get_strategies_with_http_info(
379
+ async def get_strategies_with_http_info(
118
380
  self,
119
381
  limit: Optional[StrictInt] = None,
120
382
  offset: Optional[StrictInt] = None,
@@ -123,15 +385,14 @@ class StrategiesApi:
123
385
  None,
124
386
  Annotated[StrictFloat, Field(gt=0)],
125
387
  Tuple[
126
- Annotated[StrictFloat, Field(gt=0)],
127
- Annotated[StrictFloat, Field(gt=0)]
128
- ]
388
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
389
+ ],
129
390
  ] = None,
130
391
  _request_auth: Optional[Dict[StrictStr, Any]] = None,
131
392
  _content_type: Optional[StrictStr] = None,
132
393
  _headers: Optional[Dict[StrictStr, Any]] = None,
133
394
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
134
- ) -> ApiResponse[List[StrategyModel]]:
395
+ ) -> ApiResponse[List[StrategyModelOutput]]:
135
396
  """Get Strategies
136
397
 
137
398
 
@@ -161,7 +422,7 @@ class StrategiesApi:
161
422
  in the spec for a single request.
162
423
  :type _host_index: int, optional
163
424
  :return: Returns the result object.
164
- """ # noqa: E501
425
+ """ # noqa: E501
165
426
 
166
427
  _param = self._get_strategies_serialize(
167
428
  limit=limit,
@@ -170,26 +431,24 @@ class StrategiesApi:
170
431
  _request_auth=_request_auth,
171
432
  _content_type=_content_type,
172
433
  _headers=_headers,
173
- _host_index=_host_index
434
+ _host_index=_host_index,
174
435
  )
175
436
 
176
437
  _response_types_map: Dict[str, Optional[str]] = {
177
- '200': "List[StrategyModel]",
178
- '422': "HTTPValidationError",
438
+ "200": "List[StrategyModelOutput]",
439
+ "422": "HTTPValidationError",
179
440
  }
180
- response_data = self.api_client.call_api(
181
- *_param,
182
- _request_timeout=_request_timeout
441
+ response_data = await self.api_client.call_api(
442
+ *_param, _request_timeout=_request_timeout
183
443
  )
184
- response_data.read()
444
+ await response_data.read()
185
445
  return self.api_client.response_deserialize(
186
446
  response_data=response_data,
187
447
  response_types_map=_response_types_map,
188
448
  )
189
449
 
190
-
191
450
  @validate_call
192
- def get_strategies_without_preload_content(
451
+ async def get_strategies_without_preload_content(
193
452
  self,
194
453
  limit: Optional[StrictInt] = None,
195
454
  offset: Optional[StrictInt] = None,
@@ -198,9 +457,8 @@ class StrategiesApi:
198
457
  None,
199
458
  Annotated[StrictFloat, Field(gt=0)],
200
459
  Tuple[
201
- Annotated[StrictFloat, Field(gt=0)],
202
- Annotated[StrictFloat, Field(gt=0)]
203
- ]
460
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
461
+ ],
204
462
  ] = None,
205
463
  _request_auth: Optional[Dict[StrictStr, Any]] = None,
206
464
  _content_type: Optional[StrictStr] = None,
@@ -236,7 +494,7 @@ class StrategiesApi:
236
494
  in the spec for a single request.
237
495
  :type _host_index: int, optional
238
496
  :return: Returns the result object.
239
- """ # noqa: E501
497
+ """ # noqa: E501
240
498
 
241
499
  _param = self._get_strategies_serialize(
242
500
  limit=limit,
@@ -245,20 +503,18 @@ class StrategiesApi:
245
503
  _request_auth=_request_auth,
246
504
  _content_type=_content_type,
247
505
  _headers=_headers,
248
- _host_index=_host_index
506
+ _host_index=_host_index,
249
507
  )
250
508
 
251
509
  _response_types_map: Dict[str, Optional[str]] = {
252
- '200': "List[StrategyModel]",
253
- '422': "HTTPValidationError",
510
+ "200": "List[StrategyModelOutput]",
511
+ "422": "HTTPValidationError",
254
512
  }
255
- response_data = self.api_client.call_api(
256
- *_param,
257
- _request_timeout=_request_timeout
513
+ response_data = await self.api_client.call_api(
514
+ *_param, _request_timeout=_request_timeout
258
515
  )
259
516
  return response_data.response
260
517
 
261
-
262
518
  def _get_strategies_serialize(
263
519
  self,
264
520
  limit,
@@ -272,8 +528,7 @@ class StrategiesApi:
272
528
 
273
529
  _host = None
274
530
 
275
- _collection_formats: Dict[str, str] = {
276
- }
531
+ _collection_formats: Dict[str, str] = {}
277
532
 
278
533
  _path_params: Dict[str, str] = {}
279
534
  _query_params: List[Tuple[str, str]] = []
@@ -287,35 +542,29 @@ class StrategiesApi:
287
542
  # process the path parameters
288
543
  # process the query parameters
289
544
  if limit is not None:
290
-
291
- _query_params.append(('limit', limit))
292
-
545
+
546
+ _query_params.append(("limit", limit))
547
+
293
548
  if offset is not None:
294
-
295
- _query_params.append(('offset', offset))
296
-
549
+
550
+ _query_params.append(("offset", offset))
551
+
297
552
  # process the header parameters
298
553
  # process the form parameters
299
554
  # process the body parameter
300
555
 
301
-
302
556
  # set the HTTP header `Accept`
303
- if 'Accept' not in _header_params:
304
- _header_params['Accept'] = self.api_client.select_header_accept(
305
- [
306
- 'application/json'
307
- ]
557
+ if "Accept" not in _header_params:
558
+ _header_params["Accept"] = self.api_client.select_header_accept(
559
+ ["application/json"]
308
560
  )
309
561
 
310
-
311
562
  # authentication setting
312
- _auth_settings: List[str] = [
313
- 'OAuth2PasswordBearer'
314
- ]
563
+ _auth_settings: List[str] = ["HTTPBearer"]
315
564
 
316
565
  return self.api_client.param_serialize(
317
- method='GET',
318
- resource_path='/strategies',
566
+ method="GET",
567
+ resource_path="/strategies",
319
568
  path_params=_path_params,
320
569
  query_params=_query_params,
321
570
  header_params=_header_params,
@@ -325,7 +574,546 @@ class StrategiesApi:
325
574
  auth_settings=_auth_settings,
326
575
  collection_formats=_collection_formats,
327
576
  _host=_host,
328
- _request_auth=_request_auth
577
+ _request_auth=_request_auth,
329
578
  )
330
579
 
580
+ @validate_call
581
+ async def kill_strategy(
582
+ self,
583
+ id: StrictStr,
584
+ access_token: Optional[StrictStr] = None,
585
+ _request_timeout: Union[
586
+ None,
587
+ Annotated[StrictFloat, Field(gt=0)],
588
+ Tuple[
589
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
590
+ ],
591
+ ] = None,
592
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
593
+ _content_type: Optional[StrictStr] = None,
594
+ _headers: Optional[Dict[StrictStr, Any]] = None,
595
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
596
+ ) -> object:
597
+ """Kill Strategy
598
+
599
+ Kills a strategy by disabling it and deleting all bots associated with it.
600
+
601
+ :param id: (required)
602
+ :type id: str
603
+ :param access_token:
604
+ :type access_token: str
605
+ :param _request_timeout: timeout setting for this request. If one
606
+ number provided, it will be total request
607
+ timeout. It can also be a pair (tuple) of
608
+ (connection, read) timeouts.
609
+ :type _request_timeout: int, tuple(int, int), optional
610
+ :param _request_auth: set to override the auth_settings for an a single
611
+ request; this effectively ignores the
612
+ authentication in the spec for a single request.
613
+ :type _request_auth: dict, optional
614
+ :param _content_type: force content-type for the request.
615
+ :type _content_type: str, Optional
616
+ :param _headers: set to override the headers for a single
617
+ request; this effectively ignores the headers
618
+ in the spec for a single request.
619
+ :type _headers: dict, optional
620
+ :param _host_index: set to override the host_index for a single
621
+ request; this effectively ignores the host_index
622
+ in the spec for a single request.
623
+ :type _host_index: int, optional
624
+ :return: Returns the result object.
625
+ """ # noqa: E501
626
+
627
+ _param = self._kill_strategy_serialize(
628
+ id=id,
629
+ access_token=access_token,
630
+ _request_auth=_request_auth,
631
+ _content_type=_content_type,
632
+ _headers=_headers,
633
+ _host_index=_host_index,
634
+ )
331
635
 
636
+ _response_types_map: Dict[str, Optional[str]] = {
637
+ "200": "object",
638
+ "422": "HTTPValidationError",
639
+ }
640
+ response_data = await self.api_client.call_api(
641
+ *_param, _request_timeout=_request_timeout
642
+ )
643
+ await response_data.read()
644
+ return self.api_client.response_deserialize(
645
+ response_data=response_data,
646
+ response_types_map=_response_types_map,
647
+ ).data
648
+
649
+ @validate_call
650
+ async def kill_strategy_with_http_info(
651
+ self,
652
+ id: StrictStr,
653
+ access_token: Optional[StrictStr] = None,
654
+ _request_timeout: Union[
655
+ None,
656
+ Annotated[StrictFloat, Field(gt=0)],
657
+ Tuple[
658
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
659
+ ],
660
+ ] = None,
661
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
662
+ _content_type: Optional[StrictStr] = None,
663
+ _headers: Optional[Dict[StrictStr, Any]] = None,
664
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
665
+ ) -> ApiResponse[object]:
666
+ """Kill Strategy
667
+
668
+ Kills a strategy by disabling it and deleting all bots associated with it.
669
+
670
+ :param id: (required)
671
+ :type id: str
672
+ :param access_token:
673
+ :type access_token: str
674
+ :param _request_timeout: timeout setting for this request. If one
675
+ number provided, it will be total request
676
+ timeout. It can also be a pair (tuple) of
677
+ (connection, read) timeouts.
678
+ :type _request_timeout: int, tuple(int, int), optional
679
+ :param _request_auth: set to override the auth_settings for an a single
680
+ request; this effectively ignores the
681
+ authentication in the spec for a single request.
682
+ :type _request_auth: dict, optional
683
+ :param _content_type: force content-type for the request.
684
+ :type _content_type: str, Optional
685
+ :param _headers: set to override the headers for a single
686
+ request; this effectively ignores the headers
687
+ in the spec for a single request.
688
+ :type _headers: dict, optional
689
+ :param _host_index: set to override the host_index for a single
690
+ request; this effectively ignores the host_index
691
+ in the spec for a single request.
692
+ :type _host_index: int, optional
693
+ :return: Returns the result object.
694
+ """ # noqa: E501
695
+
696
+ _param = self._kill_strategy_serialize(
697
+ id=id,
698
+ access_token=access_token,
699
+ _request_auth=_request_auth,
700
+ _content_type=_content_type,
701
+ _headers=_headers,
702
+ _host_index=_host_index,
703
+ )
704
+
705
+ _response_types_map: Dict[str, Optional[str]] = {
706
+ "200": "object",
707
+ "422": "HTTPValidationError",
708
+ }
709
+ response_data = await self.api_client.call_api(
710
+ *_param, _request_timeout=_request_timeout
711
+ )
712
+ await response_data.read()
713
+ return self.api_client.response_deserialize(
714
+ response_data=response_data,
715
+ response_types_map=_response_types_map,
716
+ )
717
+
718
+ @validate_call
719
+ async def kill_strategy_without_preload_content(
720
+ self,
721
+ id: StrictStr,
722
+ access_token: Optional[StrictStr] = None,
723
+ _request_timeout: Union[
724
+ None,
725
+ Annotated[StrictFloat, Field(gt=0)],
726
+ Tuple[
727
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
728
+ ],
729
+ ] = None,
730
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
731
+ _content_type: Optional[StrictStr] = None,
732
+ _headers: Optional[Dict[StrictStr, Any]] = None,
733
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
734
+ ) -> RESTResponseType:
735
+ """Kill Strategy
736
+
737
+ Kills a strategy by disabling it and deleting all bots associated with it.
738
+
739
+ :param id: (required)
740
+ :type id: str
741
+ :param access_token:
742
+ :type access_token: str
743
+ :param _request_timeout: timeout setting for this request. If one
744
+ number provided, it will be total request
745
+ timeout. It can also be a pair (tuple) of
746
+ (connection, read) timeouts.
747
+ :type _request_timeout: int, tuple(int, int), optional
748
+ :param _request_auth: set to override the auth_settings for an a single
749
+ request; this effectively ignores the
750
+ authentication in the spec for a single request.
751
+ :type _request_auth: dict, optional
752
+ :param _content_type: force content-type for the request.
753
+ :type _content_type: str, Optional
754
+ :param _headers: set to override the headers for a single
755
+ request; this effectively ignores the headers
756
+ in the spec for a single request.
757
+ :type _headers: dict, optional
758
+ :param _host_index: set to override the host_index for a single
759
+ request; this effectively ignores the host_index
760
+ in the spec for a single request.
761
+ :type _host_index: int, optional
762
+ :return: Returns the result object.
763
+ """ # noqa: E501
764
+
765
+ _param = self._kill_strategy_serialize(
766
+ id=id,
767
+ access_token=access_token,
768
+ _request_auth=_request_auth,
769
+ _content_type=_content_type,
770
+ _headers=_headers,
771
+ _host_index=_host_index,
772
+ )
773
+
774
+ _response_types_map: Dict[str, Optional[str]] = {
775
+ "200": "object",
776
+ "422": "HTTPValidationError",
777
+ }
778
+ response_data = await self.api_client.call_api(
779
+ *_param, _request_timeout=_request_timeout
780
+ )
781
+ return response_data.response
782
+
783
+ def _kill_strategy_serialize(
784
+ self,
785
+ id,
786
+ access_token,
787
+ _request_auth,
788
+ _content_type,
789
+ _headers,
790
+ _host_index,
791
+ ) -> RequestSerialized:
792
+
793
+ _host = None
794
+
795
+ _collection_formats: Dict[str, str] = {}
796
+
797
+ _path_params: Dict[str, str] = {}
798
+ _query_params: List[Tuple[str, str]] = []
799
+ _header_params: Dict[str, Optional[str]] = _headers or {}
800
+ _form_params: List[Tuple[str, str]] = []
801
+ _files: Dict[
802
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
803
+ ] = {}
804
+ _body_params: Optional[bytes] = None
805
+
806
+ # process the path parameters
807
+ if id is not None:
808
+ _path_params["id"] = id
809
+ # process the query parameters
810
+ # process the header parameters
811
+ # process the form parameters
812
+ # process the body parameter
813
+
814
+ # set the HTTP header `Accept`
815
+ if "Accept" not in _header_params:
816
+ _header_params["Accept"] = self.api_client.select_header_accept(
817
+ ["application/json"]
818
+ )
819
+
820
+ # authentication setting
821
+ _auth_settings: List[str] = ["HTTPBearer"]
822
+
823
+ return self.api_client.param_serialize(
824
+ method="DELETE",
825
+ resource_path="/strategies/{id}",
826
+ path_params=_path_params,
827
+ query_params=_query_params,
828
+ header_params=_header_params,
829
+ body=_body_params,
830
+ post_params=_form_params,
831
+ files=_files,
832
+ auth_settings=_auth_settings,
833
+ collection_formats=_collection_formats,
834
+ _host=_host,
835
+ _request_auth=_request_auth,
836
+ )
837
+
838
+ @validate_call
839
+ async def update_strategy(
840
+ self,
841
+ id: StrictStr,
842
+ strategy_model_input: StrategyModelInput,
843
+ access_token: Optional[StrictStr] = None,
844
+ _request_timeout: Union[
845
+ None,
846
+ Annotated[StrictFloat, Field(gt=0)],
847
+ Tuple[
848
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
849
+ ],
850
+ ] = None,
851
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
852
+ _content_type: Optional[StrictStr] = None,
853
+ _headers: Optional[Dict[StrictStr, Any]] = None,
854
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
855
+ ) -> object:
856
+ """Update Strategy
857
+
858
+ Updates a strategy. If the strategy is being disabled, all bots associated with it will be set to stopping.
859
+
860
+ :param id: (required)
861
+ :type id: str
862
+ :param strategy_model_input: (required)
863
+ :type strategy_model_input: StrategyModelInput
864
+ :param access_token:
865
+ :type access_token: str
866
+ :param _request_timeout: timeout setting for this request. If one
867
+ number provided, it will be total request
868
+ timeout. It can also be a pair (tuple) of
869
+ (connection, read) timeouts.
870
+ :type _request_timeout: int, tuple(int, int), optional
871
+ :param _request_auth: set to override the auth_settings for an a single
872
+ request; this effectively ignores the
873
+ authentication in the spec for a single request.
874
+ :type _request_auth: dict, optional
875
+ :param _content_type: force content-type for the request.
876
+ :type _content_type: str, Optional
877
+ :param _headers: set to override the headers for a single
878
+ request; this effectively ignores the headers
879
+ in the spec for a single request.
880
+ :type _headers: dict, optional
881
+ :param _host_index: set to override the host_index for a single
882
+ request; this effectively ignores the host_index
883
+ in the spec for a single request.
884
+ :type _host_index: int, optional
885
+ :return: Returns the result object.
886
+ """ # noqa: E501
887
+
888
+ _param = self._update_strategy_serialize(
889
+ id=id,
890
+ strategy_model_input=strategy_model_input,
891
+ access_token=access_token,
892
+ _request_auth=_request_auth,
893
+ _content_type=_content_type,
894
+ _headers=_headers,
895
+ _host_index=_host_index,
896
+ )
897
+
898
+ _response_types_map: Dict[str, Optional[str]] = {
899
+ "200": "object",
900
+ "422": "HTTPValidationError",
901
+ }
902
+ response_data = await self.api_client.call_api(
903
+ *_param, _request_timeout=_request_timeout
904
+ )
905
+ await response_data.read()
906
+ return self.api_client.response_deserialize(
907
+ response_data=response_data,
908
+ response_types_map=_response_types_map,
909
+ ).data
910
+
911
+ @validate_call
912
+ async def update_strategy_with_http_info(
913
+ self,
914
+ id: StrictStr,
915
+ strategy_model_input: StrategyModelInput,
916
+ access_token: Optional[StrictStr] = None,
917
+ _request_timeout: Union[
918
+ None,
919
+ Annotated[StrictFloat, Field(gt=0)],
920
+ Tuple[
921
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
922
+ ],
923
+ ] = None,
924
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
925
+ _content_type: Optional[StrictStr] = None,
926
+ _headers: Optional[Dict[StrictStr, Any]] = None,
927
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
928
+ ) -> ApiResponse[object]:
929
+ """Update Strategy
930
+
931
+ Updates a strategy. If the strategy is being disabled, all bots associated with it will be set to stopping.
932
+
933
+ :param id: (required)
934
+ :type id: str
935
+ :param strategy_model_input: (required)
936
+ :type strategy_model_input: StrategyModelInput
937
+ :param access_token:
938
+ :type access_token: str
939
+ :param _request_timeout: timeout setting for this request. If one
940
+ number provided, it will be total request
941
+ timeout. It can also be a pair (tuple) of
942
+ (connection, read) timeouts.
943
+ :type _request_timeout: int, tuple(int, int), optional
944
+ :param _request_auth: set to override the auth_settings for an a single
945
+ request; this effectively ignores the
946
+ authentication in the spec for a single request.
947
+ :type _request_auth: dict, optional
948
+ :param _content_type: force content-type for the request.
949
+ :type _content_type: str, Optional
950
+ :param _headers: set to override the headers for a single
951
+ request; this effectively ignores the headers
952
+ in the spec for a single request.
953
+ :type _headers: dict, optional
954
+ :param _host_index: set to override the host_index for a single
955
+ request; this effectively ignores the host_index
956
+ in the spec for a single request.
957
+ :type _host_index: int, optional
958
+ :return: Returns the result object.
959
+ """ # noqa: E501
960
+
961
+ _param = self._update_strategy_serialize(
962
+ id=id,
963
+ strategy_model_input=strategy_model_input,
964
+ access_token=access_token,
965
+ _request_auth=_request_auth,
966
+ _content_type=_content_type,
967
+ _headers=_headers,
968
+ _host_index=_host_index,
969
+ )
970
+
971
+ _response_types_map: Dict[str, Optional[str]] = {
972
+ "200": "object",
973
+ "422": "HTTPValidationError",
974
+ }
975
+ response_data = await self.api_client.call_api(
976
+ *_param, _request_timeout=_request_timeout
977
+ )
978
+ await response_data.read()
979
+ return self.api_client.response_deserialize(
980
+ response_data=response_data,
981
+ response_types_map=_response_types_map,
982
+ )
983
+
984
+ @validate_call
985
+ async def update_strategy_without_preload_content(
986
+ self,
987
+ id: StrictStr,
988
+ strategy_model_input: StrategyModelInput,
989
+ access_token: Optional[StrictStr] = None,
990
+ _request_timeout: Union[
991
+ None,
992
+ Annotated[StrictFloat, Field(gt=0)],
993
+ Tuple[
994
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
995
+ ],
996
+ ] = None,
997
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
998
+ _content_type: Optional[StrictStr] = None,
999
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1000
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1001
+ ) -> RESTResponseType:
1002
+ """Update Strategy
1003
+
1004
+ Updates a strategy. If the strategy is being disabled, all bots associated with it will be set to stopping.
1005
+
1006
+ :param id: (required)
1007
+ :type id: str
1008
+ :param strategy_model_input: (required)
1009
+ :type strategy_model_input: StrategyModelInput
1010
+ :param access_token:
1011
+ :type access_token: str
1012
+ :param _request_timeout: timeout setting for this request. If one
1013
+ number provided, it will be total request
1014
+ timeout. It can also be a pair (tuple) of
1015
+ (connection, read) timeouts.
1016
+ :type _request_timeout: int, tuple(int, int), optional
1017
+ :param _request_auth: set to override the auth_settings for an a single
1018
+ request; this effectively ignores the
1019
+ authentication in the spec for a single request.
1020
+ :type _request_auth: dict, optional
1021
+ :param _content_type: force content-type for the request.
1022
+ :type _content_type: str, Optional
1023
+ :param _headers: set to override the headers for a single
1024
+ request; this effectively ignores the headers
1025
+ in the spec for a single request.
1026
+ :type _headers: dict, optional
1027
+ :param _host_index: set to override the host_index for a single
1028
+ request; this effectively ignores the host_index
1029
+ in the spec for a single request.
1030
+ :type _host_index: int, optional
1031
+ :return: Returns the result object.
1032
+ """ # noqa: E501
1033
+
1034
+ _param = self._update_strategy_serialize(
1035
+ id=id,
1036
+ strategy_model_input=strategy_model_input,
1037
+ access_token=access_token,
1038
+ _request_auth=_request_auth,
1039
+ _content_type=_content_type,
1040
+ _headers=_headers,
1041
+ _host_index=_host_index,
1042
+ )
1043
+
1044
+ _response_types_map: Dict[str, Optional[str]] = {
1045
+ "200": "object",
1046
+ "422": "HTTPValidationError",
1047
+ }
1048
+ response_data = await self.api_client.call_api(
1049
+ *_param, _request_timeout=_request_timeout
1050
+ )
1051
+ return response_data.response
1052
+
1053
+ def _update_strategy_serialize(
1054
+ self,
1055
+ id,
1056
+ strategy_model_input,
1057
+ access_token,
1058
+ _request_auth,
1059
+ _content_type,
1060
+ _headers,
1061
+ _host_index,
1062
+ ) -> RequestSerialized:
1063
+
1064
+ _host = None
1065
+
1066
+ _collection_formats: Dict[str, str] = {}
1067
+
1068
+ _path_params: Dict[str, str] = {}
1069
+ _query_params: List[Tuple[str, str]] = []
1070
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1071
+ _form_params: List[Tuple[str, str]] = []
1072
+ _files: Dict[
1073
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1074
+ ] = {}
1075
+ _body_params: Optional[bytes] = None
1076
+
1077
+ # process the path parameters
1078
+ if id is not None:
1079
+ _path_params["id"] = id
1080
+ # process the query parameters
1081
+ # process the header parameters
1082
+ # process the form parameters
1083
+ # process the body parameter
1084
+ if strategy_model_input is not None:
1085
+ _body_params = strategy_model_input
1086
+
1087
+ # set the HTTP header `Accept`
1088
+ if "Accept" not in _header_params:
1089
+ _header_params["Accept"] = self.api_client.select_header_accept(
1090
+ ["application/json"]
1091
+ )
1092
+
1093
+ # set the HTTP header `Content-Type`
1094
+ if _content_type:
1095
+ _header_params["Content-Type"] = _content_type
1096
+ else:
1097
+ _default_content_type = self.api_client.select_header_content_type(
1098
+ ["application/json"]
1099
+ )
1100
+ if _default_content_type is not None:
1101
+ _header_params["Content-Type"] = _default_content_type
1102
+
1103
+ # authentication setting
1104
+ _auth_settings: List[str] = ["HTTPBearer"]
1105
+
1106
+ return self.api_client.param_serialize(
1107
+ method="PUT",
1108
+ resource_path="/strategies/{id}",
1109
+ path_params=_path_params,
1110
+ query_params=_query_params,
1111
+ header_params=_header_params,
1112
+ body=_body_params,
1113
+ post_params=_form_params,
1114
+ files=_files,
1115
+ auth_settings=_auth_settings,
1116
+ collection_formats=_collection_formats,
1117
+ _host=_host,
1118
+ _request_auth=_request_auth,
1119
+ )