crypticorn 2.17.0rc7__py3-none-any.whl → 2.18.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 (78) hide show
  1. crypticorn/auth/client/api/admin_api.py +2 -0
  2. crypticorn/auth/client/api/auth_api.py +1417 -545
  3. crypticorn/auth/client/api/service_api.py +4 -0
  4. crypticorn/auth/client/api/user_api.py +4 -0
  5. crypticorn/auth/client/api/wallet_api.py +4 -0
  6. crypticorn/auth/client/api_client.py +5 -0
  7. crypticorn/auth/client/configuration.py +2 -2
  8. crypticorn/auth/client/models/add_wallet_request.py +1 -1
  9. crypticorn/auth/client/models/authorize_user_request.py +1 -1
  10. crypticorn/auth/client/models/create_api_key_request.py +3 -3
  11. crypticorn/auth/client/models/create_user_request.py +1 -1
  12. crypticorn/auth/client/models/get_api_keys200_response_inner.py +3 -3
  13. crypticorn/auth/client/models/list_wallets200_response_balances_inner_sale_round.py +1 -1
  14. crypticorn/auth/client/models/list_wallets200_response_balances_inner_wallet.py +1 -1
  15. crypticorn/auth/client/models/list_wallets200_response_balances_inner_wallet_vesting_wallets_inner.py +1 -1
  16. crypticorn/auth/client/models/list_wallets200_response_data_inner.py +1 -1
  17. crypticorn/auth/client/models/logout_default_response.py +1 -1
  18. crypticorn/auth/client/models/oauth_callback200_response_user.py +1 -1
  19. crypticorn/auth/client/models/refresh_token_info200_response_user_session.py +1 -1
  20. crypticorn/auth/client/models/rotate_tokens200_response.py +1 -1
  21. crypticorn/auth/client/models/token_info200_response.py +1 -1
  22. crypticorn/auth/client/models/update_user_request.py +1 -1
  23. crypticorn/auth/client/models/user_by_username200_response.py +1 -1
  24. crypticorn/auth/client/models/verify200_response.py +1 -1
  25. crypticorn/auth/client/models/verify_email200_response_auth.py +1 -1
  26. crypticorn/auth/client/models/verify_email200_response_auth_auth.py +1 -1
  27. crypticorn/auth/client/models/whoami200_response.py +1 -1
  28. crypticorn/common/__init__.py +11 -11
  29. crypticorn/common/auth.py +109 -57
  30. crypticorn/common/decorators.py +1 -1
  31. crypticorn/common/enums.py +1 -0
  32. crypticorn/common/errors.py +7 -21
  33. crypticorn/common/exceptions.py +33 -17
  34. crypticorn/common/logging.py +5 -4
  35. crypticorn/common/metrics.py +17 -5
  36. crypticorn/common/middleware.py +61 -12
  37. crypticorn/common/mixins.py +2 -1
  38. crypticorn/common/pagination.py +3 -2
  39. crypticorn/common/router/admin_router.py +17 -6
  40. crypticorn/common/router/status_router.py +3 -26
  41. crypticorn/common/utils.py +6 -6
  42. crypticorn/common/warnings.py +1 -0
  43. crypticorn/dex/client/api/admin_api.py +3 -0
  44. crypticorn/dex/client/api/signals_api.py +27 -23
  45. crypticorn/dex/client/api/status_api.py +3 -0
  46. crypticorn/dex/client/api_client.py +5 -0
  47. crypticorn/dex/client/configuration.py +2 -2
  48. crypticorn/dex/client/models/exception_detail.py +1 -1
  49. crypticorn/dex/client/models/paginated_response_signal_with_token.py +1 -1
  50. crypticorn/dex/client/models/signal_overview_stats.py +4 -2
  51. crypticorn/dex/client/models/signal_volume.py +4 -4
  52. crypticorn/dex/client/models/signal_with_token.py +2 -2
  53. crypticorn/dex/client/models/token_detail.py +1 -1
  54. crypticorn/klines/main.py +1 -1
  55. crypticorn/metrics/main.py +1 -1
  56. crypticorn/trade/client/__init__.py +1 -7
  57. crypticorn/trade/client/api/admin_api.py +0 -402
  58. crypticorn/trade/client/api/trading_actions_api.py +86 -315
  59. crypticorn/trade/client/models/__init__.py +1 -7
  60. crypticorn/trade/client/models/actions_count.py +88 -0
  61. crypticorn/trade/client/models/api_error_identifier.py +1 -0
  62. crypticorn/trade/client/models/exchange_key.py +1 -1
  63. crypticorn/trade/client/models/exchange_key_balance.py +1 -1
  64. crypticorn/trade/client/models/execution_ids.py +1 -1
  65. crypticorn/trade/client/models/notification_create.py +1 -1
  66. crypticorn/trade/client/models/post_futures_action.py +1 -1
  67. crypticorn/trade/client/models/spot_balance.py +6 -7
  68. crypticorn/trade/client/models/tpsl.py +4 -19
  69. crypticorn/trade/client/models/tpsl_create.py +6 -19
  70. {crypticorn-2.17.0rc7.dist-info → crypticorn-2.18.0.dist-info}/METADATA +1 -1
  71. {crypticorn-2.17.0rc7.dist-info → crypticorn-2.18.0.dist-info}/RECORD +75 -77
  72. crypticorn/trade/client/models/paginated_response_union_futures_trading_action_spot_trading_action.py +0 -141
  73. crypticorn/trade/client/models/paginated_response_union_futures_trading_action_spot_trading_action_data_inner.py +0 -165
  74. crypticorn/trade/client/models/spot_trading_action.py +0 -207
  75. {crypticorn-2.17.0rc7.dist-info → crypticorn-2.18.0.dist-info}/WHEEL +0 -0
  76. {crypticorn-2.17.0rc7.dist-info → crypticorn-2.18.0.dist-info}/entry_points.txt +0 -0
  77. {crypticorn-2.17.0rc7.dist-info → crypticorn-2.18.0.dist-info}/licenses/LICENSE +0 -0
  78. {crypticorn-2.17.0rc7.dist-info → crypticorn-2.18.0.dist-info}/top_level.txt +0 -0
@@ -11,10 +11,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
  Do not edit the class manually.
12
12
  """ # noqa: E501
13
13
 
14
+ import warnings
14
15
  from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
15
16
  from typing import Any, Dict, List, Optional, Tuple, Union
16
17
  from typing_extensions import Annotated
17
18
 
19
+ from pydantic import StrictStr, field_validator
20
+ from typing import Optional
18
21
 
19
22
  from crypticorn.dex.client.api_client import ApiClient, RequestSerialized
20
23
  from crypticorn.dex.client.api_response import ApiResponse
@@ -33,6 +33,11 @@ from crypticorn.dex.client import rest
33
33
  from crypticorn.dex.client.exceptions import (
34
34
  ApiValueError,
35
35
  ApiException,
36
+ BadRequestException,
37
+ UnauthorizedException,
38
+ ForbiddenException,
39
+ NotFoundException,
40
+ ServiceException,
36
41
  )
37
42
 
38
43
  RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]]
@@ -215,7 +215,7 @@ class Configuration:
215
215
  debug: Optional[bool] = None,
216
216
  ) -> None:
217
217
  """Constructor"""
218
- self._base_path = "http://localhost/v1/dex" if host is None else host
218
+ self._base_path = "https://api.crypticorn.dev/v1/dex" if host is None else host
219
219
  """Default Base url
220
220
  """
221
221
  self.server_index = 0 if server_index is None and host is None else server_index
@@ -557,7 +557,7 @@ class Configuration:
557
557
  """
558
558
  return [
559
559
  {
560
- "url": "http://localhost/v1/dex",
560
+ "url": "https://api.crypticorn.dev/v1/dex",
561
561
  "description": "No description provided",
562
562
  }
563
563
  ]
@@ -22,7 +22,7 @@ from typing import Any, ClassVar, Dict, List, Optional
22
22
  from crypticorn.dex.client.models.api_error_identifier import ApiErrorIdentifier
23
23
  from crypticorn.dex.client.models.api_error_level import ApiErrorLevel
24
24
  from crypticorn.dex.client.models.api_error_type import ApiErrorType
25
- from typing import Set
25
+ from typing import Optional, Set
26
26
  from typing_extensions import Self
27
27
 
28
28
 
@@ -20,7 +20,7 @@ import json
20
20
  from pydantic import BaseModel, ConfigDict, Field, StrictInt
21
21
  from typing import Any, ClassVar, Dict, List, Optional
22
22
  from crypticorn.dex.client.models.signal_with_token import SignalWithToken
23
- from typing import Set
23
+ from typing import Optional, Set
24
24
  from typing_extensions import Self
25
25
 
26
26
 
@@ -19,7 +19,7 @@ import json
19
19
 
20
20
  from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
21
21
  from typing import Any, ClassVar, Dict, List, Optional, Union
22
- from typing import Set
22
+ from typing import Optional, Set
23
23
  from typing_extensions import Self
24
24
 
25
25
 
@@ -28,7 +28,9 @@ class SignalOverviewStats(BaseModel):
28
28
  Model for signal statistics response
29
29
  """ # noqa: E501
30
30
 
31
- timestamp: StrictInt = Field(description="The timestamp of the stats")
31
+ timestamp: StrictInt = Field(
32
+ description="The unix timestamp of the stats calculation"
33
+ )
32
34
  total: StrictInt = Field(description="Total number of tokens analyzed")
33
35
  win_rate: Union[StrictFloat, StrictInt] = Field(
34
36
  description="Overall win rate as a percentage"
@@ -17,7 +17,7 @@ import pprint
17
17
  import re # noqa: F401
18
18
  import json
19
19
 
20
- from pydantic import BaseModel, ConfigDict, StrictStr
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
21
  from typing import Any, ClassVar, Dict, List
22
22
  from typing import Optional, Set
23
23
  from typing_extensions import Self
@@ -25,11 +25,11 @@ from typing_extensions import Self
25
25
 
26
26
  class SignalVolume(BaseModel):
27
27
  """
28
- Model for the volume of the signal
28
+ Trading volume data for a signal over different time periods.
29
29
  """ # noqa: E501
30
30
 
31
- day: StrictStr
32
- hour: StrictStr
31
+ day: StrictStr = Field(description="24-hour trading volume")
32
+ hour: StrictStr = Field(description="1-hour trading volume")
33
33
  __properties: ClassVar[List[str]] = ["day", "hour"]
34
34
 
35
35
  model_config = ConfigDict(
@@ -21,13 +21,13 @@ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, Stric
21
21
  from typing import Any, ClassVar, Dict, List, Optional, Union
22
22
  from crypticorn.dex.client.models.signal_volume import SignalVolume
23
23
  from crypticorn.dex.client.models.token_data import TokenData
24
- from typing import Set
24
+ from typing import Optional, Set
25
25
  from typing_extensions import Self
26
26
 
27
27
 
28
28
  class SignalWithToken(BaseModel):
29
29
  """
30
- Model for the signal with the token info
30
+ Trading signal enriched with comprehensive token metadata and information.
31
31
  """ # noqa: E501
32
32
 
33
33
  ca: StrictStr = Field(description="The contract address of the token")
@@ -19,7 +19,7 @@ import json
19
19
 
20
20
  from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
21
  from typing import Any, ClassVar, Dict, List, Optional
22
- from typing import Set
22
+ from typing import Optional, Set
23
23
  from typing_extensions import Self
24
24
 
25
25
 
crypticorn/klines/main.py CHANGED
@@ -9,7 +9,7 @@ from crypticorn.klines import (
9
9
  SymbolsApi,
10
10
  UDFApi,
11
11
  )
12
- from crypticorn.common import optional_import
12
+ from crypticorn.common.utils import optional_import
13
13
 
14
14
  if TYPE_CHECKING:
15
15
  from aiohttp import ClientSession
@@ -1,6 +1,6 @@
1
1
  from __future__ import annotations
2
2
  from typing import TYPE_CHECKING, Optional, Union, Coroutine, Any
3
- from crypticorn.common import optional_import
3
+ from crypticorn.common.utils import optional_import
4
4
  from crypticorn.metrics import (
5
5
  ApiClient,
6
6
  Configuration,
@@ -39,6 +39,7 @@ from crypticorn.trade.client.exceptions import ApiAttributeError
39
39
  from crypticorn.trade.client.exceptions import ApiException
40
40
 
41
41
  # import models into sdk package
42
+ from crypticorn.trade.client.models.actions_count import ActionsCount
42
43
  from crypticorn.trade.client.models.api_error_identifier import ApiErrorIdentifier
43
44
  from crypticorn.trade.client.models.api_error_level import ApiErrorLevel
44
45
  from crypticorn.trade.client.models.api_error_type import ApiErrorType
@@ -73,16 +74,9 @@ from crypticorn.trade.client.models.paginated_response_futures_trading_action im
73
74
  from crypticorn.trade.client.models.paginated_response_order import (
74
75
  PaginatedResponseOrder,
75
76
  )
76
- from crypticorn.trade.client.models.paginated_response_union_futures_trading_action_spot_trading_action import (
77
- PaginatedResponseUnionFuturesTradingActionSpotTradingAction,
78
- )
79
- from crypticorn.trade.client.models.paginated_response_union_futures_trading_action_spot_trading_action_data_inner import (
80
- PaginatedResponseUnionFuturesTradingActionSpotTradingActionDataInner,
81
- )
82
77
  from crypticorn.trade.client.models.pn_l import PnL
83
78
  from crypticorn.trade.client.models.post_futures_action import PostFuturesAction
84
79
  from crypticorn.trade.client.models.spot_balance import SpotBalance
85
- from crypticorn.trade.client.models.spot_trading_action import SpotTradingAction
86
80
  from crypticorn.trade.client.models.spot_trading_action_create import (
87
81
  SpotTradingActionCreate,
88
82
  )
@@ -1747,408 +1747,6 @@ class AdminApi:
1747
1747
  _request_auth=_request_auth,
1748
1748
  )
1749
1749
 
1750
- @validate_call
1751
- def get_metrics(
1752
- self,
1753
- _request_timeout: Union[
1754
- None,
1755
- Annotated[StrictFloat, Field(gt=0)],
1756
- Tuple[
1757
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1758
- ],
1759
- ] = None,
1760
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1761
- _content_type: Optional[StrictStr] = None,
1762
- _headers: Optional[Dict[StrictStr, Any]] = None,
1763
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1764
- ) -> object:
1765
- """Metrics"""
1766
- if self.is_sync:
1767
- return self._get_metrics_sync(
1768
- _request_timeout=_request_timeout,
1769
- _request_auth=_request_auth,
1770
- _content_type=_content_type,
1771
- _headers=_headers,
1772
- _host_index=_host_index,
1773
- )
1774
-
1775
- else:
1776
- return self._get_metrics_async(
1777
- _request_timeout=_request_timeout,
1778
- _request_auth=_request_auth,
1779
- _content_type=_content_type,
1780
- _headers=_headers,
1781
- _host_index=_host_index,
1782
- )
1783
-
1784
- @validate_call
1785
- def get_metrics_with_http_info(
1786
- self,
1787
- _request_timeout: Union[
1788
- None,
1789
- Annotated[StrictFloat, Field(gt=0)],
1790
- Tuple[
1791
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1792
- ],
1793
- ] = None,
1794
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1795
- _content_type: Optional[StrictStr] = None,
1796
- _headers: Optional[Dict[StrictStr, Any]] = None,
1797
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1798
- ) -> ApiResponse[object]:
1799
- """Metrics with HTTP info"""
1800
- if self.is_sync:
1801
- return self._get_metrics_sync_with_http_info(
1802
- _request_timeout=_request_timeout,
1803
- _request_auth=_request_auth,
1804
- _content_type=_content_type,
1805
- _headers=_headers,
1806
- _host_index=_host_index,
1807
- )
1808
-
1809
- else:
1810
- return self._get_metrics_async_with_http_info(
1811
- _request_timeout=_request_timeout,
1812
- _request_auth=_request_auth,
1813
- _content_type=_content_type,
1814
- _headers=_headers,
1815
- _host_index=_host_index,
1816
- )
1817
-
1818
- @validate_call
1819
- def get_metrics_without_preload_content(
1820
- self,
1821
- _request_timeout: Union[
1822
- None,
1823
- Annotated[StrictFloat, Field(gt=0)],
1824
- Tuple[
1825
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1826
- ],
1827
- ] = None,
1828
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1829
- _content_type: Optional[StrictStr] = None,
1830
- _headers: Optional[Dict[StrictStr, Any]] = None,
1831
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1832
- ) -> RESTResponseType:
1833
- """Metrics without preloading content"""
1834
- if self.is_sync:
1835
- return self._get_metrics_sync_without_preload_content(
1836
- _request_timeout=_request_timeout,
1837
- _request_auth=_request_auth,
1838
- _content_type=_content_type,
1839
- _headers=_headers,
1840
- _host_index=_host_index,
1841
- )
1842
-
1843
- else:
1844
- return self._get_metrics_async_without_preload_content(
1845
- _request_timeout=_request_timeout,
1846
- _request_auth=_request_auth,
1847
- _content_type=_content_type,
1848
- _headers=_headers,
1849
- _host_index=_host_index,
1850
- )
1851
-
1852
- # Private async implementation methods
1853
- @validate_call
1854
- async def _get_metrics_async(
1855
- self,
1856
- _request_timeout: Union[
1857
- None,
1858
- Annotated[StrictFloat, Field(gt=0)],
1859
- Tuple[
1860
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1861
- ],
1862
- ] = None,
1863
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1864
- _content_type: Optional[StrictStr] = None,
1865
- _headers: Optional[Dict[StrictStr, Any]] = None,
1866
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1867
- ) -> object:
1868
- """Metrics
1869
-
1870
- Get Prometheus metrics for the application. Returns plain text.
1871
-
1872
- :param _request_timeout: timeout setting for this request. If one
1873
- number provided, it will be total request
1874
- timeout. It can also be a pair (tuple) of
1875
- (connection, read) timeouts.
1876
- :type _request_timeout: int, tuple(int, int), optional
1877
- :param _request_auth: set to override the auth_settings for an a single
1878
- request; this effectively ignores the
1879
- authentication in the spec for a single request.
1880
- :type _request_auth: dict, optional
1881
- :param _content_type: force content-type for the request.
1882
- :type _content_type: str, Optional
1883
- :param _headers: set to override the headers for a single
1884
- request; this effectively ignores the headers
1885
- in the spec for a single request.
1886
- :type _headers: dict, optional
1887
- :param _host_index: set to override the host_index for a single
1888
- request; this effectively ignores the host_index
1889
- in the spec for a single request.
1890
- :type _host_index: int, optional
1891
- :return: Returns the result object.
1892
- """ # noqa: E501
1893
-
1894
- _param = self._get_metrics_serialize(
1895
- _request_auth=_request_auth,
1896
- _content_type=_content_type,
1897
- _headers=_headers,
1898
- _host_index=_host_index,
1899
- )
1900
-
1901
- _response_types_map: Dict[str, Optional[str]] = {
1902
- "200": "object",
1903
- }
1904
- response_data = await self.api_client.call_api(
1905
- *_param, _request_timeout=_request_timeout
1906
- )
1907
- await response_data.read()
1908
- return self.api_client.response_deserialize(
1909
- response_data=response_data,
1910
- response_types_map=_response_types_map,
1911
- ).data
1912
-
1913
- @validate_call
1914
- async def _get_metrics_async_with_http_info(
1915
- self,
1916
- _request_timeout: Union[
1917
- None,
1918
- Annotated[StrictFloat, Field(gt=0)],
1919
- Tuple[
1920
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1921
- ],
1922
- ] = None,
1923
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1924
- _content_type: Optional[StrictStr] = None,
1925
- _headers: Optional[Dict[StrictStr, Any]] = None,
1926
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1927
- ) -> ApiResponse[object]:
1928
- """Metrics
1929
-
1930
- Get Prometheus metrics for the application. Returns plain text.
1931
-
1932
- :param _request_timeout: timeout setting for this request. If one
1933
- number provided, it will be total request
1934
- timeout. It can also be a pair (tuple) of
1935
- (connection, read) timeouts.
1936
- :type _request_timeout: int, tuple(int, int), optional
1937
- :param _request_auth: set to override the auth_settings for an a single
1938
- request; this effectively ignores the
1939
- authentication in the spec for a single request.
1940
- :type _request_auth: dict, optional
1941
- :param _content_type: force content-type for the request.
1942
- :type _content_type: str, Optional
1943
- :param _headers: set to override the headers for a single
1944
- request; this effectively ignores the headers
1945
- in the spec for a single request.
1946
- :type _headers: dict, optional
1947
- :param _host_index: set to override the host_index for a single
1948
- request; this effectively ignores the host_index
1949
- in the spec for a single request.
1950
- :type _host_index: int, optional
1951
- :return: Returns the result object.
1952
- """ # noqa: E501
1953
-
1954
- _param = self._get_metrics_serialize(
1955
- _request_auth=_request_auth,
1956
- _content_type=_content_type,
1957
- _headers=_headers,
1958
- _host_index=_host_index,
1959
- )
1960
-
1961
- _response_types_map: Dict[str, Optional[str]] = {
1962
- "200": "object",
1963
- }
1964
- response_data = await self.api_client.call_api(
1965
- *_param, _request_timeout=_request_timeout
1966
- )
1967
- await response_data.read()
1968
- return self.api_client.response_deserialize(
1969
- response_data=response_data, response_types_map=_response_types_map
1970
- )
1971
-
1972
- @validate_call
1973
- async def _get_metrics_async_without_preload_content(
1974
- self,
1975
- _request_timeout: Union[
1976
- None,
1977
- Annotated[StrictFloat, Field(gt=0)],
1978
- Tuple[
1979
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1980
- ],
1981
- ] = None,
1982
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1983
- _content_type: Optional[StrictStr] = None,
1984
- _headers: Optional[Dict[StrictStr, Any]] = None,
1985
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1986
- ) -> RESTResponseType:
1987
- """Metrics
1988
-
1989
- Get Prometheus metrics for the application. Returns plain text.
1990
-
1991
- :param _request_timeout: timeout setting for this request. If one
1992
- number provided, it will be total request
1993
- timeout. It can also be a pair (tuple) of
1994
- (connection, read) timeouts.
1995
- :type _request_timeout: int, tuple(int, int), optional
1996
- :param _request_auth: set to override the auth_settings for an a single
1997
- request; this effectively ignores the
1998
- authentication in the spec for a single request.
1999
- :type _request_auth: dict, optional
2000
- :param _content_type: force content-type for the request.
2001
- :type _content_type: str, Optional
2002
- :param _headers: set to override the headers for a single
2003
- request; this effectively ignores the headers
2004
- in the spec for a single request.
2005
- :type _headers: dict, optional
2006
- :param _host_index: set to override the host_index for a single
2007
- request; this effectively ignores the host_index
2008
- in the spec for a single request.
2009
- :type _host_index: int, optional
2010
- :return: Returns the result object.
2011
- """ # noqa: E501
2012
-
2013
- _param = self._get_metrics_serialize(
2014
- _request_auth=_request_auth,
2015
- _content_type=_content_type,
2016
- _headers=_headers,
2017
- _host_index=_host_index,
2018
- )
2019
-
2020
- _response_types_map: Dict[str, Optional[str]] = {
2021
- "200": "object",
2022
- }
2023
- response_data = await self.api_client.call_api(
2024
- *_param, _request_timeout=_request_timeout
2025
- )
2026
- return response_data
2027
-
2028
- # Private sync implementation methods
2029
- @validate_call
2030
- def _get_metrics_sync(
2031
- self,
2032
- _request_timeout: Union[
2033
- None,
2034
- Annotated[StrictFloat, Field(gt=0)],
2035
- Tuple[
2036
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2037
- ],
2038
- ] = None,
2039
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2040
- _content_type: Optional[StrictStr] = None,
2041
- _headers: Optional[Dict[StrictStr, Any]] = None,
2042
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2043
- ) -> object:
2044
- """Synchronous version of get_metrics"""
2045
- return async_to_sync(self._get_metrics_async)(
2046
- _request_timeout=_request_timeout,
2047
- _request_auth=_request_auth,
2048
- _content_type=_content_type,
2049
- _headers=_headers,
2050
- _host_index=_host_index,
2051
- )
2052
-
2053
- @validate_call
2054
- def _get_metrics_sync_with_http_info(
2055
- self,
2056
- _request_timeout: Union[
2057
- None,
2058
- Annotated[StrictFloat, Field(gt=0)],
2059
- Tuple[
2060
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2061
- ],
2062
- ] = None,
2063
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2064
- _content_type: Optional[StrictStr] = None,
2065
- _headers: Optional[Dict[StrictStr, Any]] = None,
2066
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2067
- ) -> ApiResponse[object]:
2068
- """Synchronous version of get_metrics_with_http_info"""
2069
- return async_to_sync(self._get_metrics_async_with_http_info)(
2070
- _request_timeout=_request_timeout,
2071
- _request_auth=_request_auth,
2072
- _content_type=_content_type,
2073
- _headers=_headers,
2074
- _host_index=_host_index,
2075
- )
2076
-
2077
- @validate_call
2078
- def _get_metrics_sync_without_preload_content(
2079
- self,
2080
- _request_timeout: Union[
2081
- None,
2082
- Annotated[StrictFloat, Field(gt=0)],
2083
- Tuple[
2084
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2085
- ],
2086
- ] = None,
2087
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2088
- _content_type: Optional[StrictStr] = None,
2089
- _headers: Optional[Dict[StrictStr, Any]] = None,
2090
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2091
- ) -> RESTResponseType:
2092
- """Synchronous version of get_metrics_without_preload_content"""
2093
- return async_to_sync(self._get_metrics_async_without_preload_content)(
2094
- _request_timeout=_request_timeout,
2095
- _request_auth=_request_auth,
2096
- _content_type=_content_type,
2097
- _headers=_headers,
2098
- _host_index=_host_index,
2099
- )
2100
-
2101
- def _get_metrics_serialize(
2102
- self,
2103
- _request_auth,
2104
- _content_type,
2105
- _headers,
2106
- _host_index,
2107
- ) -> RequestSerialized:
2108
-
2109
- _host = None
2110
-
2111
- _collection_formats: Dict[str, str] = {}
2112
-
2113
- _path_params: Dict[str, str] = {}
2114
- _query_params: List[Tuple[str, str]] = []
2115
- _header_params: Dict[str, Optional[str]] = _headers or {}
2116
- _form_params: List[Tuple[str, str]] = []
2117
- _files: Dict[
2118
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2119
- ] = {}
2120
- _body_params: Optional[bytes] = None
2121
-
2122
- # process the path parameters
2123
- # process the query parameters
2124
- # process the header parameters
2125
- # process the form parameters
2126
- # process the body parameter
2127
-
2128
- # set the HTTP header `Accept`
2129
- if "Accept" not in _header_params:
2130
- _header_params["Accept"] = self.api_client.select_header_accept(
2131
- ["application/json"]
2132
- )
2133
-
2134
- # authentication setting
2135
- _auth_settings: List[str] = ["APIKeyHeader", "HTTPBearer"]
2136
-
2137
- return self.api_client.param_serialize(
2138
- method="GET",
2139
- resource_path="/admin/metrics",
2140
- path_params=_path_params,
2141
- query_params=_query_params,
2142
- header_params=_header_params,
2143
- body=_body_params,
2144
- post_params=_form_params,
2145
- files=_files,
2146
- auth_settings=_auth_settings,
2147
- collection_formats=_collection_formats,
2148
- _host=_host,
2149
- _request_auth=_request_auth,
2150
- )
2151
-
2152
1750
  @validate_call
2153
1751
  def get_threads(
2154
1752
  self,