crypticorn 2.15.0__py3-none-any.whl → 2.17.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 (168) hide show
  1. crypticorn/__init__.py +2 -2
  2. crypticorn/auth/client/api/admin_api.py +397 -13
  3. crypticorn/auth/client/api/auth_api.py +3610 -341
  4. crypticorn/auth/client/api/service_api.py +249 -7
  5. crypticorn/auth/client/api/user_api.py +2295 -179
  6. crypticorn/auth/client/api/wallet_api.py +1468 -81
  7. crypticorn/auth/client/configuration.py +2 -2
  8. crypticorn/auth/client/models/create_api_key_request.py +2 -1
  9. crypticorn/auth/client/models/get_api_keys200_response_inner.py +2 -1
  10. crypticorn/auth/client/rest.py +23 -4
  11. crypticorn/auth/main.py +8 -5
  12. crypticorn/cli/init.py +1 -1
  13. crypticorn/cli/templates/.env.docker.temp +3 -0
  14. crypticorn/cli/templates/.env.example.temp +4 -0
  15. crypticorn/cli/templates/Dockerfile +5 -2
  16. crypticorn/client.py +226 -59
  17. crypticorn/common/__init__.py +1 -0
  18. crypticorn/common/auth.py +45 -14
  19. crypticorn/common/decorators.py +1 -2
  20. crypticorn/common/enums.py +0 -2
  21. crypticorn/common/errors.py +10 -0
  22. crypticorn/common/metrics.py +30 -0
  23. crypticorn/common/middleware.py +94 -1
  24. crypticorn/common/pagination.py +252 -18
  25. crypticorn/common/router/admin_router.py +2 -2
  26. crypticorn/common/router/status_router.py +40 -2
  27. crypticorn/common/scopes.py +2 -0
  28. crypticorn/common/warnings.py +8 -0
  29. crypticorn/dex/__init__.py +6 -0
  30. crypticorn/dex/client/__init__.py +49 -0
  31. crypticorn/dex/client/api/__init__.py +6 -0
  32. crypticorn/dex/client/api/admin_api.py +2986 -0
  33. crypticorn/dex/client/api/signals_api.py +1798 -0
  34. crypticorn/dex/client/api/status_api.py +892 -0
  35. crypticorn/dex/client/api_client.py +758 -0
  36. crypticorn/dex/client/api_response.py +20 -0
  37. crypticorn/dex/client/configuration.py +620 -0
  38. crypticorn/dex/client/exceptions.py +220 -0
  39. crypticorn/dex/client/models/__init__.py +30 -0
  40. crypticorn/dex/client/models/api_error_identifier.py +121 -0
  41. crypticorn/dex/client/models/api_error_level.py +37 -0
  42. crypticorn/dex/client/models/api_error_type.py +37 -0
  43. crypticorn/dex/client/models/exception_detail.py +117 -0
  44. crypticorn/dex/client/models/log_level.py +38 -0
  45. crypticorn/dex/client/models/paginated_response_signal_with_token.py +134 -0
  46. crypticorn/dex/client/models/risk.py +86 -0
  47. crypticorn/dex/client/models/signal_overview_stats.py +158 -0
  48. crypticorn/dex/client/models/signal_volume.py +84 -0
  49. crypticorn/dex/client/models/signal_with_token.py +163 -0
  50. crypticorn/dex/client/models/token_data.py +127 -0
  51. crypticorn/dex/client/models/token_detail.py +116 -0
  52. crypticorn/dex/client/py.typed +0 -0
  53. crypticorn/dex/client/rest.py +217 -0
  54. crypticorn/dex/main.py +1 -0
  55. crypticorn/hive/client/api/admin_api.py +1173 -47
  56. crypticorn/hive/client/api/data_api.py +499 -17
  57. crypticorn/hive/client/api/models_api.py +1595 -87
  58. crypticorn/hive/client/api/status_api.py +397 -16
  59. crypticorn/hive/client/api_client.py +0 -5
  60. crypticorn/hive/client/models/api_error_identifier.py +1 -1
  61. crypticorn/hive/client/models/coin_info.py +1 -1
  62. crypticorn/hive/client/models/exception_detail.py +1 -1
  63. crypticorn/hive/client/models/target_info.py +1 -1
  64. crypticorn/hive/client/rest.py +23 -4
  65. crypticorn/hive/main.py +99 -25
  66. crypticorn/hive/utils.py +2 -2
  67. crypticorn/klines/client/api/admin_api.py +1173 -47
  68. crypticorn/klines/client/api/change_in_timeframe_api.py +269 -11
  69. crypticorn/klines/client/api/funding_rates_api.py +315 -11
  70. crypticorn/klines/client/api/ohlcv_data_api.py +390 -11
  71. crypticorn/klines/client/api/status_api.py +397 -16
  72. crypticorn/klines/client/api/symbols_api.py +216 -11
  73. crypticorn/klines/client/api/udf_api.py +1268 -51
  74. crypticorn/klines/client/api_client.py +0 -5
  75. crypticorn/klines/client/models/api_error_identifier.py +3 -1
  76. crypticorn/klines/client/models/exception_detail.py +1 -1
  77. crypticorn/klines/client/models/ohlcv.py +1 -1
  78. crypticorn/klines/client/models/symbol_group.py +1 -1
  79. crypticorn/klines/client/models/udf_config.py +1 -1
  80. crypticorn/klines/client/rest.py +23 -4
  81. crypticorn/klines/main.py +89 -12
  82. crypticorn/metrics/client/api/admin_api.py +1173 -47
  83. crypticorn/metrics/client/api/exchanges_api.py +1370 -145
  84. crypticorn/metrics/client/api/indicators_api.py +622 -17
  85. crypticorn/metrics/client/api/logs_api.py +296 -11
  86. crypticorn/metrics/client/api/marketcap_api.py +1207 -67
  87. crypticorn/metrics/client/api/markets_api.py +343 -11
  88. crypticorn/metrics/client/api/quote_currencies_api.py +228 -11
  89. crypticorn/metrics/client/api/status_api.py +397 -16
  90. crypticorn/metrics/client/api/tokens_api.py +382 -15
  91. crypticorn/metrics/client/api_client.py +0 -5
  92. crypticorn/metrics/client/configuration.py +4 -2
  93. crypticorn/metrics/client/models/exception_detail.py +1 -1
  94. crypticorn/metrics/client/models/exchange_mapping.py +1 -1
  95. crypticorn/metrics/client/models/marketcap_ranking.py +1 -1
  96. crypticorn/metrics/client/models/marketcap_symbol_ranking.py +1 -1
  97. crypticorn/metrics/client/models/ohlcv.py +1 -1
  98. crypticorn/metrics/client/rest.py +23 -4
  99. crypticorn/metrics/main.py +113 -19
  100. crypticorn/pay/client/api/admin_api.py +1585 -57
  101. crypticorn/pay/client/api/now_payments_api.py +961 -39
  102. crypticorn/pay/client/api/payments_api.py +562 -17
  103. crypticorn/pay/client/api/products_api.py +880 -30
  104. crypticorn/pay/client/api/status_api.py +397 -16
  105. crypticorn/pay/client/api_client.py +0 -5
  106. crypticorn/pay/client/configuration.py +2 -2
  107. crypticorn/pay/client/models/api_error_identifier.py +7 -7
  108. crypticorn/pay/client/models/exception_detail.py +1 -1
  109. crypticorn/pay/client/models/now_create_invoice_req.py +1 -1
  110. crypticorn/pay/client/models/now_create_invoice_res.py +1 -1
  111. crypticorn/pay/client/models/product.py +1 -1
  112. crypticorn/pay/client/models/product_create.py +1 -1
  113. crypticorn/pay/client/models/product_update.py +1 -1
  114. crypticorn/pay/client/models/scope.py +1 -0
  115. crypticorn/pay/client/rest.py +23 -4
  116. crypticorn/pay/main.py +10 -6
  117. crypticorn/trade/client/__init__.py +11 -1
  118. crypticorn/trade/client/api/__init__.py +0 -1
  119. crypticorn/trade/client/api/admin_api.py +1184 -55
  120. crypticorn/trade/client/api/api_keys_api.py +1678 -162
  121. crypticorn/trade/client/api/bots_api.py +7563 -187
  122. crypticorn/trade/client/api/exchanges_api.py +565 -19
  123. crypticorn/trade/client/api/notifications_api.py +1290 -116
  124. crypticorn/trade/client/api/orders_api.py +393 -55
  125. crypticorn/trade/client/api/status_api.py +397 -13
  126. crypticorn/trade/client/api/strategies_api.py +1133 -77
  127. crypticorn/trade/client/api/trading_actions_api.py +786 -65
  128. crypticorn/trade/client/models/__init__.py +11 -0
  129. crypticorn/trade/client/models/actions_count.py +88 -0
  130. crypticorn/trade/client/models/api_error_identifier.py +8 -7
  131. crypticorn/trade/client/models/bot.py +7 -18
  132. crypticorn/trade/client/models/bot_create.py +17 -1
  133. crypticorn/trade/client/models/bot_update.py +17 -1
  134. crypticorn/trade/client/models/exchange.py +6 -1
  135. crypticorn/trade/client/models/exchange_key.py +1 -1
  136. crypticorn/trade/client/models/exchange_key_balance.py +111 -0
  137. crypticorn/trade/client/models/exchange_key_create.py +17 -1
  138. crypticorn/trade/client/models/exchange_key_update.py +17 -1
  139. crypticorn/trade/client/models/execution_ids.py +1 -1
  140. crypticorn/trade/client/models/futures_balance.py +27 -25
  141. crypticorn/trade/client/models/futures_trading_action.py +6 -28
  142. crypticorn/trade/client/models/futures_trading_action_create.py +10 -13
  143. crypticorn/trade/client/models/notification.py +17 -1
  144. crypticorn/trade/client/models/notification_create.py +18 -2
  145. crypticorn/trade/client/models/notification_update.py +17 -1
  146. crypticorn/trade/client/models/order.py +2 -14
  147. crypticorn/trade/client/models/orders_count.py +88 -0
  148. crypticorn/trade/client/models/paginated_response_futures_trading_action.py +134 -0
  149. crypticorn/trade/client/models/paginated_response_order.py +134 -0
  150. crypticorn/trade/client/models/pn_l.py +95 -0
  151. crypticorn/trade/client/models/post_futures_action.py +1 -1
  152. crypticorn/trade/client/models/spot_balance.py +109 -0
  153. crypticorn/trade/client/models/spot_trading_action_create.py +4 -1
  154. crypticorn/trade/client/models/strategy.py +22 -4
  155. crypticorn/trade/client/models/strategy_create.py +23 -5
  156. crypticorn/trade/client/models/strategy_exchange_info.py +16 -4
  157. crypticorn/trade/client/models/strategy_update.py +19 -3
  158. crypticorn/trade/client/models/tpsl.py +4 -27
  159. crypticorn/trade/client/models/tpsl_create.py +6 -19
  160. crypticorn/trade/client/rest.py +23 -4
  161. crypticorn/trade/main.py +15 -12
  162. {crypticorn-2.15.0.dist-info → crypticorn-2.17.0.dist-info}/METADATA +65 -20
  163. {crypticorn-2.15.0.dist-info → crypticorn-2.17.0.dist-info}/RECORD +167 -132
  164. crypticorn/trade/client/api/futures_trading_panel_api.py +0 -1285
  165. {crypticorn-2.15.0.dist-info → crypticorn-2.17.0.dist-info}/WHEEL +0 -0
  166. {crypticorn-2.15.0.dist-info → crypticorn-2.17.0.dist-info}/entry_points.txt +0 -0
  167. {crypticorn-2.15.0.dist-info → crypticorn-2.17.0.dist-info}/licenses/LICENSE +0 -0
  168. {crypticorn-2.15.0.dist-info → crypticorn-2.17.0.dist-info}/top_level.txt +0 -0
@@ -16,14 +16,33 @@ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
16
  from typing import Any, Dict, List, Optional, Tuple, Union
17
17
  from typing_extensions import Annotated
18
18
 
19
- from pydantic import StrictInt
19
+ from pydantic import Field, StrictStr, field_validator
20
20
  from typing import List, Optional
21
- from crypticorn.trade.client.models.order import Order
21
+ from typing_extensions import Annotated
22
+ from crypticorn.trade.client.models.orders_count import OrdersCount
22
23
 
23
24
  from crypticorn.trade.client.api_client import ApiClient, RequestSerialized
24
25
  from crypticorn.trade.client.api_response import ApiResponse
25
26
  from crypticorn.trade.client.rest import RESTResponseType
26
27
 
28
+ # Import async_to_sync for sync methods
29
+ try:
30
+ from asgiref.sync import async_to_sync
31
+
32
+ _HAS_ASGIREF = True
33
+ except ImportError:
34
+ _HAS_ASGIREF = False
35
+
36
+ def async_to_sync(async_func):
37
+ """Fallback decorator that raises an error if asgiref is not available."""
38
+
39
+ def wrapper(*args, **kwargs):
40
+ raise ImportError(
41
+ "asgiref is required for sync methods. Install with: pip install asgiref"
42
+ )
43
+
44
+ return wrapper
45
+
27
46
 
28
47
  class OrdersApi:
29
48
  """NOTE: This class is auto generated by OpenAPI Generator
@@ -32,16 +51,131 @@ class OrdersApi:
32
51
  Do not edit the class manually.
33
52
  """
34
53
 
35
- def __init__(self, api_client=None) -> None:
54
+ def __init__(self, api_client=None, is_sync: bool = False) -> None:
36
55
  if api_client is None:
37
56
  api_client = ApiClient.get_default()
38
57
  self.api_client = api_client
58
+ self.is_sync = is_sync
59
+
60
+ @validate_call
61
+ def get_orders_count(
62
+ self,
63
+ sort_order: Annotated[
64
+ Optional[StrictStr], Field(description="The order to sort by")
65
+ ] = None,
66
+ sort_by: Annotated[
67
+ Optional[StrictStr], Field(description="The field to sort by")
68
+ ] = None,
69
+ group_by: Annotated[
70
+ Optional[StrictStr],
71
+ Field(
72
+ description="The group by period for the orders count. Defaults to day."
73
+ ),
74
+ ] = None,
75
+ _request_timeout: Union[
76
+ None,
77
+ Annotated[StrictFloat, Field(gt=0)],
78
+ Tuple[
79
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
80
+ ],
81
+ ] = None,
82
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
83
+ _content_type: Optional[StrictStr] = None,
84
+ _headers: Optional[Dict[StrictStr, Any]] = None,
85
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
86
+ ) -> List[OrdersCount]:
87
+ """Get Orders Count"""
88
+ if self.is_sync:
89
+ return self._get_orders_count_sync(
90
+ sort_order=sort_order,
91
+ sort_by=sort_by,
92
+ group_by=group_by,
93
+ _request_timeout=_request_timeout,
94
+ _request_auth=_request_auth,
95
+ _content_type=_content_type,
96
+ _headers=_headers,
97
+ _host_index=_host_index,
98
+ )
99
+
100
+ else:
101
+ return self._get_orders_count_async(
102
+ sort_order=sort_order,
103
+ sort_by=sort_by,
104
+ group_by=group_by,
105
+ _request_timeout=_request_timeout,
106
+ _request_auth=_request_auth,
107
+ _content_type=_content_type,
108
+ _headers=_headers,
109
+ _host_index=_host_index,
110
+ )
111
+
112
+ @validate_call
113
+ def get_orders_count_with_http_info(
114
+ self,
115
+ sort_order: Annotated[
116
+ Optional[StrictStr], Field(description="The order to sort by")
117
+ ] = None,
118
+ sort_by: Annotated[
119
+ Optional[StrictStr], Field(description="The field to sort by")
120
+ ] = None,
121
+ group_by: Annotated[
122
+ Optional[StrictStr],
123
+ Field(
124
+ description="The group by period for the orders count. Defaults to day."
125
+ ),
126
+ ] = None,
127
+ _request_timeout: Union[
128
+ None,
129
+ Annotated[StrictFloat, Field(gt=0)],
130
+ Tuple[
131
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
132
+ ],
133
+ ] = None,
134
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
135
+ _content_type: Optional[StrictStr] = None,
136
+ _headers: Optional[Dict[StrictStr, Any]] = None,
137
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
138
+ ) -> ApiResponse[List[OrdersCount]]:
139
+ """Get Orders Count with HTTP info"""
140
+ if self.is_sync:
141
+ return self._get_orders_count_sync_with_http_info(
142
+ sort_order=sort_order,
143
+ sort_by=sort_by,
144
+ group_by=group_by,
145
+ _request_timeout=_request_timeout,
146
+ _request_auth=_request_auth,
147
+ _content_type=_content_type,
148
+ _headers=_headers,
149
+ _host_index=_host_index,
150
+ )
151
+
152
+ else:
153
+ return self._get_orders_count_async_with_http_info(
154
+ sort_order=sort_order,
155
+ sort_by=sort_by,
156
+ group_by=group_by,
157
+ _request_timeout=_request_timeout,
158
+ _request_auth=_request_auth,
159
+ _content_type=_content_type,
160
+ _headers=_headers,
161
+ _host_index=_host_index,
162
+ )
39
163
 
40
164
  @validate_call
41
- async def get_orders(
165
+ def get_orders_count_without_preload_content(
42
166
  self,
43
- limit: Optional[StrictInt] = None,
44
- offset: Optional[StrictInt] = None,
167
+ sort_order: Annotated[
168
+ Optional[StrictStr], Field(description="The order to sort by")
169
+ ] = None,
170
+ sort_by: Annotated[
171
+ Optional[StrictStr], Field(description="The field to sort by")
172
+ ] = None,
173
+ group_by: Annotated[
174
+ Optional[StrictStr],
175
+ Field(
176
+ description="The group by period for the orders count. Defaults to day."
177
+ ),
178
+ ] = None,
45
179
  _request_timeout: Union[
46
180
  None,
47
181
  Annotated[StrictFloat, Field(gt=0)],
@@ -53,15 +187,70 @@ class OrdersApi:
53
187
  _content_type: Optional[StrictStr] = None,
54
188
  _headers: Optional[Dict[StrictStr, Any]] = None,
55
189
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
56
- ) -> List[Order]:
57
- """Get Orders
190
+ ) -> RESTResponseType:
191
+ """Get Orders Count without preloading content"""
192
+ if self.is_sync:
193
+ return self._get_orders_count_sync_without_preload_content(
194
+ sort_order=sort_order,
195
+ sort_by=sort_by,
196
+ group_by=group_by,
197
+ _request_timeout=_request_timeout,
198
+ _request_auth=_request_auth,
199
+ _content_type=_content_type,
200
+ _headers=_headers,
201
+ _host_index=_host_index,
202
+ )
58
203
 
59
- Get all orders for a user
204
+ else:
205
+ return self._get_orders_count_async_without_preload_content(
206
+ sort_order=sort_order,
207
+ sort_by=sort_by,
208
+ group_by=group_by,
209
+ _request_timeout=_request_timeout,
210
+ _request_auth=_request_auth,
211
+ _content_type=_content_type,
212
+ _headers=_headers,
213
+ _host_index=_host_index,
214
+ )
60
215
 
61
- :param limit:
62
- :type limit: int
63
- :param offset:
64
- :type offset: int
216
+ # Private async implementation methods
217
+ @validate_call
218
+ async def _get_orders_count_async(
219
+ self,
220
+ sort_order: Annotated[
221
+ Optional[StrictStr], Field(description="The order to sort by")
222
+ ] = None,
223
+ sort_by: Annotated[
224
+ Optional[StrictStr], Field(description="The field to sort by")
225
+ ] = None,
226
+ group_by: Annotated[
227
+ Optional[StrictStr],
228
+ Field(
229
+ description="The group by period for the orders count. Defaults to day."
230
+ ),
231
+ ] = None,
232
+ _request_timeout: Union[
233
+ None,
234
+ Annotated[StrictFloat, Field(gt=0)],
235
+ Tuple[
236
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
237
+ ],
238
+ ] = None,
239
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
240
+ _content_type: Optional[StrictStr] = None,
241
+ _headers: Optional[Dict[StrictStr, Any]] = None,
242
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
243
+ ) -> List[OrdersCount]:
244
+ """Get Orders Count
245
+
246
+ Get the number of orders for all users by day, week, month, or year. The default sort is `timestamp` and the default order is `asc`..
247
+
248
+ :param sort_order: The order to sort by
249
+ :type sort_order: str
250
+ :param sort_by: The field to sort by
251
+ :type sort_by: str
252
+ :param group_by: The group by period for the orders count. Defaults to day.
253
+ :type group_by: str
65
254
  :param _request_timeout: timeout setting for this request. If one
66
255
  number provided, it will be total request
67
256
  timeout. It can also be a pair (tuple) of
@@ -84,9 +273,10 @@ class OrdersApi:
84
273
  :return: Returns the result object.
85
274
  """ # noqa: E501
86
275
 
87
- _param = self._get_orders_serialize(
88
- limit=limit,
89
- offset=offset,
276
+ _param = self._get_orders_count_serialize(
277
+ sort_order=sort_order,
278
+ sort_by=sort_by,
279
+ group_by=group_by,
90
280
  _request_auth=_request_auth,
91
281
  _content_type=_content_type,
92
282
  _headers=_headers,
@@ -94,7 +284,7 @@ class OrdersApi:
94
284
  )
95
285
 
96
286
  _response_types_map: Dict[str, Optional[str]] = {
97
- "200": "List[Order]",
287
+ "200": "List[OrdersCount]",
98
288
  }
99
289
  response_data = await self.api_client.call_api(
100
290
  *_param, _request_timeout=_request_timeout
@@ -106,10 +296,20 @@ class OrdersApi:
106
296
  ).data
107
297
 
108
298
  @validate_call
109
- async def get_orders_with_http_info(
299
+ async def _get_orders_count_async_with_http_info(
110
300
  self,
111
- limit: Optional[StrictInt] = None,
112
- offset: Optional[StrictInt] = None,
301
+ sort_order: Annotated[
302
+ Optional[StrictStr], Field(description="The order to sort by")
303
+ ] = None,
304
+ sort_by: Annotated[
305
+ Optional[StrictStr], Field(description="The field to sort by")
306
+ ] = None,
307
+ group_by: Annotated[
308
+ Optional[StrictStr],
309
+ Field(
310
+ description="The group by period for the orders count. Defaults to day."
311
+ ),
312
+ ] = None,
113
313
  _request_timeout: Union[
114
314
  None,
115
315
  Annotated[StrictFloat, Field(gt=0)],
@@ -121,15 +321,17 @@ class OrdersApi:
121
321
  _content_type: Optional[StrictStr] = None,
122
322
  _headers: Optional[Dict[StrictStr, Any]] = None,
123
323
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
124
- ) -> ApiResponse[List[Order]]:
125
- """Get Orders
324
+ ) -> ApiResponse[List[OrdersCount]]:
325
+ """Get Orders Count
126
326
 
127
- Get all orders for a user
327
+ Get the number of orders for all users by day, week, month, or year. The default sort is `timestamp` and the default order is `asc`..
128
328
 
129
- :param limit:
130
- :type limit: int
131
- :param offset:
132
- :type offset: int
329
+ :param sort_order: The order to sort by
330
+ :type sort_order: str
331
+ :param sort_by: The field to sort by
332
+ :type sort_by: str
333
+ :param group_by: The group by period for the orders count. Defaults to day.
334
+ :type group_by: str
133
335
  :param _request_timeout: timeout setting for this request. If one
134
336
  number provided, it will be total request
135
337
  timeout. It can also be a pair (tuple) of
@@ -152,9 +354,10 @@ class OrdersApi:
152
354
  :return: Returns the result object.
153
355
  """ # noqa: E501
154
356
 
155
- _param = self._get_orders_serialize(
156
- limit=limit,
157
- offset=offset,
357
+ _param = self._get_orders_count_serialize(
358
+ sort_order=sort_order,
359
+ sort_by=sort_by,
360
+ group_by=group_by,
158
361
  _request_auth=_request_auth,
159
362
  _content_type=_content_type,
160
363
  _headers=_headers,
@@ -162,22 +365,31 @@ class OrdersApi:
162
365
  )
163
366
 
164
367
  _response_types_map: Dict[str, Optional[str]] = {
165
- "200": "List[Order]",
368
+ "200": "List[OrdersCount]",
166
369
  }
167
370
  response_data = await self.api_client.call_api(
168
371
  *_param, _request_timeout=_request_timeout
169
372
  )
170
373
  await response_data.read()
171
374
  return self.api_client.response_deserialize(
172
- response_data=response_data,
173
- response_types_map=_response_types_map,
375
+ response_data=response_data, response_types_map=_response_types_map
174
376
  )
175
377
 
176
378
  @validate_call
177
- async def get_orders_without_preload_content(
379
+ async def _get_orders_count_async_without_preload_content(
178
380
  self,
179
- limit: Optional[StrictInt] = None,
180
- offset: Optional[StrictInt] = None,
381
+ sort_order: Annotated[
382
+ Optional[StrictStr], Field(description="The order to sort by")
383
+ ] = None,
384
+ sort_by: Annotated[
385
+ Optional[StrictStr], Field(description="The field to sort by")
386
+ ] = None,
387
+ group_by: Annotated[
388
+ Optional[StrictStr],
389
+ Field(
390
+ description="The group by period for the orders count. Defaults to day."
391
+ ),
392
+ ] = None,
181
393
  _request_timeout: Union[
182
394
  None,
183
395
  Annotated[StrictFloat, Field(gt=0)],
@@ -190,14 +402,16 @@ class OrdersApi:
190
402
  _headers: Optional[Dict[StrictStr, Any]] = None,
191
403
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
192
404
  ) -> RESTResponseType:
193
- """Get Orders
405
+ """Get Orders Count
194
406
 
195
- Get all orders for a user
407
+ Get the number of orders for all users by day, week, month, or year. The default sort is `timestamp` and the default order is `asc`..
196
408
 
197
- :param limit:
198
- :type limit: int
199
- :param offset:
200
- :type offset: int
409
+ :param sort_order: The order to sort by
410
+ :type sort_order: str
411
+ :param sort_by: The field to sort by
412
+ :type sort_by: str
413
+ :param group_by: The group by period for the orders count. Defaults to day.
414
+ :type group_by: str
201
415
  :param _request_timeout: timeout setting for this request. If one
202
416
  number provided, it will be total request
203
417
  timeout. It can also be a pair (tuple) of
@@ -220,9 +434,10 @@ class OrdersApi:
220
434
  :return: Returns the result object.
221
435
  """ # noqa: E501
222
436
 
223
- _param = self._get_orders_serialize(
224
- limit=limit,
225
- offset=offset,
437
+ _param = self._get_orders_count_serialize(
438
+ sort_order=sort_order,
439
+ sort_by=sort_by,
440
+ group_by=group_by,
226
441
  _request_auth=_request_auth,
227
442
  _content_type=_content_type,
228
443
  _headers=_headers,
@@ -230,17 +445,136 @@ class OrdersApi:
230
445
  )
231
446
 
232
447
  _response_types_map: Dict[str, Optional[str]] = {
233
- "200": "List[Order]",
448
+ "200": "List[OrdersCount]",
234
449
  }
235
450
  response_data = await self.api_client.call_api(
236
451
  *_param, _request_timeout=_request_timeout
237
452
  )
238
- return response_data.response
453
+ return response_data
454
+
455
+ # Private sync implementation methods
456
+ @validate_call
457
+ def _get_orders_count_sync(
458
+ self,
459
+ sort_order: Annotated[
460
+ Optional[StrictStr], Field(description="The order to sort by")
461
+ ] = None,
462
+ sort_by: Annotated[
463
+ Optional[StrictStr], Field(description="The field to sort by")
464
+ ] = None,
465
+ group_by: Annotated[
466
+ Optional[StrictStr],
467
+ Field(
468
+ description="The group by period for the orders count. Defaults to day."
469
+ ),
470
+ ] = None,
471
+ _request_timeout: Union[
472
+ None,
473
+ Annotated[StrictFloat, Field(gt=0)],
474
+ Tuple[
475
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
476
+ ],
477
+ ] = None,
478
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
479
+ _content_type: Optional[StrictStr] = None,
480
+ _headers: Optional[Dict[StrictStr, Any]] = None,
481
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
482
+ ) -> List[OrdersCount]:
483
+ """Synchronous version of get_orders_count"""
484
+ return async_to_sync(self._get_orders_count_async)(
485
+ sort_order=sort_order,
486
+ sort_by=sort_by,
487
+ group_by=group_by,
488
+ _request_timeout=_request_timeout,
489
+ _request_auth=_request_auth,
490
+ _content_type=_content_type,
491
+ _headers=_headers,
492
+ _host_index=_host_index,
493
+ )
494
+
495
+ @validate_call
496
+ def _get_orders_count_sync_with_http_info(
497
+ self,
498
+ sort_order: Annotated[
499
+ Optional[StrictStr], Field(description="The order to sort by")
500
+ ] = None,
501
+ sort_by: Annotated[
502
+ Optional[StrictStr], Field(description="The field to sort by")
503
+ ] = None,
504
+ group_by: Annotated[
505
+ Optional[StrictStr],
506
+ Field(
507
+ description="The group by period for the orders count. Defaults to day."
508
+ ),
509
+ ] = None,
510
+ _request_timeout: Union[
511
+ None,
512
+ Annotated[StrictFloat, Field(gt=0)],
513
+ Tuple[
514
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
515
+ ],
516
+ ] = None,
517
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
518
+ _content_type: Optional[StrictStr] = None,
519
+ _headers: Optional[Dict[StrictStr, Any]] = None,
520
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
521
+ ) -> ApiResponse[List[OrdersCount]]:
522
+ """Synchronous version of get_orders_count_with_http_info"""
523
+ return async_to_sync(self._get_orders_count_async_with_http_info)(
524
+ sort_order=sort_order,
525
+ sort_by=sort_by,
526
+ group_by=group_by,
527
+ _request_timeout=_request_timeout,
528
+ _request_auth=_request_auth,
529
+ _content_type=_content_type,
530
+ _headers=_headers,
531
+ _host_index=_host_index,
532
+ )
239
533
 
240
- def _get_orders_serialize(
534
+ @validate_call
535
+ def _get_orders_count_sync_without_preload_content(
241
536
  self,
242
- limit,
243
- offset,
537
+ sort_order: Annotated[
538
+ Optional[StrictStr], Field(description="The order to sort by")
539
+ ] = None,
540
+ sort_by: Annotated[
541
+ Optional[StrictStr], Field(description="The field to sort by")
542
+ ] = None,
543
+ group_by: Annotated[
544
+ Optional[StrictStr],
545
+ Field(
546
+ description="The group by period for the orders count. Defaults to day."
547
+ ),
548
+ ] = None,
549
+ _request_timeout: Union[
550
+ None,
551
+ Annotated[StrictFloat, Field(gt=0)],
552
+ Tuple[
553
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
554
+ ],
555
+ ] = None,
556
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
557
+ _content_type: Optional[StrictStr] = None,
558
+ _headers: Optional[Dict[StrictStr, Any]] = None,
559
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
560
+ ) -> RESTResponseType:
561
+ """Synchronous version of get_orders_count_without_preload_content"""
562
+ return async_to_sync(self._get_orders_count_async_without_preload_content)(
563
+ sort_order=sort_order,
564
+ sort_by=sort_by,
565
+ group_by=group_by,
566
+ _request_timeout=_request_timeout,
567
+ _request_auth=_request_auth,
568
+ _content_type=_content_type,
569
+ _headers=_headers,
570
+ _host_index=_host_index,
571
+ )
572
+
573
+ def _get_orders_count_serialize(
574
+ self,
575
+ sort_order,
576
+ sort_by,
577
+ group_by,
244
578
  _request_auth,
245
579
  _content_type,
246
580
  _headers,
@@ -262,13 +596,17 @@ class OrdersApi:
262
596
 
263
597
  # process the path parameters
264
598
  # process the query parameters
265
- if limit is not None:
599
+ if sort_order is not None:
600
+
601
+ _query_params.append(("sort_order", sort_order))
602
+
603
+ if sort_by is not None:
266
604
 
267
- _query_params.append(("limit", limit))
605
+ _query_params.append(("sort_by", sort_by))
268
606
 
269
- if offset is not None:
607
+ if group_by is not None:
270
608
 
271
- _query_params.append(("offset", offset))
609
+ _query_params.append(("group_by", group_by))
272
610
 
273
611
  # process the header parameters
274
612
  # process the form parameters
@@ -285,7 +623,7 @@ class OrdersApi:
285
623
 
286
624
  return self.api_client.param_serialize(
287
625
  method="GET",
288
- resource_path="/orders",
626
+ resource_path="/orders/count",
289
627
  path_params=_path_params,
290
628
  query_params=_query_params,
291
629
  header_params=_header_params,