smallestai 2.1.0__py3-none-any.whl → 3.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of smallestai might be problematic. Click here for more details.

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