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.
- crypticorn/__init__.py +3 -3
- crypticorn/client.py +722 -0
- crypticorn/hive/__init__.py +1 -0
- crypticorn/{api.py → hive/main.py} +6 -6
- crypticorn/hive/requirements.txt +4 -0
- crypticorn/{utils.py → hive/utils.py} +2 -2
- crypticorn/klines/__init__.py +2 -0
- crypticorn/klines/client/__init__.py +62 -0
- crypticorn/klines/client/api/__init__.py +9 -0
- crypticorn/klines/client/api/funding_rates_api.py +362 -0
- crypticorn/klines/client/api/health_check_api.py +281 -0
- crypticorn/klines/client/api/ohlcv_data_api.py +409 -0
- crypticorn/klines/client/api/symbols_api.py +308 -0
- crypticorn/klines/client/api/udf_api.py +1929 -0
- crypticorn/klines/client/api_client.py +797 -0
- crypticorn/klines/client/api_response.py +21 -0
- crypticorn/klines/client/configuration.py +565 -0
- crypticorn/klines/client/exceptions.py +216 -0
- crypticorn/klines/client/models/__init__.py +41 -0
- crypticorn/klines/client/models/base_response_health_check_response.py +108 -0
- crypticorn/klines/client/models/base_response_list_funding_rate_response.py +112 -0
- crypticorn/klines/client/models/base_response_list_str.py +104 -0
- crypticorn/klines/client/models/base_response_ohlcv_response.py +108 -0
- crypticorn/klines/client/models/error_response.py +101 -0
- crypticorn/{models/deleted.py → klines/client/models/exchange.py} +15 -11
- crypticorn/klines/client/models/funding_rate_response.py +92 -0
- crypticorn/klines/client/models/health_check_response.py +89 -0
- crypticorn/{models/create_api_key_response.py → klines/client/models/history_error_response.py} +12 -22
- crypticorn/klines/client/models/history_no_data_response.py +99 -0
- crypticorn/klines/client/models/history_success_response.py +99 -0
- crypticorn/klines/client/models/http_validation_error.py +95 -0
- crypticorn/klines/client/models/market.py +37 -0
- crypticorn/klines/client/models/ohlcv_response.py +98 -0
- crypticorn/klines/client/models/resolution.py +40 -0
- crypticorn/klines/client/models/response_get_history_udf_history_get.py +149 -0
- crypticorn/klines/client/models/search_symbol_response.py +97 -0
- crypticorn/klines/client/models/sort_direction.py +37 -0
- crypticorn/{models/futures_balance_error.py → klines/client/models/symbol_group_response.py} +12 -14
- crypticorn/klines/client/models/symbol_info_response.py +115 -0
- crypticorn/{models/id.py → klines/client/models/symbol_type.py} +13 -11
- crypticorn/klines/client/models/timeframe.py +40 -0
- crypticorn/klines/client/models/udf_config_response.py +121 -0
- crypticorn/klines/client/models/validation_error.py +99 -0
- crypticorn/{models/get_futures_balance200_response_inner.py → klines/client/models/validation_error_loc_inner.py} +39 -35
- crypticorn/klines/client/py.typed +0 -0
- crypticorn/klines/client/rest.py +257 -0
- crypticorn/klines/main.py +42 -0
- crypticorn/klines/requirements.txt +4 -0
- crypticorn/klines/test/__init__.py +0 -0
- crypticorn/klines/test/test_base_response_health_check_response.py +56 -0
- crypticorn/klines/test/test_base_response_list_funding_rate_response.py +59 -0
- crypticorn/klines/test/test_base_response_list_str.py +56 -0
- crypticorn/klines/test/test_base_response_ohlcv_response.py +72 -0
- crypticorn/klines/test/test_error_response.py +57 -0
- crypticorn/klines/test/test_exchange.py +56 -0
- crypticorn/klines/test/test_funding_rate_response.py +56 -0
- crypticorn/klines/test/test_funding_rates_api.py +38 -0
- crypticorn/klines/test/test_health_check_api.py +38 -0
- crypticorn/klines/test/test_health_check_response.py +52 -0
- crypticorn/klines/test/test_history_error_response.py +53 -0
- crypticorn/klines/test/test_history_no_data_response.py +69 -0
- crypticorn/klines/test/test_history_success_response.py +87 -0
- crypticorn/klines/test/test_http_validation_error.py +58 -0
- crypticorn/klines/test/test_market.py +33 -0
- crypticorn/klines/test/test_ohlcv_data_api.py +38 -0
- crypticorn/klines/test/test_ohlcv_response.py +86 -0
- crypticorn/klines/test/test_resolution.py +33 -0
- crypticorn/klines/test/test_response_get_history_udf_history_get.py +89 -0
- crypticorn/klines/test/test_search_symbol_response.py +62 -0
- crypticorn/klines/test/test_sort_direction.py +33 -0
- crypticorn/klines/test/test_symbol_group_response.py +53 -0
- crypticorn/klines/test/test_symbol_info_response.py +84 -0
- crypticorn/klines/test/test_symbol_type.py +54 -0
- crypticorn/klines/test/test_symbols_api.py +38 -0
- crypticorn/klines/test/test_timeframe.py +33 -0
- crypticorn/klines/test/test_udf_api.py +80 -0
- crypticorn/klines/test/test_udf_config_response.py +95 -0
- crypticorn/klines/test/test_validation_error.py +60 -0
- crypticorn/klines/test/test_validation_error_loc_inner.py +50 -0
- crypticorn/trade/__init__.py +2 -0
- crypticorn/trade/client/__init__.py +63 -0
- crypticorn/trade/client/api/__init__.py +13 -0
- crypticorn/trade/client/api/api_keys_api.py +1468 -0
- crypticorn/trade/client/api/bots_api.py +1211 -0
- crypticorn/trade/client/api/exchanges_api.py +297 -0
- crypticorn/trade/client/api/futures_trading_panel_api.py +1463 -0
- crypticorn/trade/client/api/notifications_api.py +1767 -0
- crypticorn/trade/client/api/orders_api.py +331 -0
- crypticorn/trade/client/api/status_api.py +278 -0
- crypticorn/trade/client/api/strategies_api.py +331 -0
- crypticorn/trade/client/api/trading_actions_api.py +898 -0
- crypticorn/trade/client/api_client.py +797 -0
- crypticorn/trade/client/api_response.py +21 -0
- crypticorn/trade/client/configuration.py +574 -0
- crypticorn/trade/client/exceptions.py +216 -0
- crypticorn/trade/client/models/__init__.py +38 -0
- crypticorn/{models → trade/client/models}/action_model.py +17 -20
- crypticorn/{models → trade/client/models}/api_error_identifier.py +3 -1
- crypticorn/{models → trade/client/models}/api_key_model.py +5 -8
- crypticorn/{models → trade/client/models}/bot_model.py +15 -11
- crypticorn/{models → trade/client/models}/futures_trading_action.py +12 -12
- crypticorn/{models → trade/client/models}/http_validation_error.py +1 -1
- crypticorn/{models → trade/client/models}/notification_model.py +8 -6
- crypticorn/{models → trade/client/models}/order_model.py +12 -15
- crypticorn/{models → trade/client/models}/post_futures_action.py +1 -1
- crypticorn/{models → trade/client/models}/strategy_exchange_info.py +1 -1
- crypticorn/{models → trade/client/models}/strategy_model.py +6 -2
- crypticorn/{models → trade/client/models}/validation_error.py +1 -1
- crypticorn/trade/client/py.typed +0 -0
- crypticorn/trade/client/rest.py +257 -0
- crypticorn/trade/main.py +39 -0
- crypticorn/trade/requirements.txt +4 -0
- crypticorn-1.0.2rc2.dist-info/METADATA +47 -0
- crypticorn-1.0.2rc2.dist-info/RECORD +128 -0
- {crypticorn-1.0.1.dist-info → crypticorn-1.0.2rc2.dist-info}/WHEEL +1 -1
- crypticorn/models/__init__.py +0 -31
- crypticorn/models/modified.py +0 -87
- crypticorn-1.0.1.dist-info/METADATA +0 -40
- crypticorn-1.0.1.dist-info/RECORD +0 -38
- /crypticorn/{models → trade/client/models}/exchange.py +0 -0
- /crypticorn/{models → trade/client/models}/execution_ids.py +0 -0
- /crypticorn/{models → trade/client/models}/futures_balance.py +0 -0
- /crypticorn/{models → trade/client/models}/margin_mode.py +0 -0
- /crypticorn/{models → trade/client/models}/market_type.py +0 -0
- /crypticorn/{models → trade/client/models}/notification_type.py +0 -0
- /crypticorn/{models → trade/client/models}/order_status.py +0 -0
- /crypticorn/{models → trade/client/models}/tpsl.py +0 -0
- /crypticorn/{models → trade/client/models}/trading_action_type.py +0 -0
- /crypticorn/{models → trade/client/models}/update_notification.py +0 -0
- /crypticorn/{models → trade/client/models}/validation_error_loc_inner.py +0 -0
- {crypticorn-1.0.1.dist-info → crypticorn-1.0.2rc2.dist-info}/LICENSE.md +0 -0
- {crypticorn-1.0.1.dist-info → crypticorn-1.0.2rc2.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,1211 @@
|
|
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 StrictBool, StrictInt, StrictStr
|
20
|
+
from typing import Any, List, Optional
|
21
|
+
from crypticorn.trade.client.models.bot_model import BotModel
|
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 BotsApi:
|
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_bot(
|
43
|
+
self,
|
44
|
+
bot_model: BotModel,
|
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
|
+
"""Create Bot
|
60
|
+
|
61
|
+
|
62
|
+
:param bot_model: (required)
|
63
|
+
:type bot_model: BotModel
|
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_bot_serialize(
|
89
|
+
bot_model=bot_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_bot_with_http_info(
|
114
|
+
self,
|
115
|
+
bot_model: BotModel,
|
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
|
+
"""Create Bot
|
131
|
+
|
132
|
+
|
133
|
+
:param bot_model: (required)
|
134
|
+
:type bot_model: BotModel
|
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_bot_serialize(
|
160
|
+
bot_model=bot_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_bot_without_preload_content(
|
185
|
+
self,
|
186
|
+
bot_model: BotModel,
|
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
|
+
"""Create Bot
|
202
|
+
|
203
|
+
|
204
|
+
:param bot_model: (required)
|
205
|
+
:type bot_model: BotModel
|
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_bot_serialize(
|
231
|
+
bot_model=bot_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_bot_serialize(
|
251
|
+
self,
|
252
|
+
bot_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 bot_model is not None:
|
280
|
+
_body_params = bot_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='/bots',
|
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_bot(
|
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 Bot
|
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_bot_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_bot_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 Bot
|
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_bot_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_bot_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 Bot
|
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_bot_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_bot_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='/bots/{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_bots(
|
604
|
+
self,
|
605
|
+
include_deleted: Optional[StrictBool] = None,
|
606
|
+
limit: Optional[StrictInt] = None,
|
607
|
+
offset: Optional[StrictInt] = None,
|
608
|
+
access_token: Optional[StrictStr] = None,
|
609
|
+
_request_timeout: Union[
|
610
|
+
None,
|
611
|
+
Annotated[StrictFloat, Field(gt=0)],
|
612
|
+
Tuple[
|
613
|
+
Annotated[StrictFloat, Field(gt=0)],
|
614
|
+
Annotated[StrictFloat, Field(gt=0)]
|
615
|
+
]
|
616
|
+
] = None,
|
617
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
618
|
+
_content_type: Optional[StrictStr] = None,
|
619
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
620
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
621
|
+
) -> List[BotModel]:
|
622
|
+
"""Get Bots
|
623
|
+
|
624
|
+
|
625
|
+
:param include_deleted:
|
626
|
+
:type include_deleted: bool
|
627
|
+
:param limit:
|
628
|
+
:type limit: int
|
629
|
+
:param offset:
|
630
|
+
:type offset: int
|
631
|
+
:param access_token:
|
632
|
+
:type access_token: str
|
633
|
+
:param _request_timeout: timeout setting for this request. If one
|
634
|
+
number provided, it will be total request
|
635
|
+
timeout. It can also be a pair (tuple) of
|
636
|
+
(connection, read) timeouts.
|
637
|
+
:type _request_timeout: int, tuple(int, int), optional
|
638
|
+
:param _request_auth: set to override the auth_settings for an a single
|
639
|
+
request; this effectively ignores the
|
640
|
+
authentication in the spec for a single request.
|
641
|
+
:type _request_auth: dict, optional
|
642
|
+
:param _content_type: force content-type for the request.
|
643
|
+
:type _content_type: str, Optional
|
644
|
+
:param _headers: set to override the headers for a single
|
645
|
+
request; this effectively ignores the headers
|
646
|
+
in the spec for a single request.
|
647
|
+
:type _headers: dict, optional
|
648
|
+
:param _host_index: set to override the host_index for a single
|
649
|
+
request; this effectively ignores the host_index
|
650
|
+
in the spec for a single request.
|
651
|
+
:type _host_index: int, optional
|
652
|
+
:return: Returns the result object.
|
653
|
+
""" # noqa: E501
|
654
|
+
|
655
|
+
_param = self._get_bots_serialize(
|
656
|
+
include_deleted=include_deleted,
|
657
|
+
limit=limit,
|
658
|
+
offset=offset,
|
659
|
+
access_token=access_token,
|
660
|
+
_request_auth=_request_auth,
|
661
|
+
_content_type=_content_type,
|
662
|
+
_headers=_headers,
|
663
|
+
_host_index=_host_index
|
664
|
+
)
|
665
|
+
|
666
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
667
|
+
'200': "List[BotModel]",
|
668
|
+
'422': "HTTPValidationError",
|
669
|
+
}
|
670
|
+
response_data = self.api_client.call_api(
|
671
|
+
*_param,
|
672
|
+
_request_timeout=_request_timeout
|
673
|
+
)
|
674
|
+
response_data.read()
|
675
|
+
return self.api_client.response_deserialize(
|
676
|
+
response_data=response_data,
|
677
|
+
response_types_map=_response_types_map,
|
678
|
+
).data
|
679
|
+
|
680
|
+
|
681
|
+
@validate_call
|
682
|
+
def get_bots_with_http_info(
|
683
|
+
self,
|
684
|
+
include_deleted: Optional[StrictBool] = None,
|
685
|
+
limit: Optional[StrictInt] = None,
|
686
|
+
offset: Optional[StrictInt] = None,
|
687
|
+
access_token: Optional[StrictStr] = None,
|
688
|
+
_request_timeout: Union[
|
689
|
+
None,
|
690
|
+
Annotated[StrictFloat, Field(gt=0)],
|
691
|
+
Tuple[
|
692
|
+
Annotated[StrictFloat, Field(gt=0)],
|
693
|
+
Annotated[StrictFloat, Field(gt=0)]
|
694
|
+
]
|
695
|
+
] = None,
|
696
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
697
|
+
_content_type: Optional[StrictStr] = None,
|
698
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
699
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
700
|
+
) -> ApiResponse[List[BotModel]]:
|
701
|
+
"""Get Bots
|
702
|
+
|
703
|
+
|
704
|
+
:param include_deleted:
|
705
|
+
:type include_deleted: bool
|
706
|
+
:param limit:
|
707
|
+
:type limit: int
|
708
|
+
:param offset:
|
709
|
+
:type offset: int
|
710
|
+
:param access_token:
|
711
|
+
:type access_token: str
|
712
|
+
:param _request_timeout: timeout setting for this request. If one
|
713
|
+
number provided, it will be total request
|
714
|
+
timeout. It can also be a pair (tuple) of
|
715
|
+
(connection, read) timeouts.
|
716
|
+
:type _request_timeout: int, tuple(int, int), optional
|
717
|
+
:param _request_auth: set to override the auth_settings for an a single
|
718
|
+
request; this effectively ignores the
|
719
|
+
authentication in the spec for a single request.
|
720
|
+
:type _request_auth: dict, optional
|
721
|
+
:param _content_type: force content-type for the request.
|
722
|
+
:type _content_type: str, Optional
|
723
|
+
:param _headers: set to override the headers for a single
|
724
|
+
request; this effectively ignores the headers
|
725
|
+
in the spec for a single request.
|
726
|
+
:type _headers: dict, optional
|
727
|
+
:param _host_index: set to override the host_index for a single
|
728
|
+
request; this effectively ignores the host_index
|
729
|
+
in the spec for a single request.
|
730
|
+
:type _host_index: int, optional
|
731
|
+
:return: Returns the result object.
|
732
|
+
""" # noqa: E501
|
733
|
+
|
734
|
+
_param = self._get_bots_serialize(
|
735
|
+
include_deleted=include_deleted,
|
736
|
+
limit=limit,
|
737
|
+
offset=offset,
|
738
|
+
access_token=access_token,
|
739
|
+
_request_auth=_request_auth,
|
740
|
+
_content_type=_content_type,
|
741
|
+
_headers=_headers,
|
742
|
+
_host_index=_host_index
|
743
|
+
)
|
744
|
+
|
745
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
746
|
+
'200': "List[BotModel]",
|
747
|
+
'422': "HTTPValidationError",
|
748
|
+
}
|
749
|
+
response_data = self.api_client.call_api(
|
750
|
+
*_param,
|
751
|
+
_request_timeout=_request_timeout
|
752
|
+
)
|
753
|
+
response_data.read()
|
754
|
+
return self.api_client.response_deserialize(
|
755
|
+
response_data=response_data,
|
756
|
+
response_types_map=_response_types_map,
|
757
|
+
)
|
758
|
+
|
759
|
+
|
760
|
+
@validate_call
|
761
|
+
def get_bots_without_preload_content(
|
762
|
+
self,
|
763
|
+
include_deleted: Optional[StrictBool] = None,
|
764
|
+
limit: Optional[StrictInt] = None,
|
765
|
+
offset: Optional[StrictInt] = None,
|
766
|
+
access_token: Optional[StrictStr] = None,
|
767
|
+
_request_timeout: Union[
|
768
|
+
None,
|
769
|
+
Annotated[StrictFloat, Field(gt=0)],
|
770
|
+
Tuple[
|
771
|
+
Annotated[StrictFloat, Field(gt=0)],
|
772
|
+
Annotated[StrictFloat, Field(gt=0)]
|
773
|
+
]
|
774
|
+
] = None,
|
775
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
776
|
+
_content_type: Optional[StrictStr] = None,
|
777
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
778
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
779
|
+
) -> RESTResponseType:
|
780
|
+
"""Get Bots
|
781
|
+
|
782
|
+
|
783
|
+
:param include_deleted:
|
784
|
+
:type include_deleted: bool
|
785
|
+
:param limit:
|
786
|
+
:type limit: int
|
787
|
+
:param offset:
|
788
|
+
:type offset: int
|
789
|
+
:param access_token:
|
790
|
+
:type access_token: str
|
791
|
+
:param _request_timeout: timeout setting for this request. If one
|
792
|
+
number provided, it will be total request
|
793
|
+
timeout. It can also be a pair (tuple) of
|
794
|
+
(connection, read) timeouts.
|
795
|
+
:type _request_timeout: int, tuple(int, int), optional
|
796
|
+
:param _request_auth: set to override the auth_settings for an a single
|
797
|
+
request; this effectively ignores the
|
798
|
+
authentication in the spec for a single request.
|
799
|
+
:type _request_auth: dict, optional
|
800
|
+
:param _content_type: force content-type for the request.
|
801
|
+
:type _content_type: str, Optional
|
802
|
+
:param _headers: set to override the headers for a single
|
803
|
+
request; this effectively ignores the headers
|
804
|
+
in the spec for a single request.
|
805
|
+
:type _headers: dict, optional
|
806
|
+
:param _host_index: set to override the host_index for a single
|
807
|
+
request; this effectively ignores the host_index
|
808
|
+
in the spec for a single request.
|
809
|
+
:type _host_index: int, optional
|
810
|
+
:return: Returns the result object.
|
811
|
+
""" # noqa: E501
|
812
|
+
|
813
|
+
_param = self._get_bots_serialize(
|
814
|
+
include_deleted=include_deleted,
|
815
|
+
limit=limit,
|
816
|
+
offset=offset,
|
817
|
+
access_token=access_token,
|
818
|
+
_request_auth=_request_auth,
|
819
|
+
_content_type=_content_type,
|
820
|
+
_headers=_headers,
|
821
|
+
_host_index=_host_index
|
822
|
+
)
|
823
|
+
|
824
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
825
|
+
'200': "List[BotModel]",
|
826
|
+
'422': "HTTPValidationError",
|
827
|
+
}
|
828
|
+
response_data = self.api_client.call_api(
|
829
|
+
*_param,
|
830
|
+
_request_timeout=_request_timeout
|
831
|
+
)
|
832
|
+
return response_data.response
|
833
|
+
|
834
|
+
|
835
|
+
def _get_bots_serialize(
|
836
|
+
self,
|
837
|
+
include_deleted,
|
838
|
+
limit,
|
839
|
+
offset,
|
840
|
+
access_token,
|
841
|
+
_request_auth,
|
842
|
+
_content_type,
|
843
|
+
_headers,
|
844
|
+
_host_index,
|
845
|
+
) -> RequestSerialized:
|
846
|
+
|
847
|
+
_host = None
|
848
|
+
|
849
|
+
_collection_formats: Dict[str, str] = {
|
850
|
+
}
|
851
|
+
|
852
|
+
_path_params: Dict[str, str] = {}
|
853
|
+
_query_params: List[Tuple[str, str]] = []
|
854
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
855
|
+
_form_params: List[Tuple[str, str]] = []
|
856
|
+
_files: Dict[
|
857
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
858
|
+
] = {}
|
859
|
+
_body_params: Optional[bytes] = None
|
860
|
+
|
861
|
+
# process the path parameters
|
862
|
+
# process the query parameters
|
863
|
+
if include_deleted is not None:
|
864
|
+
|
865
|
+
_query_params.append(('include_deleted', include_deleted))
|
866
|
+
|
867
|
+
if limit is not None:
|
868
|
+
|
869
|
+
_query_params.append(('limit', limit))
|
870
|
+
|
871
|
+
if offset is not None:
|
872
|
+
|
873
|
+
_query_params.append(('offset', offset))
|
874
|
+
|
875
|
+
# process the header parameters
|
876
|
+
# process the form parameters
|
877
|
+
# process the body parameter
|
878
|
+
|
879
|
+
|
880
|
+
# set the HTTP header `Accept`
|
881
|
+
if 'Accept' not in _header_params:
|
882
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
883
|
+
[
|
884
|
+
'application/json'
|
885
|
+
]
|
886
|
+
)
|
887
|
+
|
888
|
+
|
889
|
+
# authentication setting
|
890
|
+
_auth_settings: List[str] = [
|
891
|
+
'OAuth2PasswordBearer'
|
892
|
+
]
|
893
|
+
|
894
|
+
return self.api_client.param_serialize(
|
895
|
+
method='GET',
|
896
|
+
resource_path='/bots',
|
897
|
+
path_params=_path_params,
|
898
|
+
query_params=_query_params,
|
899
|
+
header_params=_header_params,
|
900
|
+
body=_body_params,
|
901
|
+
post_params=_form_params,
|
902
|
+
files=_files,
|
903
|
+
auth_settings=_auth_settings,
|
904
|
+
collection_formats=_collection_formats,
|
905
|
+
_host=_host,
|
906
|
+
_request_auth=_request_auth
|
907
|
+
)
|
908
|
+
|
909
|
+
|
910
|
+
|
911
|
+
|
912
|
+
@validate_call
|
913
|
+
def update_bot(
|
914
|
+
self,
|
915
|
+
id: StrictStr,
|
916
|
+
bot_model: BotModel,
|
917
|
+
access_token: Optional[StrictStr] = None,
|
918
|
+
_request_timeout: Union[
|
919
|
+
None,
|
920
|
+
Annotated[StrictFloat, Field(gt=0)],
|
921
|
+
Tuple[
|
922
|
+
Annotated[StrictFloat, Field(gt=0)],
|
923
|
+
Annotated[StrictFloat, Field(gt=0)]
|
924
|
+
]
|
925
|
+
] = None,
|
926
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
927
|
+
_content_type: Optional[StrictStr] = None,
|
928
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
929
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
930
|
+
) -> object:
|
931
|
+
"""Update Bot
|
932
|
+
|
933
|
+
|
934
|
+
:param id: (required)
|
935
|
+
:type id: str
|
936
|
+
:param bot_model: (required)
|
937
|
+
:type bot_model: BotModel
|
938
|
+
:param access_token:
|
939
|
+
:type access_token: str
|
940
|
+
:param _request_timeout: timeout setting for this request. If one
|
941
|
+
number provided, it will be total request
|
942
|
+
timeout. It can also be a pair (tuple) of
|
943
|
+
(connection, read) timeouts.
|
944
|
+
:type _request_timeout: int, tuple(int, int), optional
|
945
|
+
:param _request_auth: set to override the auth_settings for an a single
|
946
|
+
request; this effectively ignores the
|
947
|
+
authentication in the spec for a single request.
|
948
|
+
:type _request_auth: dict, optional
|
949
|
+
:param _content_type: force content-type for the request.
|
950
|
+
:type _content_type: str, Optional
|
951
|
+
:param _headers: set to override the headers for a single
|
952
|
+
request; this effectively ignores the headers
|
953
|
+
in the spec for a single request.
|
954
|
+
:type _headers: dict, optional
|
955
|
+
:param _host_index: set to override the host_index for a single
|
956
|
+
request; this effectively ignores the host_index
|
957
|
+
in the spec for a single request.
|
958
|
+
:type _host_index: int, optional
|
959
|
+
:return: Returns the result object.
|
960
|
+
""" # noqa: E501
|
961
|
+
|
962
|
+
_param = self._update_bot_serialize(
|
963
|
+
id=id,
|
964
|
+
bot_model=bot_model,
|
965
|
+
access_token=access_token,
|
966
|
+
_request_auth=_request_auth,
|
967
|
+
_content_type=_content_type,
|
968
|
+
_headers=_headers,
|
969
|
+
_host_index=_host_index
|
970
|
+
)
|
971
|
+
|
972
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
973
|
+
'200': "object",
|
974
|
+
'422': "HTTPValidationError",
|
975
|
+
}
|
976
|
+
response_data = self.api_client.call_api(
|
977
|
+
*_param,
|
978
|
+
_request_timeout=_request_timeout
|
979
|
+
)
|
980
|
+
response_data.read()
|
981
|
+
return self.api_client.response_deserialize(
|
982
|
+
response_data=response_data,
|
983
|
+
response_types_map=_response_types_map,
|
984
|
+
).data
|
985
|
+
|
986
|
+
|
987
|
+
@validate_call
|
988
|
+
def update_bot_with_http_info(
|
989
|
+
self,
|
990
|
+
id: StrictStr,
|
991
|
+
bot_model: BotModel,
|
992
|
+
access_token: Optional[StrictStr] = None,
|
993
|
+
_request_timeout: Union[
|
994
|
+
None,
|
995
|
+
Annotated[StrictFloat, Field(gt=0)],
|
996
|
+
Tuple[
|
997
|
+
Annotated[StrictFloat, Field(gt=0)],
|
998
|
+
Annotated[StrictFloat, Field(gt=0)]
|
999
|
+
]
|
1000
|
+
] = None,
|
1001
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1002
|
+
_content_type: Optional[StrictStr] = None,
|
1003
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1004
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1005
|
+
) -> ApiResponse[object]:
|
1006
|
+
"""Update Bot
|
1007
|
+
|
1008
|
+
|
1009
|
+
:param id: (required)
|
1010
|
+
:type id: str
|
1011
|
+
:param bot_model: (required)
|
1012
|
+
:type bot_model: BotModel
|
1013
|
+
:param access_token:
|
1014
|
+
:type access_token: str
|
1015
|
+
:param _request_timeout: timeout setting for this request. If one
|
1016
|
+
number provided, it will be total request
|
1017
|
+
timeout. It can also be a pair (tuple) of
|
1018
|
+
(connection, read) timeouts.
|
1019
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1020
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1021
|
+
request; this effectively ignores the
|
1022
|
+
authentication in the spec for a single request.
|
1023
|
+
:type _request_auth: dict, optional
|
1024
|
+
:param _content_type: force content-type for the request.
|
1025
|
+
:type _content_type: str, Optional
|
1026
|
+
:param _headers: set to override the headers for a single
|
1027
|
+
request; this effectively ignores the headers
|
1028
|
+
in the spec for a single request.
|
1029
|
+
:type _headers: dict, optional
|
1030
|
+
:param _host_index: set to override the host_index for a single
|
1031
|
+
request; this effectively ignores the host_index
|
1032
|
+
in the spec for a single request.
|
1033
|
+
:type _host_index: int, optional
|
1034
|
+
:return: Returns the result object.
|
1035
|
+
""" # noqa: E501
|
1036
|
+
|
1037
|
+
_param = self._update_bot_serialize(
|
1038
|
+
id=id,
|
1039
|
+
bot_model=bot_model,
|
1040
|
+
access_token=access_token,
|
1041
|
+
_request_auth=_request_auth,
|
1042
|
+
_content_type=_content_type,
|
1043
|
+
_headers=_headers,
|
1044
|
+
_host_index=_host_index
|
1045
|
+
)
|
1046
|
+
|
1047
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1048
|
+
'200': "object",
|
1049
|
+
'422': "HTTPValidationError",
|
1050
|
+
}
|
1051
|
+
response_data = self.api_client.call_api(
|
1052
|
+
*_param,
|
1053
|
+
_request_timeout=_request_timeout
|
1054
|
+
)
|
1055
|
+
response_data.read()
|
1056
|
+
return self.api_client.response_deserialize(
|
1057
|
+
response_data=response_data,
|
1058
|
+
response_types_map=_response_types_map,
|
1059
|
+
)
|
1060
|
+
|
1061
|
+
|
1062
|
+
@validate_call
|
1063
|
+
def update_bot_without_preload_content(
|
1064
|
+
self,
|
1065
|
+
id: StrictStr,
|
1066
|
+
bot_model: BotModel,
|
1067
|
+
access_token: Optional[StrictStr] = None,
|
1068
|
+
_request_timeout: Union[
|
1069
|
+
None,
|
1070
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1071
|
+
Tuple[
|
1072
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1073
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1074
|
+
]
|
1075
|
+
] = None,
|
1076
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1077
|
+
_content_type: Optional[StrictStr] = None,
|
1078
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1079
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1080
|
+
) -> RESTResponseType:
|
1081
|
+
"""Update Bot
|
1082
|
+
|
1083
|
+
|
1084
|
+
:param id: (required)
|
1085
|
+
:type id: str
|
1086
|
+
:param bot_model: (required)
|
1087
|
+
:type bot_model: BotModel
|
1088
|
+
:param access_token:
|
1089
|
+
:type access_token: str
|
1090
|
+
:param _request_timeout: timeout setting for this request. If one
|
1091
|
+
number provided, it will be total request
|
1092
|
+
timeout. It can also be a pair (tuple) of
|
1093
|
+
(connection, read) timeouts.
|
1094
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1095
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1096
|
+
request; this effectively ignores the
|
1097
|
+
authentication in the spec for a single request.
|
1098
|
+
:type _request_auth: dict, optional
|
1099
|
+
:param _content_type: force content-type for the request.
|
1100
|
+
:type _content_type: str, Optional
|
1101
|
+
:param _headers: set to override the headers for a single
|
1102
|
+
request; this effectively ignores the headers
|
1103
|
+
in the spec for a single request.
|
1104
|
+
:type _headers: dict, optional
|
1105
|
+
:param _host_index: set to override the host_index for a single
|
1106
|
+
request; this effectively ignores the host_index
|
1107
|
+
in the spec for a single request.
|
1108
|
+
:type _host_index: int, optional
|
1109
|
+
:return: Returns the result object.
|
1110
|
+
""" # noqa: E501
|
1111
|
+
|
1112
|
+
_param = self._update_bot_serialize(
|
1113
|
+
id=id,
|
1114
|
+
bot_model=bot_model,
|
1115
|
+
access_token=access_token,
|
1116
|
+
_request_auth=_request_auth,
|
1117
|
+
_content_type=_content_type,
|
1118
|
+
_headers=_headers,
|
1119
|
+
_host_index=_host_index
|
1120
|
+
)
|
1121
|
+
|
1122
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1123
|
+
'200': "object",
|
1124
|
+
'422': "HTTPValidationError",
|
1125
|
+
}
|
1126
|
+
response_data = self.api_client.call_api(
|
1127
|
+
*_param,
|
1128
|
+
_request_timeout=_request_timeout
|
1129
|
+
)
|
1130
|
+
return response_data.response
|
1131
|
+
|
1132
|
+
|
1133
|
+
def _update_bot_serialize(
|
1134
|
+
self,
|
1135
|
+
id,
|
1136
|
+
bot_model,
|
1137
|
+
access_token,
|
1138
|
+
_request_auth,
|
1139
|
+
_content_type,
|
1140
|
+
_headers,
|
1141
|
+
_host_index,
|
1142
|
+
) -> RequestSerialized:
|
1143
|
+
|
1144
|
+
_host = None
|
1145
|
+
|
1146
|
+
_collection_formats: Dict[str, str] = {
|
1147
|
+
}
|
1148
|
+
|
1149
|
+
_path_params: Dict[str, str] = {}
|
1150
|
+
_query_params: List[Tuple[str, str]] = []
|
1151
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
1152
|
+
_form_params: List[Tuple[str, str]] = []
|
1153
|
+
_files: Dict[
|
1154
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
1155
|
+
] = {}
|
1156
|
+
_body_params: Optional[bytes] = None
|
1157
|
+
|
1158
|
+
# process the path parameters
|
1159
|
+
if id is not None:
|
1160
|
+
_path_params['id'] = id
|
1161
|
+
# process the query parameters
|
1162
|
+
# process the header parameters
|
1163
|
+
# process the form parameters
|
1164
|
+
# process the body parameter
|
1165
|
+
if bot_model is not None:
|
1166
|
+
_body_params = bot_model
|
1167
|
+
|
1168
|
+
|
1169
|
+
# set the HTTP header `Accept`
|
1170
|
+
if 'Accept' not in _header_params:
|
1171
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
1172
|
+
[
|
1173
|
+
'application/json'
|
1174
|
+
]
|
1175
|
+
)
|
1176
|
+
|
1177
|
+
# set the HTTP header `Content-Type`
|
1178
|
+
if _content_type:
|
1179
|
+
_header_params['Content-Type'] = _content_type
|
1180
|
+
else:
|
1181
|
+
_default_content_type = (
|
1182
|
+
self.api_client.select_header_content_type(
|
1183
|
+
[
|
1184
|
+
'application/json'
|
1185
|
+
]
|
1186
|
+
)
|
1187
|
+
)
|
1188
|
+
if _default_content_type is not None:
|
1189
|
+
_header_params['Content-Type'] = _default_content_type
|
1190
|
+
|
1191
|
+
# authentication setting
|
1192
|
+
_auth_settings: List[str] = [
|
1193
|
+
'OAuth2PasswordBearer'
|
1194
|
+
]
|
1195
|
+
|
1196
|
+
return self.api_client.param_serialize(
|
1197
|
+
method='PUT',
|
1198
|
+
resource_path='/bots/{id}',
|
1199
|
+
path_params=_path_params,
|
1200
|
+
query_params=_query_params,
|
1201
|
+
header_params=_header_params,
|
1202
|
+
body=_body_params,
|
1203
|
+
post_params=_form_params,
|
1204
|
+
files=_files,
|
1205
|
+
auth_settings=_auth_settings,
|
1206
|
+
collection_formats=_collection_formats,
|
1207
|
+
_host=_host,
|
1208
|
+
_request_auth=_request_auth
|
1209
|
+
)
|
1210
|
+
|
1211
|
+
|