crypticorn 1.0.1__py3-none-any.whl → 1.0.2rc2__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 (132) hide show
  1. crypticorn/__init__.py +3 -3
  2. crypticorn/client.py +722 -0
  3. crypticorn/hive/__init__.py +1 -0
  4. crypticorn/{api.py → hive/main.py} +6 -6
  5. crypticorn/hive/requirements.txt +4 -0
  6. crypticorn/{utils.py → hive/utils.py} +2 -2
  7. crypticorn/klines/__init__.py +2 -0
  8. crypticorn/klines/client/__init__.py +62 -0
  9. crypticorn/klines/client/api/__init__.py +9 -0
  10. crypticorn/klines/client/api/funding_rates_api.py +362 -0
  11. crypticorn/klines/client/api/health_check_api.py +281 -0
  12. crypticorn/klines/client/api/ohlcv_data_api.py +409 -0
  13. crypticorn/klines/client/api/symbols_api.py +308 -0
  14. crypticorn/klines/client/api/udf_api.py +1929 -0
  15. crypticorn/klines/client/api_client.py +797 -0
  16. crypticorn/klines/client/api_response.py +21 -0
  17. crypticorn/klines/client/configuration.py +565 -0
  18. crypticorn/klines/client/exceptions.py +216 -0
  19. crypticorn/klines/client/models/__init__.py +41 -0
  20. crypticorn/klines/client/models/base_response_health_check_response.py +108 -0
  21. crypticorn/klines/client/models/base_response_list_funding_rate_response.py +112 -0
  22. crypticorn/klines/client/models/base_response_list_str.py +104 -0
  23. crypticorn/klines/client/models/base_response_ohlcv_response.py +108 -0
  24. crypticorn/klines/client/models/error_response.py +101 -0
  25. crypticorn/{models/deleted.py → klines/client/models/exchange.py} +15 -11
  26. crypticorn/klines/client/models/funding_rate_response.py +92 -0
  27. crypticorn/klines/client/models/health_check_response.py +89 -0
  28. crypticorn/{models/create_api_key_response.py → klines/client/models/history_error_response.py} +12 -22
  29. crypticorn/klines/client/models/history_no_data_response.py +99 -0
  30. crypticorn/klines/client/models/history_success_response.py +99 -0
  31. crypticorn/klines/client/models/http_validation_error.py +95 -0
  32. crypticorn/klines/client/models/market.py +37 -0
  33. crypticorn/klines/client/models/ohlcv_response.py +98 -0
  34. crypticorn/klines/client/models/resolution.py +40 -0
  35. crypticorn/klines/client/models/response_get_history_udf_history_get.py +149 -0
  36. crypticorn/klines/client/models/search_symbol_response.py +97 -0
  37. crypticorn/klines/client/models/sort_direction.py +37 -0
  38. crypticorn/{models/futures_balance_error.py → klines/client/models/symbol_group_response.py} +12 -14
  39. crypticorn/klines/client/models/symbol_info_response.py +115 -0
  40. crypticorn/{models/id.py → klines/client/models/symbol_type.py} +13 -11
  41. crypticorn/klines/client/models/timeframe.py +40 -0
  42. crypticorn/klines/client/models/udf_config_response.py +121 -0
  43. crypticorn/klines/client/models/validation_error.py +99 -0
  44. crypticorn/{models/get_futures_balance200_response_inner.py → klines/client/models/validation_error_loc_inner.py} +39 -35
  45. crypticorn/klines/client/py.typed +0 -0
  46. crypticorn/klines/client/rest.py +257 -0
  47. crypticorn/klines/main.py +42 -0
  48. crypticorn/klines/requirements.txt +4 -0
  49. crypticorn/klines/test/__init__.py +0 -0
  50. crypticorn/klines/test/test_base_response_health_check_response.py +56 -0
  51. crypticorn/klines/test/test_base_response_list_funding_rate_response.py +59 -0
  52. crypticorn/klines/test/test_base_response_list_str.py +56 -0
  53. crypticorn/klines/test/test_base_response_ohlcv_response.py +72 -0
  54. crypticorn/klines/test/test_error_response.py +57 -0
  55. crypticorn/klines/test/test_exchange.py +56 -0
  56. crypticorn/klines/test/test_funding_rate_response.py +56 -0
  57. crypticorn/klines/test/test_funding_rates_api.py +38 -0
  58. crypticorn/klines/test/test_health_check_api.py +38 -0
  59. crypticorn/klines/test/test_health_check_response.py +52 -0
  60. crypticorn/klines/test/test_history_error_response.py +53 -0
  61. crypticorn/klines/test/test_history_no_data_response.py +69 -0
  62. crypticorn/klines/test/test_history_success_response.py +87 -0
  63. crypticorn/klines/test/test_http_validation_error.py +58 -0
  64. crypticorn/klines/test/test_market.py +33 -0
  65. crypticorn/klines/test/test_ohlcv_data_api.py +38 -0
  66. crypticorn/klines/test/test_ohlcv_response.py +86 -0
  67. crypticorn/klines/test/test_resolution.py +33 -0
  68. crypticorn/klines/test/test_response_get_history_udf_history_get.py +89 -0
  69. crypticorn/klines/test/test_search_symbol_response.py +62 -0
  70. crypticorn/klines/test/test_sort_direction.py +33 -0
  71. crypticorn/klines/test/test_symbol_group_response.py +53 -0
  72. crypticorn/klines/test/test_symbol_info_response.py +84 -0
  73. crypticorn/klines/test/test_symbol_type.py +54 -0
  74. crypticorn/klines/test/test_symbols_api.py +38 -0
  75. crypticorn/klines/test/test_timeframe.py +33 -0
  76. crypticorn/klines/test/test_udf_api.py +80 -0
  77. crypticorn/klines/test/test_udf_config_response.py +95 -0
  78. crypticorn/klines/test/test_validation_error.py +60 -0
  79. crypticorn/klines/test/test_validation_error_loc_inner.py +50 -0
  80. crypticorn/trade/__init__.py +2 -0
  81. crypticorn/trade/client/__init__.py +63 -0
  82. crypticorn/trade/client/api/__init__.py +13 -0
  83. crypticorn/trade/client/api/api_keys_api.py +1468 -0
  84. crypticorn/trade/client/api/bots_api.py +1211 -0
  85. crypticorn/trade/client/api/exchanges_api.py +297 -0
  86. crypticorn/trade/client/api/futures_trading_panel_api.py +1463 -0
  87. crypticorn/trade/client/api/notifications_api.py +1767 -0
  88. crypticorn/trade/client/api/orders_api.py +331 -0
  89. crypticorn/trade/client/api/status_api.py +278 -0
  90. crypticorn/trade/client/api/strategies_api.py +331 -0
  91. crypticorn/trade/client/api/trading_actions_api.py +898 -0
  92. crypticorn/trade/client/api_client.py +797 -0
  93. crypticorn/trade/client/api_response.py +21 -0
  94. crypticorn/trade/client/configuration.py +574 -0
  95. crypticorn/trade/client/exceptions.py +216 -0
  96. crypticorn/trade/client/models/__init__.py +38 -0
  97. crypticorn/{models → trade/client/models}/action_model.py +17 -20
  98. crypticorn/{models → trade/client/models}/api_error_identifier.py +3 -1
  99. crypticorn/{models → trade/client/models}/api_key_model.py +5 -8
  100. crypticorn/{models → trade/client/models}/bot_model.py +15 -11
  101. crypticorn/{models → trade/client/models}/futures_trading_action.py +12 -12
  102. crypticorn/{models → trade/client/models}/http_validation_error.py +1 -1
  103. crypticorn/{models → trade/client/models}/notification_model.py +8 -6
  104. crypticorn/{models → trade/client/models}/order_model.py +12 -15
  105. crypticorn/{models → trade/client/models}/post_futures_action.py +1 -1
  106. crypticorn/{models → trade/client/models}/strategy_exchange_info.py +1 -1
  107. crypticorn/{models → trade/client/models}/strategy_model.py +6 -2
  108. crypticorn/{models → trade/client/models}/validation_error.py +1 -1
  109. crypticorn/trade/client/py.typed +0 -0
  110. crypticorn/trade/client/rest.py +257 -0
  111. crypticorn/trade/main.py +39 -0
  112. crypticorn/trade/requirements.txt +4 -0
  113. crypticorn-1.0.2rc2.dist-info/METADATA +47 -0
  114. crypticorn-1.0.2rc2.dist-info/RECORD +128 -0
  115. {crypticorn-1.0.1.dist-info → crypticorn-1.0.2rc2.dist-info}/WHEEL +1 -1
  116. crypticorn/models/__init__.py +0 -31
  117. crypticorn/models/modified.py +0 -87
  118. crypticorn-1.0.1.dist-info/METADATA +0 -40
  119. crypticorn-1.0.1.dist-info/RECORD +0 -38
  120. /crypticorn/{models → trade/client/models}/exchange.py +0 -0
  121. /crypticorn/{models → trade/client/models}/execution_ids.py +0 -0
  122. /crypticorn/{models → trade/client/models}/futures_balance.py +0 -0
  123. /crypticorn/{models → trade/client/models}/margin_mode.py +0 -0
  124. /crypticorn/{models → trade/client/models}/market_type.py +0 -0
  125. /crypticorn/{models → trade/client/models}/notification_type.py +0 -0
  126. /crypticorn/{models → trade/client/models}/order_status.py +0 -0
  127. /crypticorn/{models → trade/client/models}/tpsl.py +0 -0
  128. /crypticorn/{models → trade/client/models}/trading_action_type.py +0 -0
  129. /crypticorn/{models → trade/client/models}/update_notification.py +0 -0
  130. /crypticorn/{models → trade/client/models}/validation_error_loc_inner.py +0 -0
  131. {crypticorn-1.0.1.dist-info → crypticorn-1.0.2rc2.dist-info}/LICENSE.md +0 -0
  132. {crypticorn-1.0.1.dist-info → crypticorn-1.0.2rc2.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,1468 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ FastAPI
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ import warnings
15
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+ from typing_extensions import Annotated
18
+
19
+ from pydantic import StrictInt, StrictStr
20
+ from typing import Any, List, Optional
21
+ from crypticorn.trade.client.models.api_key_model import APIKeyModel
22
+
23
+ from crypticorn.trade.client.api_client import ApiClient, RequestSerialized
24
+ from crypticorn.trade.client.api_response import ApiResponse
25
+ from crypticorn.trade.client.rest import RESTResponseType
26
+
27
+
28
+ class APIKeysApi:
29
+ """NOTE: This class is auto generated by OpenAPI Generator
30
+ Ref: https://openapi-generator.tech
31
+
32
+ Do not edit the class manually.
33
+ """
34
+
35
+ def __init__(self, api_client=None) -> None:
36
+ if api_client is None:
37
+ api_client = ApiClient.get_default()
38
+ self.api_client = api_client
39
+
40
+
41
+ @validate_call
42
+ def create_api_key(
43
+ self,
44
+ api_key_model: APIKeyModel,
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)],
51
+ Annotated[StrictFloat, Field(gt=0)]
52
+ ]
53
+ ] = None,
54
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
55
+ _content_type: Optional[StrictStr] = None,
56
+ _headers: Optional[Dict[StrictStr, Any]] = None,
57
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
58
+ ) -> object:
59
+ """Post Api Key
60
+
61
+
62
+ :param api_key_model: (required)
63
+ :type api_key_model: APIKeyModel
64
+ :param access_token:
65
+ :type access_token: str
66
+ :param _request_timeout: timeout setting for this request. If one
67
+ number provided, it will be total request
68
+ timeout. It can also be a pair (tuple) of
69
+ (connection, read) timeouts.
70
+ :type _request_timeout: int, tuple(int, int), optional
71
+ :param _request_auth: set to override the auth_settings for an a single
72
+ request; this effectively ignores the
73
+ authentication in the spec for a single request.
74
+ :type _request_auth: dict, optional
75
+ :param _content_type: force content-type for the request.
76
+ :type _content_type: str, Optional
77
+ :param _headers: set to override the headers for a single
78
+ request; this effectively ignores the headers
79
+ in the spec for a single request.
80
+ :type _headers: dict, optional
81
+ :param _host_index: set to override the host_index for a single
82
+ request; this effectively ignores the host_index
83
+ in the spec for a single request.
84
+ :type _host_index: int, optional
85
+ :return: Returns the result object.
86
+ """ # noqa: E501
87
+
88
+ _param = self._create_api_key_serialize(
89
+ api_key_model=api_key_model,
90
+ access_token=access_token,
91
+ _request_auth=_request_auth,
92
+ _content_type=_content_type,
93
+ _headers=_headers,
94
+ _host_index=_host_index
95
+ )
96
+
97
+ _response_types_map: Dict[str, Optional[str]] = {
98
+ '200': "object",
99
+ '422': "HTTPValidationError",
100
+ }
101
+ response_data = self.api_client.call_api(
102
+ *_param,
103
+ _request_timeout=_request_timeout
104
+ )
105
+ response_data.read()
106
+ return self.api_client.response_deserialize(
107
+ response_data=response_data,
108
+ response_types_map=_response_types_map,
109
+ ).data
110
+
111
+
112
+ @validate_call
113
+ def create_api_key_with_http_info(
114
+ self,
115
+ api_key_model: APIKeyModel,
116
+ access_token: Optional[StrictStr] = None,
117
+ _request_timeout: Union[
118
+ None,
119
+ Annotated[StrictFloat, Field(gt=0)],
120
+ Tuple[
121
+ Annotated[StrictFloat, Field(gt=0)],
122
+ Annotated[StrictFloat, Field(gt=0)]
123
+ ]
124
+ ] = None,
125
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
126
+ _content_type: Optional[StrictStr] = None,
127
+ _headers: Optional[Dict[StrictStr, Any]] = None,
128
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
129
+ ) -> ApiResponse[object]:
130
+ """Post Api Key
131
+
132
+
133
+ :param api_key_model: (required)
134
+ :type api_key_model: APIKeyModel
135
+ :param access_token:
136
+ :type access_token: str
137
+ :param _request_timeout: timeout setting for this request. If one
138
+ number provided, it will be total request
139
+ timeout. It can also be a pair (tuple) of
140
+ (connection, read) timeouts.
141
+ :type _request_timeout: int, tuple(int, int), optional
142
+ :param _request_auth: set to override the auth_settings for an a single
143
+ request; this effectively ignores the
144
+ authentication in the spec for a single request.
145
+ :type _request_auth: dict, optional
146
+ :param _content_type: force content-type for the request.
147
+ :type _content_type: str, Optional
148
+ :param _headers: set to override the headers for a single
149
+ request; this effectively ignores the headers
150
+ in the spec for a single request.
151
+ :type _headers: dict, optional
152
+ :param _host_index: set to override the host_index for a single
153
+ request; this effectively ignores the host_index
154
+ in the spec for a single request.
155
+ :type _host_index: int, optional
156
+ :return: Returns the result object.
157
+ """ # noqa: E501
158
+
159
+ _param = self._create_api_key_serialize(
160
+ api_key_model=api_key_model,
161
+ access_token=access_token,
162
+ _request_auth=_request_auth,
163
+ _content_type=_content_type,
164
+ _headers=_headers,
165
+ _host_index=_host_index
166
+ )
167
+
168
+ _response_types_map: Dict[str, Optional[str]] = {
169
+ '200': "object",
170
+ '422': "HTTPValidationError",
171
+ }
172
+ response_data = self.api_client.call_api(
173
+ *_param,
174
+ _request_timeout=_request_timeout
175
+ )
176
+ response_data.read()
177
+ return self.api_client.response_deserialize(
178
+ response_data=response_data,
179
+ response_types_map=_response_types_map,
180
+ )
181
+
182
+
183
+ @validate_call
184
+ def create_api_key_without_preload_content(
185
+ self,
186
+ api_key_model: APIKeyModel,
187
+ access_token: Optional[StrictStr] = None,
188
+ _request_timeout: Union[
189
+ None,
190
+ Annotated[StrictFloat, Field(gt=0)],
191
+ Tuple[
192
+ Annotated[StrictFloat, Field(gt=0)],
193
+ Annotated[StrictFloat, Field(gt=0)]
194
+ ]
195
+ ] = None,
196
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
197
+ _content_type: Optional[StrictStr] = None,
198
+ _headers: Optional[Dict[StrictStr, Any]] = None,
199
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
200
+ ) -> RESTResponseType:
201
+ """Post Api Key
202
+
203
+
204
+ :param api_key_model: (required)
205
+ :type api_key_model: APIKeyModel
206
+ :param access_token:
207
+ :type access_token: str
208
+ :param _request_timeout: timeout setting for this request. If one
209
+ number provided, it will be total request
210
+ timeout. It can also be a pair (tuple) of
211
+ (connection, read) timeouts.
212
+ :type _request_timeout: int, tuple(int, int), optional
213
+ :param _request_auth: set to override the auth_settings for an a single
214
+ request; this effectively ignores the
215
+ authentication in the spec for a single request.
216
+ :type _request_auth: dict, optional
217
+ :param _content_type: force content-type for the request.
218
+ :type _content_type: str, Optional
219
+ :param _headers: set to override the headers for a single
220
+ request; this effectively ignores the headers
221
+ in the spec for a single request.
222
+ :type _headers: dict, optional
223
+ :param _host_index: set to override the host_index for a single
224
+ request; this effectively ignores the host_index
225
+ in the spec for a single request.
226
+ :type _host_index: int, optional
227
+ :return: Returns the result object.
228
+ """ # noqa: E501
229
+
230
+ _param = self._create_api_key_serialize(
231
+ api_key_model=api_key_model,
232
+ access_token=access_token,
233
+ _request_auth=_request_auth,
234
+ _content_type=_content_type,
235
+ _headers=_headers,
236
+ _host_index=_host_index
237
+ )
238
+
239
+ _response_types_map: Dict[str, Optional[str]] = {
240
+ '200': "object",
241
+ '422': "HTTPValidationError",
242
+ }
243
+ response_data = self.api_client.call_api(
244
+ *_param,
245
+ _request_timeout=_request_timeout
246
+ )
247
+ return response_data.response
248
+
249
+
250
+ def _create_api_key_serialize(
251
+ self,
252
+ api_key_model,
253
+ access_token,
254
+ _request_auth,
255
+ _content_type,
256
+ _headers,
257
+ _host_index,
258
+ ) -> RequestSerialized:
259
+
260
+ _host = None
261
+
262
+ _collection_formats: Dict[str, str] = {
263
+ }
264
+
265
+ _path_params: Dict[str, str] = {}
266
+ _query_params: List[Tuple[str, str]] = []
267
+ _header_params: Dict[str, Optional[str]] = _headers or {}
268
+ _form_params: List[Tuple[str, str]] = []
269
+ _files: Dict[
270
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
271
+ ] = {}
272
+ _body_params: Optional[bytes] = None
273
+
274
+ # process the path parameters
275
+ # process the query parameters
276
+ # process the header parameters
277
+ # process the form parameters
278
+ # process the body parameter
279
+ if api_key_model is not None:
280
+ _body_params = api_key_model
281
+
282
+
283
+ # set the HTTP header `Accept`
284
+ if 'Accept' not in _header_params:
285
+ _header_params['Accept'] = self.api_client.select_header_accept(
286
+ [
287
+ 'application/json'
288
+ ]
289
+ )
290
+
291
+ # set the HTTP header `Content-Type`
292
+ if _content_type:
293
+ _header_params['Content-Type'] = _content_type
294
+ else:
295
+ _default_content_type = (
296
+ self.api_client.select_header_content_type(
297
+ [
298
+ 'application/json'
299
+ ]
300
+ )
301
+ )
302
+ if _default_content_type is not None:
303
+ _header_params['Content-Type'] = _default_content_type
304
+
305
+ # authentication setting
306
+ _auth_settings: List[str] = [
307
+ 'OAuth2PasswordBearer'
308
+ ]
309
+
310
+ return self.api_client.param_serialize(
311
+ method='POST',
312
+ resource_path='/api-keys',
313
+ path_params=_path_params,
314
+ query_params=_query_params,
315
+ header_params=_header_params,
316
+ body=_body_params,
317
+ post_params=_form_params,
318
+ files=_files,
319
+ auth_settings=_auth_settings,
320
+ collection_formats=_collection_formats,
321
+ _host=_host,
322
+ _request_auth=_request_auth
323
+ )
324
+
325
+
326
+
327
+
328
+ @validate_call
329
+ def delete_api_key(
330
+ self,
331
+ id: StrictStr,
332
+ access_token: Optional[StrictStr] = None,
333
+ _request_timeout: Union[
334
+ None,
335
+ Annotated[StrictFloat, Field(gt=0)],
336
+ Tuple[
337
+ Annotated[StrictFloat, Field(gt=0)],
338
+ Annotated[StrictFloat, Field(gt=0)]
339
+ ]
340
+ ] = None,
341
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
342
+ _content_type: Optional[StrictStr] = None,
343
+ _headers: Optional[Dict[StrictStr, Any]] = None,
344
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
345
+ ) -> object:
346
+ """Delete Api Key
347
+
348
+
349
+ :param id: (required)
350
+ :type id: str
351
+ :param access_token:
352
+ :type access_token: str
353
+ :param _request_timeout: timeout setting for this request. If one
354
+ number provided, it will be total request
355
+ timeout. It can also be a pair (tuple) of
356
+ (connection, read) timeouts.
357
+ :type _request_timeout: int, tuple(int, int), optional
358
+ :param _request_auth: set to override the auth_settings for an a single
359
+ request; this effectively ignores the
360
+ authentication in the spec for a single request.
361
+ :type _request_auth: dict, optional
362
+ :param _content_type: force content-type for the request.
363
+ :type _content_type: str, Optional
364
+ :param _headers: set to override the headers for a single
365
+ request; this effectively ignores the headers
366
+ in the spec for a single request.
367
+ :type _headers: dict, optional
368
+ :param _host_index: set to override the host_index for a single
369
+ request; this effectively ignores the host_index
370
+ in the spec for a single request.
371
+ :type _host_index: int, optional
372
+ :return: Returns the result object.
373
+ """ # noqa: E501
374
+
375
+ _param = self._delete_api_key_serialize(
376
+ id=id,
377
+ access_token=access_token,
378
+ _request_auth=_request_auth,
379
+ _content_type=_content_type,
380
+ _headers=_headers,
381
+ _host_index=_host_index
382
+ )
383
+
384
+ _response_types_map: Dict[str, Optional[str]] = {
385
+ '200': "object",
386
+ '422': "HTTPValidationError",
387
+ }
388
+ response_data = self.api_client.call_api(
389
+ *_param,
390
+ _request_timeout=_request_timeout
391
+ )
392
+ response_data.read()
393
+ return self.api_client.response_deserialize(
394
+ response_data=response_data,
395
+ response_types_map=_response_types_map,
396
+ ).data
397
+
398
+
399
+ @validate_call
400
+ def delete_api_key_with_http_info(
401
+ self,
402
+ id: StrictStr,
403
+ access_token: Optional[StrictStr] = None,
404
+ _request_timeout: Union[
405
+ None,
406
+ Annotated[StrictFloat, Field(gt=0)],
407
+ Tuple[
408
+ Annotated[StrictFloat, Field(gt=0)],
409
+ Annotated[StrictFloat, Field(gt=0)]
410
+ ]
411
+ ] = None,
412
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
413
+ _content_type: Optional[StrictStr] = None,
414
+ _headers: Optional[Dict[StrictStr, Any]] = None,
415
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
416
+ ) -> ApiResponse[object]:
417
+ """Delete Api Key
418
+
419
+
420
+ :param id: (required)
421
+ :type id: str
422
+ :param access_token:
423
+ :type access_token: str
424
+ :param _request_timeout: timeout setting for this request. If one
425
+ number provided, it will be total request
426
+ timeout. It can also be a pair (tuple) of
427
+ (connection, read) timeouts.
428
+ :type _request_timeout: int, tuple(int, int), optional
429
+ :param _request_auth: set to override the auth_settings for an a single
430
+ request; this effectively ignores the
431
+ authentication in the spec for a single request.
432
+ :type _request_auth: dict, optional
433
+ :param _content_type: force content-type for the request.
434
+ :type _content_type: str, Optional
435
+ :param _headers: set to override the headers for a single
436
+ request; this effectively ignores the headers
437
+ in the spec for a single request.
438
+ :type _headers: dict, optional
439
+ :param _host_index: set to override the host_index for a single
440
+ request; this effectively ignores the host_index
441
+ in the spec for a single request.
442
+ :type _host_index: int, optional
443
+ :return: Returns the result object.
444
+ """ # noqa: E501
445
+
446
+ _param = self._delete_api_key_serialize(
447
+ id=id,
448
+ access_token=access_token,
449
+ _request_auth=_request_auth,
450
+ _content_type=_content_type,
451
+ _headers=_headers,
452
+ _host_index=_host_index
453
+ )
454
+
455
+ _response_types_map: Dict[str, Optional[str]] = {
456
+ '200': "object",
457
+ '422': "HTTPValidationError",
458
+ }
459
+ response_data = self.api_client.call_api(
460
+ *_param,
461
+ _request_timeout=_request_timeout
462
+ )
463
+ response_data.read()
464
+ return self.api_client.response_deserialize(
465
+ response_data=response_data,
466
+ response_types_map=_response_types_map,
467
+ )
468
+
469
+
470
+ @validate_call
471
+ def delete_api_key_without_preload_content(
472
+ self,
473
+ id: StrictStr,
474
+ access_token: Optional[StrictStr] = None,
475
+ _request_timeout: Union[
476
+ None,
477
+ Annotated[StrictFloat, Field(gt=0)],
478
+ Tuple[
479
+ Annotated[StrictFloat, Field(gt=0)],
480
+ Annotated[StrictFloat, Field(gt=0)]
481
+ ]
482
+ ] = None,
483
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
484
+ _content_type: Optional[StrictStr] = None,
485
+ _headers: Optional[Dict[StrictStr, Any]] = None,
486
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
487
+ ) -> RESTResponseType:
488
+ """Delete Api Key
489
+
490
+
491
+ :param id: (required)
492
+ :type id: str
493
+ :param access_token:
494
+ :type access_token: str
495
+ :param _request_timeout: timeout setting for this request. If one
496
+ number provided, it will be total request
497
+ timeout. It can also be a pair (tuple) of
498
+ (connection, read) timeouts.
499
+ :type _request_timeout: int, tuple(int, int), optional
500
+ :param _request_auth: set to override the auth_settings for an a single
501
+ request; this effectively ignores the
502
+ authentication in the spec for a single request.
503
+ :type _request_auth: dict, optional
504
+ :param _content_type: force content-type for the request.
505
+ :type _content_type: str, Optional
506
+ :param _headers: set to override the headers for a single
507
+ request; this effectively ignores the headers
508
+ in the spec for a single request.
509
+ :type _headers: dict, optional
510
+ :param _host_index: set to override the host_index for a single
511
+ request; this effectively ignores the host_index
512
+ in the spec for a single request.
513
+ :type _host_index: int, optional
514
+ :return: Returns the result object.
515
+ """ # noqa: E501
516
+
517
+ _param = self._delete_api_key_serialize(
518
+ id=id,
519
+ access_token=access_token,
520
+ _request_auth=_request_auth,
521
+ _content_type=_content_type,
522
+ _headers=_headers,
523
+ _host_index=_host_index
524
+ )
525
+
526
+ _response_types_map: Dict[str, Optional[str]] = {
527
+ '200': "object",
528
+ '422': "HTTPValidationError",
529
+ }
530
+ response_data = self.api_client.call_api(
531
+ *_param,
532
+ _request_timeout=_request_timeout
533
+ )
534
+ return response_data.response
535
+
536
+
537
+ def _delete_api_key_serialize(
538
+ self,
539
+ id,
540
+ access_token,
541
+ _request_auth,
542
+ _content_type,
543
+ _headers,
544
+ _host_index,
545
+ ) -> RequestSerialized:
546
+
547
+ _host = None
548
+
549
+ _collection_formats: Dict[str, str] = {
550
+ }
551
+
552
+ _path_params: Dict[str, str] = {}
553
+ _query_params: List[Tuple[str, str]] = []
554
+ _header_params: Dict[str, Optional[str]] = _headers or {}
555
+ _form_params: List[Tuple[str, str]] = []
556
+ _files: Dict[
557
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
558
+ ] = {}
559
+ _body_params: Optional[bytes] = None
560
+
561
+ # process the path parameters
562
+ if id is not None:
563
+ _path_params['id'] = id
564
+ # process the query parameters
565
+ # process the header parameters
566
+ # process the form parameters
567
+ # process the body parameter
568
+
569
+
570
+ # set the HTTP header `Accept`
571
+ if 'Accept' not in _header_params:
572
+ _header_params['Accept'] = self.api_client.select_header_accept(
573
+ [
574
+ 'application/json'
575
+ ]
576
+ )
577
+
578
+
579
+ # authentication setting
580
+ _auth_settings: List[str] = [
581
+ 'OAuth2PasswordBearer'
582
+ ]
583
+
584
+ return self.api_client.param_serialize(
585
+ method='DELETE',
586
+ resource_path='/api-keys/{id}',
587
+ path_params=_path_params,
588
+ query_params=_query_params,
589
+ header_params=_header_params,
590
+ body=_body_params,
591
+ post_params=_form_params,
592
+ files=_files,
593
+ auth_settings=_auth_settings,
594
+ collection_formats=_collection_formats,
595
+ _host=_host,
596
+ _request_auth=_request_auth
597
+ )
598
+
599
+
600
+
601
+
602
+ @validate_call
603
+ def get_api_key_by_id(
604
+ self,
605
+ id: StrictStr,
606
+ access_token: Optional[StrictStr] = None,
607
+ _request_timeout: Union[
608
+ None,
609
+ Annotated[StrictFloat, Field(gt=0)],
610
+ Tuple[
611
+ Annotated[StrictFloat, Field(gt=0)],
612
+ Annotated[StrictFloat, Field(gt=0)]
613
+ ]
614
+ ] = None,
615
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
616
+ _content_type: Optional[StrictStr] = None,
617
+ _headers: Optional[Dict[StrictStr, Any]] = None,
618
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
619
+ ) -> APIKeyModel:
620
+ """Get Api Key By Id
621
+
622
+
623
+ :param id: (required)
624
+ :type id: str
625
+ :param access_token:
626
+ :type access_token: str
627
+ :param _request_timeout: timeout setting for this request. If one
628
+ number provided, it will be total request
629
+ timeout. It can also be a pair (tuple) of
630
+ (connection, read) timeouts.
631
+ :type _request_timeout: int, tuple(int, int), optional
632
+ :param _request_auth: set to override the auth_settings for an a single
633
+ request; this effectively ignores the
634
+ authentication in the spec for a single request.
635
+ :type _request_auth: dict, optional
636
+ :param _content_type: force content-type for the request.
637
+ :type _content_type: str, Optional
638
+ :param _headers: set to override the headers for a single
639
+ request; this effectively ignores the headers
640
+ in the spec for a single request.
641
+ :type _headers: dict, optional
642
+ :param _host_index: set to override the host_index for a single
643
+ request; this effectively ignores the host_index
644
+ in the spec for a single request.
645
+ :type _host_index: int, optional
646
+ :return: Returns the result object.
647
+ """ # noqa: E501
648
+
649
+ _param = self._get_api_key_by_id_serialize(
650
+ id=id,
651
+ access_token=access_token,
652
+ _request_auth=_request_auth,
653
+ _content_type=_content_type,
654
+ _headers=_headers,
655
+ _host_index=_host_index
656
+ )
657
+
658
+ _response_types_map: Dict[str, Optional[str]] = {
659
+ '200': "APIKeyModel",
660
+ '422': "HTTPValidationError",
661
+ }
662
+ response_data = self.api_client.call_api(
663
+ *_param,
664
+ _request_timeout=_request_timeout
665
+ )
666
+ response_data.read()
667
+ return self.api_client.response_deserialize(
668
+ response_data=response_data,
669
+ response_types_map=_response_types_map,
670
+ ).data
671
+
672
+
673
+ @validate_call
674
+ def get_api_key_by_id_with_http_info(
675
+ self,
676
+ id: StrictStr,
677
+ access_token: Optional[StrictStr] = None,
678
+ _request_timeout: Union[
679
+ None,
680
+ Annotated[StrictFloat, Field(gt=0)],
681
+ Tuple[
682
+ Annotated[StrictFloat, Field(gt=0)],
683
+ Annotated[StrictFloat, Field(gt=0)]
684
+ ]
685
+ ] = None,
686
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
687
+ _content_type: Optional[StrictStr] = None,
688
+ _headers: Optional[Dict[StrictStr, Any]] = None,
689
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
690
+ ) -> ApiResponse[APIKeyModel]:
691
+ """Get Api Key By Id
692
+
693
+
694
+ :param id: (required)
695
+ :type id: str
696
+ :param access_token:
697
+ :type access_token: str
698
+ :param _request_timeout: timeout setting for this request. If one
699
+ number provided, it will be total request
700
+ timeout. It can also be a pair (tuple) of
701
+ (connection, read) timeouts.
702
+ :type _request_timeout: int, tuple(int, int), optional
703
+ :param _request_auth: set to override the auth_settings for an a single
704
+ request; this effectively ignores the
705
+ authentication in the spec for a single request.
706
+ :type _request_auth: dict, optional
707
+ :param _content_type: force content-type for the request.
708
+ :type _content_type: str, Optional
709
+ :param _headers: set to override the headers for a single
710
+ request; this effectively ignores the headers
711
+ in the spec for a single request.
712
+ :type _headers: dict, optional
713
+ :param _host_index: set to override the host_index for a single
714
+ request; this effectively ignores the host_index
715
+ in the spec for a single request.
716
+ :type _host_index: int, optional
717
+ :return: Returns the result object.
718
+ """ # noqa: E501
719
+
720
+ _param = self._get_api_key_by_id_serialize(
721
+ id=id,
722
+ access_token=access_token,
723
+ _request_auth=_request_auth,
724
+ _content_type=_content_type,
725
+ _headers=_headers,
726
+ _host_index=_host_index
727
+ )
728
+
729
+ _response_types_map: Dict[str, Optional[str]] = {
730
+ '200': "APIKeyModel",
731
+ '422': "HTTPValidationError",
732
+ }
733
+ response_data = self.api_client.call_api(
734
+ *_param,
735
+ _request_timeout=_request_timeout
736
+ )
737
+ response_data.read()
738
+ return self.api_client.response_deserialize(
739
+ response_data=response_data,
740
+ response_types_map=_response_types_map,
741
+ )
742
+
743
+
744
+ @validate_call
745
+ def get_api_key_by_id_without_preload_content(
746
+ self,
747
+ id: StrictStr,
748
+ access_token: Optional[StrictStr] = None,
749
+ _request_timeout: Union[
750
+ None,
751
+ Annotated[StrictFloat, Field(gt=0)],
752
+ Tuple[
753
+ Annotated[StrictFloat, Field(gt=0)],
754
+ Annotated[StrictFloat, Field(gt=0)]
755
+ ]
756
+ ] = None,
757
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
758
+ _content_type: Optional[StrictStr] = None,
759
+ _headers: Optional[Dict[StrictStr, Any]] = None,
760
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
761
+ ) -> RESTResponseType:
762
+ """Get Api Key By Id
763
+
764
+
765
+ :param id: (required)
766
+ :type id: str
767
+ :param access_token:
768
+ :type access_token: str
769
+ :param _request_timeout: timeout setting for this request. If one
770
+ number provided, it will be total request
771
+ timeout. It can also be a pair (tuple) of
772
+ (connection, read) timeouts.
773
+ :type _request_timeout: int, tuple(int, int), optional
774
+ :param _request_auth: set to override the auth_settings for an a single
775
+ request; this effectively ignores the
776
+ authentication in the spec for a single request.
777
+ :type _request_auth: dict, optional
778
+ :param _content_type: force content-type for the request.
779
+ :type _content_type: str, Optional
780
+ :param _headers: set to override the headers for a single
781
+ request; this effectively ignores the headers
782
+ in the spec for a single request.
783
+ :type _headers: dict, optional
784
+ :param _host_index: set to override the host_index for a single
785
+ request; this effectively ignores the host_index
786
+ in the spec for a single request.
787
+ :type _host_index: int, optional
788
+ :return: Returns the result object.
789
+ """ # noqa: E501
790
+
791
+ _param = self._get_api_key_by_id_serialize(
792
+ id=id,
793
+ access_token=access_token,
794
+ _request_auth=_request_auth,
795
+ _content_type=_content_type,
796
+ _headers=_headers,
797
+ _host_index=_host_index
798
+ )
799
+
800
+ _response_types_map: Dict[str, Optional[str]] = {
801
+ '200': "APIKeyModel",
802
+ '422': "HTTPValidationError",
803
+ }
804
+ response_data = self.api_client.call_api(
805
+ *_param,
806
+ _request_timeout=_request_timeout
807
+ )
808
+ return response_data.response
809
+
810
+
811
+ def _get_api_key_by_id_serialize(
812
+ self,
813
+ id,
814
+ access_token,
815
+ _request_auth,
816
+ _content_type,
817
+ _headers,
818
+ _host_index,
819
+ ) -> RequestSerialized:
820
+
821
+ _host = None
822
+
823
+ _collection_formats: Dict[str, str] = {
824
+ }
825
+
826
+ _path_params: Dict[str, str] = {}
827
+ _query_params: List[Tuple[str, str]] = []
828
+ _header_params: Dict[str, Optional[str]] = _headers or {}
829
+ _form_params: List[Tuple[str, str]] = []
830
+ _files: Dict[
831
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
832
+ ] = {}
833
+ _body_params: Optional[bytes] = None
834
+
835
+ # process the path parameters
836
+ if id is not None:
837
+ _path_params['id'] = id
838
+ # process the query parameters
839
+ # process the header parameters
840
+ # process the form parameters
841
+ # process the body parameter
842
+
843
+
844
+ # set the HTTP header `Accept`
845
+ if 'Accept' not in _header_params:
846
+ _header_params['Accept'] = self.api_client.select_header_accept(
847
+ [
848
+ 'application/json'
849
+ ]
850
+ )
851
+
852
+
853
+ # authentication setting
854
+ _auth_settings: List[str] = [
855
+ 'OAuth2PasswordBearer'
856
+ ]
857
+
858
+ return self.api_client.param_serialize(
859
+ method='GET',
860
+ resource_path='/api-keys/{id}',
861
+ path_params=_path_params,
862
+ query_params=_query_params,
863
+ header_params=_header_params,
864
+ body=_body_params,
865
+ post_params=_form_params,
866
+ files=_files,
867
+ auth_settings=_auth_settings,
868
+ collection_formats=_collection_formats,
869
+ _host=_host,
870
+ _request_auth=_request_auth
871
+ )
872
+
873
+
874
+
875
+
876
+ @validate_call
877
+ def get_api_keys(
878
+ self,
879
+ limit: Optional[StrictInt] = None,
880
+ offset: Optional[StrictInt] = None,
881
+ access_token: Optional[StrictStr] = None,
882
+ _request_timeout: Union[
883
+ None,
884
+ Annotated[StrictFloat, Field(gt=0)],
885
+ Tuple[
886
+ Annotated[StrictFloat, Field(gt=0)],
887
+ Annotated[StrictFloat, Field(gt=0)]
888
+ ]
889
+ ] = None,
890
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
891
+ _content_type: Optional[StrictStr] = None,
892
+ _headers: Optional[Dict[StrictStr, Any]] = None,
893
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
894
+ ) -> List[APIKeyModel]:
895
+ """Get Api Keys
896
+
897
+
898
+ :param limit:
899
+ :type limit: int
900
+ :param offset:
901
+ :type offset: int
902
+ :param access_token:
903
+ :type access_token: str
904
+ :param _request_timeout: timeout setting for this request. If one
905
+ number provided, it will be total request
906
+ timeout. It can also be a pair (tuple) of
907
+ (connection, read) timeouts.
908
+ :type _request_timeout: int, tuple(int, int), optional
909
+ :param _request_auth: set to override the auth_settings for an a single
910
+ request; this effectively ignores the
911
+ authentication in the spec for a single request.
912
+ :type _request_auth: dict, optional
913
+ :param _content_type: force content-type for the request.
914
+ :type _content_type: str, Optional
915
+ :param _headers: set to override the headers for a single
916
+ request; this effectively ignores the headers
917
+ in the spec for a single request.
918
+ :type _headers: dict, optional
919
+ :param _host_index: set to override the host_index for a single
920
+ request; this effectively ignores the host_index
921
+ in the spec for a single request.
922
+ :type _host_index: int, optional
923
+ :return: Returns the result object.
924
+ """ # noqa: E501
925
+
926
+ _param = self._get_api_keys_serialize(
927
+ limit=limit,
928
+ offset=offset,
929
+ access_token=access_token,
930
+ _request_auth=_request_auth,
931
+ _content_type=_content_type,
932
+ _headers=_headers,
933
+ _host_index=_host_index
934
+ )
935
+
936
+ _response_types_map: Dict[str, Optional[str]] = {
937
+ '200': "List[APIKeyModel]",
938
+ '422': "HTTPValidationError",
939
+ }
940
+ response_data = self.api_client.call_api(
941
+ *_param,
942
+ _request_timeout=_request_timeout
943
+ )
944
+ response_data.read()
945
+ return self.api_client.response_deserialize(
946
+ response_data=response_data,
947
+ response_types_map=_response_types_map,
948
+ ).data
949
+
950
+
951
+ @validate_call
952
+ def get_api_keys_with_http_info(
953
+ self,
954
+ limit: Optional[StrictInt] = None,
955
+ offset: Optional[StrictInt] = None,
956
+ access_token: Optional[StrictStr] = None,
957
+ _request_timeout: Union[
958
+ None,
959
+ Annotated[StrictFloat, Field(gt=0)],
960
+ Tuple[
961
+ Annotated[StrictFloat, Field(gt=0)],
962
+ Annotated[StrictFloat, Field(gt=0)]
963
+ ]
964
+ ] = None,
965
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
966
+ _content_type: Optional[StrictStr] = None,
967
+ _headers: Optional[Dict[StrictStr, Any]] = None,
968
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
969
+ ) -> ApiResponse[List[APIKeyModel]]:
970
+ """Get Api Keys
971
+
972
+
973
+ :param limit:
974
+ :type limit: int
975
+ :param offset:
976
+ :type offset: int
977
+ :param access_token:
978
+ :type access_token: str
979
+ :param _request_timeout: timeout setting for this request. If one
980
+ number provided, it will be total request
981
+ timeout. It can also be a pair (tuple) of
982
+ (connection, read) timeouts.
983
+ :type _request_timeout: int, tuple(int, int), optional
984
+ :param _request_auth: set to override the auth_settings for an a single
985
+ request; this effectively ignores the
986
+ authentication in the spec for a single request.
987
+ :type _request_auth: dict, optional
988
+ :param _content_type: force content-type for the request.
989
+ :type _content_type: str, Optional
990
+ :param _headers: set to override the headers for a single
991
+ request; this effectively ignores the headers
992
+ in the spec for a single request.
993
+ :type _headers: dict, optional
994
+ :param _host_index: set to override the host_index for a single
995
+ request; this effectively ignores the host_index
996
+ in the spec for a single request.
997
+ :type _host_index: int, optional
998
+ :return: Returns the result object.
999
+ """ # noqa: E501
1000
+
1001
+ _param = self._get_api_keys_serialize(
1002
+ limit=limit,
1003
+ offset=offset,
1004
+ access_token=access_token,
1005
+ _request_auth=_request_auth,
1006
+ _content_type=_content_type,
1007
+ _headers=_headers,
1008
+ _host_index=_host_index
1009
+ )
1010
+
1011
+ _response_types_map: Dict[str, Optional[str]] = {
1012
+ '200': "List[APIKeyModel]",
1013
+ '422': "HTTPValidationError",
1014
+ }
1015
+ response_data = self.api_client.call_api(
1016
+ *_param,
1017
+ _request_timeout=_request_timeout
1018
+ )
1019
+ response_data.read()
1020
+ return self.api_client.response_deserialize(
1021
+ response_data=response_data,
1022
+ response_types_map=_response_types_map,
1023
+ )
1024
+
1025
+
1026
+ @validate_call
1027
+ def get_api_keys_without_preload_content(
1028
+ self,
1029
+ limit: Optional[StrictInt] = None,
1030
+ offset: Optional[StrictInt] = None,
1031
+ access_token: Optional[StrictStr] = None,
1032
+ _request_timeout: Union[
1033
+ None,
1034
+ Annotated[StrictFloat, Field(gt=0)],
1035
+ Tuple[
1036
+ Annotated[StrictFloat, Field(gt=0)],
1037
+ Annotated[StrictFloat, Field(gt=0)]
1038
+ ]
1039
+ ] = None,
1040
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1041
+ _content_type: Optional[StrictStr] = None,
1042
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1043
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1044
+ ) -> RESTResponseType:
1045
+ """Get Api Keys
1046
+
1047
+
1048
+ :param limit:
1049
+ :type limit: int
1050
+ :param offset:
1051
+ :type offset: int
1052
+ :param access_token:
1053
+ :type access_token: str
1054
+ :param _request_timeout: timeout setting for this request. If one
1055
+ number provided, it will be total request
1056
+ timeout. It can also be a pair (tuple) of
1057
+ (connection, read) timeouts.
1058
+ :type _request_timeout: int, tuple(int, int), optional
1059
+ :param _request_auth: set to override the auth_settings for an a single
1060
+ request; this effectively ignores the
1061
+ authentication in the spec for a single request.
1062
+ :type _request_auth: dict, optional
1063
+ :param _content_type: force content-type for the request.
1064
+ :type _content_type: str, Optional
1065
+ :param _headers: set to override the headers for a single
1066
+ request; this effectively ignores the headers
1067
+ in the spec for a single request.
1068
+ :type _headers: dict, optional
1069
+ :param _host_index: set to override the host_index for a single
1070
+ request; this effectively ignores the host_index
1071
+ in the spec for a single request.
1072
+ :type _host_index: int, optional
1073
+ :return: Returns the result object.
1074
+ """ # noqa: E501
1075
+
1076
+ _param = self._get_api_keys_serialize(
1077
+ limit=limit,
1078
+ offset=offset,
1079
+ access_token=access_token,
1080
+ _request_auth=_request_auth,
1081
+ _content_type=_content_type,
1082
+ _headers=_headers,
1083
+ _host_index=_host_index
1084
+ )
1085
+
1086
+ _response_types_map: Dict[str, Optional[str]] = {
1087
+ '200': "List[APIKeyModel]",
1088
+ '422': "HTTPValidationError",
1089
+ }
1090
+ response_data = self.api_client.call_api(
1091
+ *_param,
1092
+ _request_timeout=_request_timeout
1093
+ )
1094
+ return response_data.response
1095
+
1096
+
1097
+ def _get_api_keys_serialize(
1098
+ self,
1099
+ limit,
1100
+ offset,
1101
+ access_token,
1102
+ _request_auth,
1103
+ _content_type,
1104
+ _headers,
1105
+ _host_index,
1106
+ ) -> RequestSerialized:
1107
+
1108
+ _host = None
1109
+
1110
+ _collection_formats: Dict[str, str] = {
1111
+ }
1112
+
1113
+ _path_params: Dict[str, str] = {}
1114
+ _query_params: List[Tuple[str, str]] = []
1115
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1116
+ _form_params: List[Tuple[str, str]] = []
1117
+ _files: Dict[
1118
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1119
+ ] = {}
1120
+ _body_params: Optional[bytes] = None
1121
+
1122
+ # process the path parameters
1123
+ # process the query parameters
1124
+ if limit is not None:
1125
+
1126
+ _query_params.append(('limit', limit))
1127
+
1128
+ if offset is not None:
1129
+
1130
+ _query_params.append(('offset', offset))
1131
+
1132
+ # process the header parameters
1133
+ # process the form parameters
1134
+ # process the body parameter
1135
+
1136
+
1137
+ # set the HTTP header `Accept`
1138
+ if 'Accept' not in _header_params:
1139
+ _header_params['Accept'] = self.api_client.select_header_accept(
1140
+ [
1141
+ 'application/json'
1142
+ ]
1143
+ )
1144
+
1145
+
1146
+ # authentication setting
1147
+ _auth_settings: List[str] = [
1148
+ 'OAuth2PasswordBearer'
1149
+ ]
1150
+
1151
+ return self.api_client.param_serialize(
1152
+ method='GET',
1153
+ resource_path='/api-keys',
1154
+ path_params=_path_params,
1155
+ query_params=_query_params,
1156
+ header_params=_header_params,
1157
+ body=_body_params,
1158
+ post_params=_form_params,
1159
+ files=_files,
1160
+ auth_settings=_auth_settings,
1161
+ collection_formats=_collection_formats,
1162
+ _host=_host,
1163
+ _request_auth=_request_auth
1164
+ )
1165
+
1166
+
1167
+
1168
+
1169
+ @validate_call
1170
+ def update_api_key(
1171
+ self,
1172
+ id: StrictStr,
1173
+ api_key_model: APIKeyModel,
1174
+ access_token: Optional[StrictStr] = None,
1175
+ _request_timeout: Union[
1176
+ None,
1177
+ Annotated[StrictFloat, Field(gt=0)],
1178
+ Tuple[
1179
+ Annotated[StrictFloat, Field(gt=0)],
1180
+ Annotated[StrictFloat, Field(gt=0)]
1181
+ ]
1182
+ ] = None,
1183
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1184
+ _content_type: Optional[StrictStr] = None,
1185
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1186
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1187
+ ) -> object:
1188
+ """Put Api Key
1189
+
1190
+
1191
+ :param id: (required)
1192
+ :type id: str
1193
+ :param api_key_model: (required)
1194
+ :type api_key_model: APIKeyModel
1195
+ :param access_token:
1196
+ :type access_token: str
1197
+ :param _request_timeout: timeout setting for this request. If one
1198
+ number provided, it will be total request
1199
+ timeout. It can also be a pair (tuple) of
1200
+ (connection, read) timeouts.
1201
+ :type _request_timeout: int, tuple(int, int), optional
1202
+ :param _request_auth: set to override the auth_settings for an a single
1203
+ request; this effectively ignores the
1204
+ authentication in the spec for a single request.
1205
+ :type _request_auth: dict, optional
1206
+ :param _content_type: force content-type for the request.
1207
+ :type _content_type: str, Optional
1208
+ :param _headers: set to override the headers for a single
1209
+ request; this effectively ignores the headers
1210
+ in the spec for a single request.
1211
+ :type _headers: dict, optional
1212
+ :param _host_index: set to override the host_index for a single
1213
+ request; this effectively ignores the host_index
1214
+ in the spec for a single request.
1215
+ :type _host_index: int, optional
1216
+ :return: Returns the result object.
1217
+ """ # noqa: E501
1218
+
1219
+ _param = self._update_api_key_serialize(
1220
+ id=id,
1221
+ api_key_model=api_key_model,
1222
+ access_token=access_token,
1223
+ _request_auth=_request_auth,
1224
+ _content_type=_content_type,
1225
+ _headers=_headers,
1226
+ _host_index=_host_index
1227
+ )
1228
+
1229
+ _response_types_map: Dict[str, Optional[str]] = {
1230
+ '200': "object",
1231
+ '422': "HTTPValidationError",
1232
+ }
1233
+ response_data = self.api_client.call_api(
1234
+ *_param,
1235
+ _request_timeout=_request_timeout
1236
+ )
1237
+ response_data.read()
1238
+ return self.api_client.response_deserialize(
1239
+ response_data=response_data,
1240
+ response_types_map=_response_types_map,
1241
+ ).data
1242
+
1243
+
1244
+ @validate_call
1245
+ def update_api_key_with_http_info(
1246
+ self,
1247
+ id: StrictStr,
1248
+ api_key_model: APIKeyModel,
1249
+ access_token: Optional[StrictStr] = None,
1250
+ _request_timeout: Union[
1251
+ None,
1252
+ Annotated[StrictFloat, Field(gt=0)],
1253
+ Tuple[
1254
+ Annotated[StrictFloat, Field(gt=0)],
1255
+ Annotated[StrictFloat, Field(gt=0)]
1256
+ ]
1257
+ ] = None,
1258
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1259
+ _content_type: Optional[StrictStr] = None,
1260
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1261
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1262
+ ) -> ApiResponse[object]:
1263
+ """Put Api Key
1264
+
1265
+
1266
+ :param id: (required)
1267
+ :type id: str
1268
+ :param api_key_model: (required)
1269
+ :type api_key_model: APIKeyModel
1270
+ :param access_token:
1271
+ :type access_token: str
1272
+ :param _request_timeout: timeout setting for this request. If one
1273
+ number provided, it will be total request
1274
+ timeout. It can also be a pair (tuple) of
1275
+ (connection, read) timeouts.
1276
+ :type _request_timeout: int, tuple(int, int), optional
1277
+ :param _request_auth: set to override the auth_settings for an a single
1278
+ request; this effectively ignores the
1279
+ authentication in the spec for a single request.
1280
+ :type _request_auth: dict, optional
1281
+ :param _content_type: force content-type for the request.
1282
+ :type _content_type: str, Optional
1283
+ :param _headers: set to override the headers for a single
1284
+ request; this effectively ignores the headers
1285
+ in the spec for a single request.
1286
+ :type _headers: dict, optional
1287
+ :param _host_index: set to override the host_index for a single
1288
+ request; this effectively ignores the host_index
1289
+ in the spec for a single request.
1290
+ :type _host_index: int, optional
1291
+ :return: Returns the result object.
1292
+ """ # noqa: E501
1293
+
1294
+ _param = self._update_api_key_serialize(
1295
+ id=id,
1296
+ api_key_model=api_key_model,
1297
+ access_token=access_token,
1298
+ _request_auth=_request_auth,
1299
+ _content_type=_content_type,
1300
+ _headers=_headers,
1301
+ _host_index=_host_index
1302
+ )
1303
+
1304
+ _response_types_map: Dict[str, Optional[str]] = {
1305
+ '200': "object",
1306
+ '422': "HTTPValidationError",
1307
+ }
1308
+ response_data = self.api_client.call_api(
1309
+ *_param,
1310
+ _request_timeout=_request_timeout
1311
+ )
1312
+ response_data.read()
1313
+ return self.api_client.response_deserialize(
1314
+ response_data=response_data,
1315
+ response_types_map=_response_types_map,
1316
+ )
1317
+
1318
+
1319
+ @validate_call
1320
+ def update_api_key_without_preload_content(
1321
+ self,
1322
+ id: StrictStr,
1323
+ api_key_model: APIKeyModel,
1324
+ access_token: Optional[StrictStr] = None,
1325
+ _request_timeout: Union[
1326
+ None,
1327
+ Annotated[StrictFloat, Field(gt=0)],
1328
+ Tuple[
1329
+ Annotated[StrictFloat, Field(gt=0)],
1330
+ Annotated[StrictFloat, Field(gt=0)]
1331
+ ]
1332
+ ] = None,
1333
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1334
+ _content_type: Optional[StrictStr] = None,
1335
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1336
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1337
+ ) -> RESTResponseType:
1338
+ """Put Api Key
1339
+
1340
+
1341
+ :param id: (required)
1342
+ :type id: str
1343
+ :param api_key_model: (required)
1344
+ :type api_key_model: APIKeyModel
1345
+ :param access_token:
1346
+ :type access_token: str
1347
+ :param _request_timeout: timeout setting for this request. If one
1348
+ number provided, it will be total request
1349
+ timeout. It can also be a pair (tuple) of
1350
+ (connection, read) timeouts.
1351
+ :type _request_timeout: int, tuple(int, int), optional
1352
+ :param _request_auth: set to override the auth_settings for an a single
1353
+ request; this effectively ignores the
1354
+ authentication in the spec for a single request.
1355
+ :type _request_auth: dict, optional
1356
+ :param _content_type: force content-type for the request.
1357
+ :type _content_type: str, Optional
1358
+ :param _headers: set to override the headers for a single
1359
+ request; this effectively ignores the headers
1360
+ in the spec for a single request.
1361
+ :type _headers: dict, optional
1362
+ :param _host_index: set to override the host_index for a single
1363
+ request; this effectively ignores the host_index
1364
+ in the spec for a single request.
1365
+ :type _host_index: int, optional
1366
+ :return: Returns the result object.
1367
+ """ # noqa: E501
1368
+
1369
+ _param = self._update_api_key_serialize(
1370
+ id=id,
1371
+ api_key_model=api_key_model,
1372
+ access_token=access_token,
1373
+ _request_auth=_request_auth,
1374
+ _content_type=_content_type,
1375
+ _headers=_headers,
1376
+ _host_index=_host_index
1377
+ )
1378
+
1379
+ _response_types_map: Dict[str, Optional[str]] = {
1380
+ '200': "object",
1381
+ '422': "HTTPValidationError",
1382
+ }
1383
+ response_data = self.api_client.call_api(
1384
+ *_param,
1385
+ _request_timeout=_request_timeout
1386
+ )
1387
+ return response_data.response
1388
+
1389
+
1390
+ def _update_api_key_serialize(
1391
+ self,
1392
+ id,
1393
+ api_key_model,
1394
+ access_token,
1395
+ _request_auth,
1396
+ _content_type,
1397
+ _headers,
1398
+ _host_index,
1399
+ ) -> RequestSerialized:
1400
+
1401
+ _host = None
1402
+
1403
+ _collection_formats: Dict[str, str] = {
1404
+ }
1405
+
1406
+ _path_params: Dict[str, str] = {}
1407
+ _query_params: List[Tuple[str, str]] = []
1408
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1409
+ _form_params: List[Tuple[str, str]] = []
1410
+ _files: Dict[
1411
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1412
+ ] = {}
1413
+ _body_params: Optional[bytes] = None
1414
+
1415
+ # process the path parameters
1416
+ if id is not None:
1417
+ _path_params['id'] = id
1418
+ # process the query parameters
1419
+ # process the header parameters
1420
+ # process the form parameters
1421
+ # process the body parameter
1422
+ if api_key_model is not None:
1423
+ _body_params = api_key_model
1424
+
1425
+
1426
+ # set the HTTP header `Accept`
1427
+ if 'Accept' not in _header_params:
1428
+ _header_params['Accept'] = self.api_client.select_header_accept(
1429
+ [
1430
+ 'application/json'
1431
+ ]
1432
+ )
1433
+
1434
+ # set the HTTP header `Content-Type`
1435
+ if _content_type:
1436
+ _header_params['Content-Type'] = _content_type
1437
+ else:
1438
+ _default_content_type = (
1439
+ self.api_client.select_header_content_type(
1440
+ [
1441
+ 'application/json'
1442
+ ]
1443
+ )
1444
+ )
1445
+ if _default_content_type is not None:
1446
+ _header_params['Content-Type'] = _default_content_type
1447
+
1448
+ # authentication setting
1449
+ _auth_settings: List[str] = [
1450
+ 'OAuth2PasswordBearer'
1451
+ ]
1452
+
1453
+ return self.api_client.param_serialize(
1454
+ method='PUT',
1455
+ resource_path='/api-keys/{id}',
1456
+ path_params=_path_params,
1457
+ query_params=_query_params,
1458
+ header_params=_header_params,
1459
+ body=_body_params,
1460
+ post_params=_form_params,
1461
+ files=_files,
1462
+ auth_settings=_auth_settings,
1463
+ collection_formats=_collection_formats,
1464
+ _host=_host,
1465
+ _request_auth=_request_auth
1466
+ )
1467
+
1468
+