hindsight-client 0.1.14__py3-none-any.whl → 0.1.15__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. hindsight_client/hindsight_client.py +11 -10
  2. {hindsight_client-0.1.14.dist-info → hindsight_client-0.1.15.dist-info}/METADATA +1 -1
  3. hindsight_client-0.1.15.dist-info/RECORD +109 -0
  4. hindsight_client_api/__init__.py +21 -3
  5. hindsight_client_api/api/__init__.py +5 -1
  6. hindsight_client_api/api/banks_api.py +2045 -0
  7. hindsight_client_api/api/documents_api.py +1234 -0
  8. hindsight_client_api/api/entities_api.py +921 -0
  9. hindsight_client_api/api/memory_api.py +1901 -0
  10. hindsight_client_api/api/monitoring_api.py +1 -1
  11. hindsight_client_api/api/operations_api.py +610 -0
  12. hindsight_client_api/api_client.py +1 -1
  13. hindsight_client_api/configuration.py +2 -2
  14. hindsight_client_api/docs/BankListItem.md +2 -2
  15. hindsight_client_api/docs/BankStatsResponse.md +39 -0
  16. hindsight_client_api/docs/BanksApi.md +517 -0
  17. hindsight_client_api/docs/CancelOperationResponse.md +32 -0
  18. hindsight_client_api/docs/DeleteDocumentResponse.md +33 -0
  19. hindsight_client_api/docs/DeleteResponse.md +2 -0
  20. hindsight_client_api/docs/DocumentsApi.md +313 -0
  21. hindsight_client_api/docs/EntitiesApi.md +230 -0
  22. hindsight_client_api/docs/MemoryApi.md +499 -0
  23. hindsight_client_api/docs/OperationResponse.md +36 -0
  24. hindsight_client_api/docs/OperationsApi.md +154 -0
  25. hindsight_client_api/docs/OperationsListResponse.md +31 -0
  26. hindsight_client_api/exceptions.py +1 -1
  27. hindsight_client_api/models/__init__.py +6 -1
  28. hindsight_client_api/models/add_background_request.py +1 -1
  29. hindsight_client_api/models/background_response.py +1 -1
  30. hindsight_client_api/models/bank_list_item.py +13 -3
  31. hindsight_client_api/models/bank_list_response.py +1 -1
  32. hindsight_client_api/models/bank_profile_response.py +1 -1
  33. hindsight_client_api/models/bank_stats_response.py +105 -0
  34. hindsight_client_api/models/budget.py +1 -1
  35. hindsight_client_api/models/cancel_operation_response.py +91 -0
  36. hindsight_client_api/models/chunk_data.py +1 -1
  37. hindsight_client_api/models/chunk_include_options.py +1 -1
  38. hindsight_client_api/models/chunk_response.py +1 -1
  39. hindsight_client_api/models/create_bank_request.py +1 -1
  40. hindsight_client_api/models/delete_document_response.py +93 -0
  41. hindsight_client_api/models/delete_response.py +19 -5
  42. hindsight_client_api/models/disposition_traits.py +1 -1
  43. hindsight_client_api/models/document_response.py +1 -1
  44. hindsight_client_api/models/entity_detail_response.py +1 -1
  45. hindsight_client_api/models/entity_include_options.py +1 -1
  46. hindsight_client_api/models/entity_list_item.py +1 -1
  47. hindsight_client_api/models/entity_list_response.py +1 -1
  48. hindsight_client_api/models/entity_observation_response.py +1 -1
  49. hindsight_client_api/models/entity_state_response.py +1 -1
  50. hindsight_client_api/models/graph_data_response.py +1 -1
  51. hindsight_client_api/models/http_validation_error.py +1 -1
  52. hindsight_client_api/models/include_options.py +1 -1
  53. hindsight_client_api/models/list_documents_response.py +1 -1
  54. hindsight_client_api/models/list_memory_units_response.py +1 -1
  55. hindsight_client_api/models/memory_item.py +1 -1
  56. hindsight_client_api/models/operation_response.py +109 -0
  57. hindsight_client_api/models/operations_list_response.py +97 -0
  58. hindsight_client_api/models/recall_request.py +1 -1
  59. hindsight_client_api/models/recall_response.py +1 -1
  60. hindsight_client_api/models/recall_result.py +1 -1
  61. hindsight_client_api/models/reflect_fact.py +1 -1
  62. hindsight_client_api/models/reflect_include_options.py +1 -1
  63. hindsight_client_api/models/reflect_request.py +1 -1
  64. hindsight_client_api/models/reflect_response.py +1 -1
  65. hindsight_client_api/models/retain_request.py +1 -1
  66. hindsight_client_api/models/retain_response.py +1 -1
  67. hindsight_client_api/models/update_disposition_request.py +1 -1
  68. hindsight_client_api/models/validation_error.py +1 -1
  69. hindsight_client_api/models/validation_error_loc_inner.py +1 -1
  70. hindsight_client_api/rest.py +1 -1
  71. hindsight_client-0.1.14.dist-info/RECORD +0 -131
  72. hindsight_client_api/api/default_api.py +0 -5976
  73. hindsight_client_api/docs/DefaultApi.md +0 -1568
  74. hindsight_client_api/test/__init__.py +0 -0
  75. hindsight_client_api/test/test_add_background_request.py +0 -53
  76. hindsight_client_api/test/test_background_response.py +0 -53
  77. hindsight_client_api/test/test_bank_list_item.py +0 -60
  78. hindsight_client_api/test/test_bank_list_response.py +0 -68
  79. hindsight_client_api/test/test_bank_profile_response.py +0 -58
  80. hindsight_client_api/test/test_budget.py +0 -33
  81. hindsight_client_api/test/test_chunk_data.py +0 -57
  82. hindsight_client_api/test/test_chunk_include_options.py +0 -51
  83. hindsight_client_api/test/test_chunk_response.py +0 -62
  84. hindsight_client_api/test/test_create_bank_request.py +0 -53
  85. hindsight_client_api/test/test_default_api.py +0 -178
  86. hindsight_client_api/test/test_delete_response.py +0 -52
  87. hindsight_client_api/test/test_disposition_traits.py +0 -56
  88. hindsight_client_api/test/test_document_response.py +0 -64
  89. hindsight_client_api/test/test_entity_detail_response.py +0 -71
  90. hindsight_client_api/test/test_entity_include_options.py +0 -51
  91. hindsight_client_api/test/test_entity_list_item.py +0 -61
  92. hindsight_client_api/test/test_entity_list_response.py +0 -56
  93. hindsight_client_api/test/test_entity_observation_response.py +0 -53
  94. hindsight_client_api/test/test_entity_state_response.py +0 -64
  95. hindsight_client_api/test/test_graph_data_response.py +0 -82
  96. hindsight_client_api/test/test_http_validation_error.py +0 -58
  97. hindsight_client_api/test/test_include_options.py +0 -54
  98. hindsight_client_api/test/test_list_documents_response.py +0 -66
  99. hindsight_client_api/test/test_list_memory_units_response.py +0 -66
  100. hindsight_client_api/test/test_memory_item.py +0 -58
  101. hindsight_client_api/test/test_monitoring_api.py +0 -45
  102. hindsight_client_api/test/test_recall_request.py +0 -64
  103. hindsight_client_api/test/test_recall_response.py +0 -76
  104. hindsight_client_api/test/test_recall_result.py +0 -67
  105. hindsight_client_api/test/test_reflect_fact.py +0 -57
  106. hindsight_client_api/test/test_reflect_include_options.py +0 -51
  107. hindsight_client_api/test/test_reflect_request.py +0 -56
  108. hindsight_client_api/test/test_reflect_response.py +0 -55
  109. hindsight_client_api/test/test_retain_request.py +0 -57
  110. hindsight_client_api/test/test_retain_response.py +0 -58
  111. hindsight_client_api/test/test_update_disposition_request.py +0 -52
  112. hindsight_client_api/test/test_validation_error.py +0 -60
  113. hindsight_client_api/test/test_validation_error_loc_inner.py +0 -50
  114. {hindsight_client-0.1.14.dist-info → hindsight_client-0.1.15.dist-info}/WHEEL +0 -0
@@ -0,0 +1,1234 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Hindsight HTTP API
5
+
6
+ HTTP API for Hindsight
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ import warnings
15
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+ from typing_extensions import Annotated
18
+
19
+ from pydantic import StrictInt, StrictStr
20
+ from typing import Optional
21
+ from hindsight_client_api.models.chunk_response import ChunkResponse
22
+ from hindsight_client_api.models.delete_document_response import DeleteDocumentResponse
23
+ from hindsight_client_api.models.document_response import DocumentResponse
24
+ from hindsight_client_api.models.list_documents_response import ListDocumentsResponse
25
+
26
+ from hindsight_client_api.api_client import ApiClient, RequestSerialized
27
+ from hindsight_client_api.api_response import ApiResponse
28
+ from hindsight_client_api.rest import RESTResponseType
29
+
30
+
31
+ class DocumentsApi:
32
+ """NOTE: This class is auto generated by OpenAPI Generator
33
+ Ref: https://openapi-generator.tech
34
+
35
+ Do not edit the class manually.
36
+ """
37
+
38
+ def __init__(self, api_client=None) -> None:
39
+ if api_client is None:
40
+ api_client = ApiClient.get_default()
41
+ self.api_client = api_client
42
+
43
+
44
+ @validate_call
45
+ async def delete_document(
46
+ self,
47
+ bank_id: StrictStr,
48
+ document_id: StrictStr,
49
+ authorization: Optional[StrictStr] = None,
50
+ _request_timeout: Union[
51
+ None,
52
+ Annotated[StrictFloat, Field(gt=0)],
53
+ Tuple[
54
+ Annotated[StrictFloat, Field(gt=0)],
55
+ Annotated[StrictFloat, Field(gt=0)]
56
+ ]
57
+ ] = None,
58
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
59
+ _content_type: Optional[StrictStr] = None,
60
+ _headers: Optional[Dict[StrictStr, Any]] = None,
61
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
62
+ ) -> DeleteDocumentResponse:
63
+ """Delete a document
64
+
65
+ Delete a document and all its associated memory units and links. This will cascade delete: - The document itself - All memory units extracted from this document - All links (temporal, semantic, entity) associated with those memory units This operation cannot be undone.
66
+
67
+ :param bank_id: (required)
68
+ :type bank_id: str
69
+ :param document_id: (required)
70
+ :type document_id: str
71
+ :param authorization:
72
+ :type authorization: str
73
+ :param _request_timeout: timeout setting for this request. If one
74
+ number provided, it will be total request
75
+ timeout. It can also be a pair (tuple) of
76
+ (connection, read) timeouts.
77
+ :type _request_timeout: int, tuple(int, int), optional
78
+ :param _request_auth: set to override the auth_settings for an a single
79
+ request; this effectively ignores the
80
+ authentication in the spec for a single request.
81
+ :type _request_auth: dict, optional
82
+ :param _content_type: force content-type for the request.
83
+ :type _content_type: str, Optional
84
+ :param _headers: set to override the headers for a single
85
+ request; this effectively ignores the headers
86
+ in the spec for a single request.
87
+ :type _headers: dict, optional
88
+ :param _host_index: set to override the host_index for a single
89
+ request; this effectively ignores the host_index
90
+ in the spec for a single request.
91
+ :type _host_index: int, optional
92
+ :return: Returns the result object.
93
+ """ # noqa: E501
94
+
95
+ _param = self._delete_document_serialize(
96
+ bank_id=bank_id,
97
+ document_id=document_id,
98
+ authorization=authorization,
99
+ _request_auth=_request_auth,
100
+ _content_type=_content_type,
101
+ _headers=_headers,
102
+ _host_index=_host_index
103
+ )
104
+
105
+ _response_types_map: Dict[str, Optional[str]] = {
106
+ '200': "DeleteDocumentResponse",
107
+ '422': "HTTPValidationError",
108
+ }
109
+ response_data = await self.api_client.call_api(
110
+ *_param,
111
+ _request_timeout=_request_timeout
112
+ )
113
+ await response_data.read()
114
+ return self.api_client.response_deserialize(
115
+ response_data=response_data,
116
+ response_types_map=_response_types_map,
117
+ ).data
118
+
119
+
120
+ @validate_call
121
+ async def delete_document_with_http_info(
122
+ self,
123
+ bank_id: StrictStr,
124
+ document_id: StrictStr,
125
+ authorization: Optional[StrictStr] = None,
126
+ _request_timeout: Union[
127
+ None,
128
+ Annotated[StrictFloat, Field(gt=0)],
129
+ Tuple[
130
+ Annotated[StrictFloat, Field(gt=0)],
131
+ Annotated[StrictFloat, Field(gt=0)]
132
+ ]
133
+ ] = None,
134
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
135
+ _content_type: Optional[StrictStr] = None,
136
+ _headers: Optional[Dict[StrictStr, Any]] = None,
137
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
138
+ ) -> ApiResponse[DeleteDocumentResponse]:
139
+ """Delete a document
140
+
141
+ Delete a document and all its associated memory units and links. This will cascade delete: - The document itself - All memory units extracted from this document - All links (temporal, semantic, entity) associated with those memory units This operation cannot be undone.
142
+
143
+ :param bank_id: (required)
144
+ :type bank_id: str
145
+ :param document_id: (required)
146
+ :type document_id: str
147
+ :param authorization:
148
+ :type authorization: str
149
+ :param _request_timeout: timeout setting for this request. If one
150
+ number provided, it will be total request
151
+ timeout. It can also be a pair (tuple) of
152
+ (connection, read) timeouts.
153
+ :type _request_timeout: int, tuple(int, int), optional
154
+ :param _request_auth: set to override the auth_settings for an a single
155
+ request; this effectively ignores the
156
+ authentication in the spec for a single request.
157
+ :type _request_auth: dict, optional
158
+ :param _content_type: force content-type for the request.
159
+ :type _content_type: str, Optional
160
+ :param _headers: set to override the headers for a single
161
+ request; this effectively ignores the headers
162
+ in the spec for a single request.
163
+ :type _headers: dict, optional
164
+ :param _host_index: set to override the host_index for a single
165
+ request; this effectively ignores the host_index
166
+ in the spec for a single request.
167
+ :type _host_index: int, optional
168
+ :return: Returns the result object.
169
+ """ # noqa: E501
170
+
171
+ _param = self._delete_document_serialize(
172
+ bank_id=bank_id,
173
+ document_id=document_id,
174
+ authorization=authorization,
175
+ _request_auth=_request_auth,
176
+ _content_type=_content_type,
177
+ _headers=_headers,
178
+ _host_index=_host_index
179
+ )
180
+
181
+ _response_types_map: Dict[str, Optional[str]] = {
182
+ '200': "DeleteDocumentResponse",
183
+ '422': "HTTPValidationError",
184
+ }
185
+ response_data = await self.api_client.call_api(
186
+ *_param,
187
+ _request_timeout=_request_timeout
188
+ )
189
+ await response_data.read()
190
+ return self.api_client.response_deserialize(
191
+ response_data=response_data,
192
+ response_types_map=_response_types_map,
193
+ )
194
+
195
+
196
+ @validate_call
197
+ async def delete_document_without_preload_content(
198
+ self,
199
+ bank_id: StrictStr,
200
+ document_id: StrictStr,
201
+ authorization: Optional[StrictStr] = None,
202
+ _request_timeout: Union[
203
+ None,
204
+ Annotated[StrictFloat, Field(gt=0)],
205
+ Tuple[
206
+ Annotated[StrictFloat, Field(gt=0)],
207
+ Annotated[StrictFloat, Field(gt=0)]
208
+ ]
209
+ ] = None,
210
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
211
+ _content_type: Optional[StrictStr] = None,
212
+ _headers: Optional[Dict[StrictStr, Any]] = None,
213
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
214
+ ) -> RESTResponseType:
215
+ """Delete a document
216
+
217
+ Delete a document and all its associated memory units and links. This will cascade delete: - The document itself - All memory units extracted from this document - All links (temporal, semantic, entity) associated with those memory units This operation cannot be undone.
218
+
219
+ :param bank_id: (required)
220
+ :type bank_id: str
221
+ :param document_id: (required)
222
+ :type document_id: str
223
+ :param authorization:
224
+ :type authorization: str
225
+ :param _request_timeout: timeout setting for this request. If one
226
+ number provided, it will be total request
227
+ timeout. It can also be a pair (tuple) of
228
+ (connection, read) timeouts.
229
+ :type _request_timeout: int, tuple(int, int), optional
230
+ :param _request_auth: set to override the auth_settings for an a single
231
+ request; this effectively ignores the
232
+ authentication in the spec for a single request.
233
+ :type _request_auth: dict, optional
234
+ :param _content_type: force content-type for the request.
235
+ :type _content_type: str, Optional
236
+ :param _headers: set to override the headers for a single
237
+ request; this effectively ignores the headers
238
+ in the spec for a single request.
239
+ :type _headers: dict, optional
240
+ :param _host_index: set to override the host_index for a single
241
+ request; this effectively ignores the host_index
242
+ in the spec for a single request.
243
+ :type _host_index: int, optional
244
+ :return: Returns the result object.
245
+ """ # noqa: E501
246
+
247
+ _param = self._delete_document_serialize(
248
+ bank_id=bank_id,
249
+ document_id=document_id,
250
+ authorization=authorization,
251
+ _request_auth=_request_auth,
252
+ _content_type=_content_type,
253
+ _headers=_headers,
254
+ _host_index=_host_index
255
+ )
256
+
257
+ _response_types_map: Dict[str, Optional[str]] = {
258
+ '200': "DeleteDocumentResponse",
259
+ '422': "HTTPValidationError",
260
+ }
261
+ response_data = await self.api_client.call_api(
262
+ *_param,
263
+ _request_timeout=_request_timeout
264
+ )
265
+ return response_data.response
266
+
267
+
268
+ def _delete_document_serialize(
269
+ self,
270
+ bank_id,
271
+ document_id,
272
+ authorization,
273
+ _request_auth,
274
+ _content_type,
275
+ _headers,
276
+ _host_index,
277
+ ) -> RequestSerialized:
278
+
279
+ _host = None
280
+
281
+ _collection_formats: Dict[str, str] = {
282
+ }
283
+
284
+ _path_params: Dict[str, str] = {}
285
+ _query_params: List[Tuple[str, str]] = []
286
+ _header_params: Dict[str, Optional[str]] = _headers or {}
287
+ _form_params: List[Tuple[str, str]] = []
288
+ _files: Dict[
289
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
290
+ ] = {}
291
+ _body_params: Optional[bytes] = None
292
+
293
+ # process the path parameters
294
+ if bank_id is not None:
295
+ _path_params['bank_id'] = bank_id
296
+ if document_id is not None:
297
+ _path_params['document_id'] = document_id
298
+ # process the query parameters
299
+ # process the header parameters
300
+ if authorization is not None:
301
+ _header_params['authorization'] = authorization
302
+ # process the form parameters
303
+ # process the body parameter
304
+
305
+
306
+ # set the HTTP header `Accept`
307
+ if 'Accept' not in _header_params:
308
+ _header_params['Accept'] = self.api_client.select_header_accept(
309
+ [
310
+ 'application/json'
311
+ ]
312
+ )
313
+
314
+
315
+ # authentication setting
316
+ _auth_settings: List[str] = [
317
+ ]
318
+
319
+ return self.api_client.param_serialize(
320
+ method='DELETE',
321
+ resource_path='/v1/default/banks/{bank_id}/documents/{document_id}',
322
+ path_params=_path_params,
323
+ query_params=_query_params,
324
+ header_params=_header_params,
325
+ body=_body_params,
326
+ post_params=_form_params,
327
+ files=_files,
328
+ auth_settings=_auth_settings,
329
+ collection_formats=_collection_formats,
330
+ _host=_host,
331
+ _request_auth=_request_auth
332
+ )
333
+
334
+
335
+
336
+
337
+ @validate_call
338
+ async def get_chunk(
339
+ self,
340
+ chunk_id: StrictStr,
341
+ authorization: Optional[StrictStr] = None,
342
+ _request_timeout: Union[
343
+ None,
344
+ Annotated[StrictFloat, Field(gt=0)],
345
+ Tuple[
346
+ Annotated[StrictFloat, Field(gt=0)],
347
+ Annotated[StrictFloat, Field(gt=0)]
348
+ ]
349
+ ] = None,
350
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
351
+ _content_type: Optional[StrictStr] = None,
352
+ _headers: Optional[Dict[StrictStr, Any]] = None,
353
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
354
+ ) -> ChunkResponse:
355
+ """Get chunk details
356
+
357
+ Get a specific chunk by its ID
358
+
359
+ :param chunk_id: (required)
360
+ :type chunk_id: str
361
+ :param authorization:
362
+ :type authorization: str
363
+ :param _request_timeout: timeout setting for this request. If one
364
+ number provided, it will be total request
365
+ timeout. It can also be a pair (tuple) of
366
+ (connection, read) timeouts.
367
+ :type _request_timeout: int, tuple(int, int), optional
368
+ :param _request_auth: set to override the auth_settings for an a single
369
+ request; this effectively ignores the
370
+ authentication in the spec for a single request.
371
+ :type _request_auth: dict, optional
372
+ :param _content_type: force content-type for the request.
373
+ :type _content_type: str, Optional
374
+ :param _headers: set to override the headers for a single
375
+ request; this effectively ignores the headers
376
+ in the spec for a single request.
377
+ :type _headers: dict, optional
378
+ :param _host_index: set to override the host_index for a single
379
+ request; this effectively ignores the host_index
380
+ in the spec for a single request.
381
+ :type _host_index: int, optional
382
+ :return: Returns the result object.
383
+ """ # noqa: E501
384
+
385
+ _param = self._get_chunk_serialize(
386
+ chunk_id=chunk_id,
387
+ authorization=authorization,
388
+ _request_auth=_request_auth,
389
+ _content_type=_content_type,
390
+ _headers=_headers,
391
+ _host_index=_host_index
392
+ )
393
+
394
+ _response_types_map: Dict[str, Optional[str]] = {
395
+ '200': "ChunkResponse",
396
+ '422': "HTTPValidationError",
397
+ }
398
+ response_data = await self.api_client.call_api(
399
+ *_param,
400
+ _request_timeout=_request_timeout
401
+ )
402
+ await response_data.read()
403
+ return self.api_client.response_deserialize(
404
+ response_data=response_data,
405
+ response_types_map=_response_types_map,
406
+ ).data
407
+
408
+
409
+ @validate_call
410
+ async def get_chunk_with_http_info(
411
+ self,
412
+ chunk_id: StrictStr,
413
+ authorization: Optional[StrictStr] = None,
414
+ _request_timeout: Union[
415
+ None,
416
+ Annotated[StrictFloat, Field(gt=0)],
417
+ Tuple[
418
+ Annotated[StrictFloat, Field(gt=0)],
419
+ Annotated[StrictFloat, Field(gt=0)]
420
+ ]
421
+ ] = None,
422
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
423
+ _content_type: Optional[StrictStr] = None,
424
+ _headers: Optional[Dict[StrictStr, Any]] = None,
425
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
426
+ ) -> ApiResponse[ChunkResponse]:
427
+ """Get chunk details
428
+
429
+ Get a specific chunk by its ID
430
+
431
+ :param chunk_id: (required)
432
+ :type chunk_id: str
433
+ :param authorization:
434
+ :type authorization: str
435
+ :param _request_timeout: timeout setting for this request. If one
436
+ number provided, it will be total request
437
+ timeout. It can also be a pair (tuple) of
438
+ (connection, read) timeouts.
439
+ :type _request_timeout: int, tuple(int, int), optional
440
+ :param _request_auth: set to override the auth_settings for an a single
441
+ request; this effectively ignores the
442
+ authentication in the spec for a single request.
443
+ :type _request_auth: dict, optional
444
+ :param _content_type: force content-type for the request.
445
+ :type _content_type: str, Optional
446
+ :param _headers: set to override the headers for a single
447
+ request; this effectively ignores the headers
448
+ in the spec for a single request.
449
+ :type _headers: dict, optional
450
+ :param _host_index: set to override the host_index for a single
451
+ request; this effectively ignores the host_index
452
+ in the spec for a single request.
453
+ :type _host_index: int, optional
454
+ :return: Returns the result object.
455
+ """ # noqa: E501
456
+
457
+ _param = self._get_chunk_serialize(
458
+ chunk_id=chunk_id,
459
+ authorization=authorization,
460
+ _request_auth=_request_auth,
461
+ _content_type=_content_type,
462
+ _headers=_headers,
463
+ _host_index=_host_index
464
+ )
465
+
466
+ _response_types_map: Dict[str, Optional[str]] = {
467
+ '200': "ChunkResponse",
468
+ '422': "HTTPValidationError",
469
+ }
470
+ response_data = await self.api_client.call_api(
471
+ *_param,
472
+ _request_timeout=_request_timeout
473
+ )
474
+ await response_data.read()
475
+ return self.api_client.response_deserialize(
476
+ response_data=response_data,
477
+ response_types_map=_response_types_map,
478
+ )
479
+
480
+
481
+ @validate_call
482
+ async def get_chunk_without_preload_content(
483
+ self,
484
+ chunk_id: StrictStr,
485
+ authorization: Optional[StrictStr] = None,
486
+ _request_timeout: Union[
487
+ None,
488
+ Annotated[StrictFloat, Field(gt=0)],
489
+ Tuple[
490
+ Annotated[StrictFloat, Field(gt=0)],
491
+ Annotated[StrictFloat, Field(gt=0)]
492
+ ]
493
+ ] = None,
494
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
495
+ _content_type: Optional[StrictStr] = None,
496
+ _headers: Optional[Dict[StrictStr, Any]] = None,
497
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
498
+ ) -> RESTResponseType:
499
+ """Get chunk details
500
+
501
+ Get a specific chunk by its ID
502
+
503
+ :param chunk_id: (required)
504
+ :type chunk_id: str
505
+ :param authorization:
506
+ :type authorization: str
507
+ :param _request_timeout: timeout setting for this request. If one
508
+ number provided, it will be total request
509
+ timeout. It can also be a pair (tuple) of
510
+ (connection, read) timeouts.
511
+ :type _request_timeout: int, tuple(int, int), optional
512
+ :param _request_auth: set to override the auth_settings for an a single
513
+ request; this effectively ignores the
514
+ authentication in the spec for a single request.
515
+ :type _request_auth: dict, optional
516
+ :param _content_type: force content-type for the request.
517
+ :type _content_type: str, Optional
518
+ :param _headers: set to override the headers for a single
519
+ request; this effectively ignores the headers
520
+ in the spec for a single request.
521
+ :type _headers: dict, optional
522
+ :param _host_index: set to override the host_index for a single
523
+ request; this effectively ignores the host_index
524
+ in the spec for a single request.
525
+ :type _host_index: int, optional
526
+ :return: Returns the result object.
527
+ """ # noqa: E501
528
+
529
+ _param = self._get_chunk_serialize(
530
+ chunk_id=chunk_id,
531
+ authorization=authorization,
532
+ _request_auth=_request_auth,
533
+ _content_type=_content_type,
534
+ _headers=_headers,
535
+ _host_index=_host_index
536
+ )
537
+
538
+ _response_types_map: Dict[str, Optional[str]] = {
539
+ '200': "ChunkResponse",
540
+ '422': "HTTPValidationError",
541
+ }
542
+ response_data = await self.api_client.call_api(
543
+ *_param,
544
+ _request_timeout=_request_timeout
545
+ )
546
+ return response_data.response
547
+
548
+
549
+ def _get_chunk_serialize(
550
+ self,
551
+ chunk_id,
552
+ authorization,
553
+ _request_auth,
554
+ _content_type,
555
+ _headers,
556
+ _host_index,
557
+ ) -> RequestSerialized:
558
+
559
+ _host = None
560
+
561
+ _collection_formats: Dict[str, str] = {
562
+ }
563
+
564
+ _path_params: Dict[str, str] = {}
565
+ _query_params: List[Tuple[str, str]] = []
566
+ _header_params: Dict[str, Optional[str]] = _headers or {}
567
+ _form_params: List[Tuple[str, str]] = []
568
+ _files: Dict[
569
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
570
+ ] = {}
571
+ _body_params: Optional[bytes] = None
572
+
573
+ # process the path parameters
574
+ if chunk_id is not None:
575
+ _path_params['chunk_id'] = chunk_id
576
+ # process the query parameters
577
+ # process the header parameters
578
+ if authorization is not None:
579
+ _header_params['authorization'] = authorization
580
+ # process the form parameters
581
+ # process the body parameter
582
+
583
+
584
+ # set the HTTP header `Accept`
585
+ if 'Accept' not in _header_params:
586
+ _header_params['Accept'] = self.api_client.select_header_accept(
587
+ [
588
+ 'application/json'
589
+ ]
590
+ )
591
+
592
+
593
+ # authentication setting
594
+ _auth_settings: List[str] = [
595
+ ]
596
+
597
+ return self.api_client.param_serialize(
598
+ method='GET',
599
+ resource_path='/v1/default/chunks/{chunk_id}',
600
+ path_params=_path_params,
601
+ query_params=_query_params,
602
+ header_params=_header_params,
603
+ body=_body_params,
604
+ post_params=_form_params,
605
+ files=_files,
606
+ auth_settings=_auth_settings,
607
+ collection_formats=_collection_formats,
608
+ _host=_host,
609
+ _request_auth=_request_auth
610
+ )
611
+
612
+
613
+
614
+
615
+ @validate_call
616
+ async def get_document(
617
+ self,
618
+ bank_id: StrictStr,
619
+ document_id: StrictStr,
620
+ authorization: Optional[StrictStr] = None,
621
+ _request_timeout: Union[
622
+ None,
623
+ Annotated[StrictFloat, Field(gt=0)],
624
+ Tuple[
625
+ Annotated[StrictFloat, Field(gt=0)],
626
+ Annotated[StrictFloat, Field(gt=0)]
627
+ ]
628
+ ] = None,
629
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
630
+ _content_type: Optional[StrictStr] = None,
631
+ _headers: Optional[Dict[StrictStr, Any]] = None,
632
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
633
+ ) -> DocumentResponse:
634
+ """Get document details
635
+
636
+ Get a specific document including its original text
637
+
638
+ :param bank_id: (required)
639
+ :type bank_id: str
640
+ :param document_id: (required)
641
+ :type document_id: str
642
+ :param authorization:
643
+ :type authorization: str
644
+ :param _request_timeout: timeout setting for this request. If one
645
+ number provided, it will be total request
646
+ timeout. It can also be a pair (tuple) of
647
+ (connection, read) timeouts.
648
+ :type _request_timeout: int, tuple(int, int), optional
649
+ :param _request_auth: set to override the auth_settings for an a single
650
+ request; this effectively ignores the
651
+ authentication in the spec for a single request.
652
+ :type _request_auth: dict, optional
653
+ :param _content_type: force content-type for the request.
654
+ :type _content_type: str, Optional
655
+ :param _headers: set to override the headers for a single
656
+ request; this effectively ignores the headers
657
+ in the spec for a single request.
658
+ :type _headers: dict, optional
659
+ :param _host_index: set to override the host_index for a single
660
+ request; this effectively ignores the host_index
661
+ in the spec for a single request.
662
+ :type _host_index: int, optional
663
+ :return: Returns the result object.
664
+ """ # noqa: E501
665
+
666
+ _param = self._get_document_serialize(
667
+ bank_id=bank_id,
668
+ document_id=document_id,
669
+ authorization=authorization,
670
+ _request_auth=_request_auth,
671
+ _content_type=_content_type,
672
+ _headers=_headers,
673
+ _host_index=_host_index
674
+ )
675
+
676
+ _response_types_map: Dict[str, Optional[str]] = {
677
+ '200': "DocumentResponse",
678
+ '422': "HTTPValidationError",
679
+ }
680
+ response_data = await self.api_client.call_api(
681
+ *_param,
682
+ _request_timeout=_request_timeout
683
+ )
684
+ await response_data.read()
685
+ return self.api_client.response_deserialize(
686
+ response_data=response_data,
687
+ response_types_map=_response_types_map,
688
+ ).data
689
+
690
+
691
+ @validate_call
692
+ async def get_document_with_http_info(
693
+ self,
694
+ bank_id: StrictStr,
695
+ document_id: StrictStr,
696
+ authorization: Optional[StrictStr] = None,
697
+ _request_timeout: Union[
698
+ None,
699
+ Annotated[StrictFloat, Field(gt=0)],
700
+ Tuple[
701
+ Annotated[StrictFloat, Field(gt=0)],
702
+ Annotated[StrictFloat, Field(gt=0)]
703
+ ]
704
+ ] = None,
705
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
706
+ _content_type: Optional[StrictStr] = None,
707
+ _headers: Optional[Dict[StrictStr, Any]] = None,
708
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
709
+ ) -> ApiResponse[DocumentResponse]:
710
+ """Get document details
711
+
712
+ Get a specific document including its original text
713
+
714
+ :param bank_id: (required)
715
+ :type bank_id: str
716
+ :param document_id: (required)
717
+ :type document_id: str
718
+ :param authorization:
719
+ :type authorization: str
720
+ :param _request_timeout: timeout setting for this request. If one
721
+ number provided, it will be total request
722
+ timeout. It can also be a pair (tuple) of
723
+ (connection, read) timeouts.
724
+ :type _request_timeout: int, tuple(int, int), optional
725
+ :param _request_auth: set to override the auth_settings for an a single
726
+ request; this effectively ignores the
727
+ authentication in the spec for a single request.
728
+ :type _request_auth: dict, optional
729
+ :param _content_type: force content-type for the request.
730
+ :type _content_type: str, Optional
731
+ :param _headers: set to override the headers for a single
732
+ request; this effectively ignores the headers
733
+ in the spec for a single request.
734
+ :type _headers: dict, optional
735
+ :param _host_index: set to override the host_index for a single
736
+ request; this effectively ignores the host_index
737
+ in the spec for a single request.
738
+ :type _host_index: int, optional
739
+ :return: Returns the result object.
740
+ """ # noqa: E501
741
+
742
+ _param = self._get_document_serialize(
743
+ bank_id=bank_id,
744
+ document_id=document_id,
745
+ authorization=authorization,
746
+ _request_auth=_request_auth,
747
+ _content_type=_content_type,
748
+ _headers=_headers,
749
+ _host_index=_host_index
750
+ )
751
+
752
+ _response_types_map: Dict[str, Optional[str]] = {
753
+ '200': "DocumentResponse",
754
+ '422': "HTTPValidationError",
755
+ }
756
+ response_data = await self.api_client.call_api(
757
+ *_param,
758
+ _request_timeout=_request_timeout
759
+ )
760
+ await response_data.read()
761
+ return self.api_client.response_deserialize(
762
+ response_data=response_data,
763
+ response_types_map=_response_types_map,
764
+ )
765
+
766
+
767
+ @validate_call
768
+ async def get_document_without_preload_content(
769
+ self,
770
+ bank_id: StrictStr,
771
+ document_id: StrictStr,
772
+ authorization: Optional[StrictStr] = None,
773
+ _request_timeout: Union[
774
+ None,
775
+ Annotated[StrictFloat, Field(gt=0)],
776
+ Tuple[
777
+ Annotated[StrictFloat, Field(gt=0)],
778
+ Annotated[StrictFloat, Field(gt=0)]
779
+ ]
780
+ ] = None,
781
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
782
+ _content_type: Optional[StrictStr] = None,
783
+ _headers: Optional[Dict[StrictStr, Any]] = None,
784
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
785
+ ) -> RESTResponseType:
786
+ """Get document details
787
+
788
+ Get a specific document including its original text
789
+
790
+ :param bank_id: (required)
791
+ :type bank_id: str
792
+ :param document_id: (required)
793
+ :type document_id: str
794
+ :param authorization:
795
+ :type authorization: str
796
+ :param _request_timeout: timeout setting for this request. If one
797
+ number provided, it will be total request
798
+ timeout. It can also be a pair (tuple) of
799
+ (connection, read) timeouts.
800
+ :type _request_timeout: int, tuple(int, int), optional
801
+ :param _request_auth: set to override the auth_settings for an a single
802
+ request; this effectively ignores the
803
+ authentication in the spec for a single request.
804
+ :type _request_auth: dict, optional
805
+ :param _content_type: force content-type for the request.
806
+ :type _content_type: str, Optional
807
+ :param _headers: set to override the headers for a single
808
+ request; this effectively ignores the headers
809
+ in the spec for a single request.
810
+ :type _headers: dict, optional
811
+ :param _host_index: set to override the host_index for a single
812
+ request; this effectively ignores the host_index
813
+ in the spec for a single request.
814
+ :type _host_index: int, optional
815
+ :return: Returns the result object.
816
+ """ # noqa: E501
817
+
818
+ _param = self._get_document_serialize(
819
+ bank_id=bank_id,
820
+ document_id=document_id,
821
+ authorization=authorization,
822
+ _request_auth=_request_auth,
823
+ _content_type=_content_type,
824
+ _headers=_headers,
825
+ _host_index=_host_index
826
+ )
827
+
828
+ _response_types_map: Dict[str, Optional[str]] = {
829
+ '200': "DocumentResponse",
830
+ '422': "HTTPValidationError",
831
+ }
832
+ response_data = await self.api_client.call_api(
833
+ *_param,
834
+ _request_timeout=_request_timeout
835
+ )
836
+ return response_data.response
837
+
838
+
839
+ def _get_document_serialize(
840
+ self,
841
+ bank_id,
842
+ document_id,
843
+ authorization,
844
+ _request_auth,
845
+ _content_type,
846
+ _headers,
847
+ _host_index,
848
+ ) -> RequestSerialized:
849
+
850
+ _host = None
851
+
852
+ _collection_formats: Dict[str, str] = {
853
+ }
854
+
855
+ _path_params: Dict[str, str] = {}
856
+ _query_params: List[Tuple[str, str]] = []
857
+ _header_params: Dict[str, Optional[str]] = _headers or {}
858
+ _form_params: List[Tuple[str, str]] = []
859
+ _files: Dict[
860
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
861
+ ] = {}
862
+ _body_params: Optional[bytes] = None
863
+
864
+ # process the path parameters
865
+ if bank_id is not None:
866
+ _path_params['bank_id'] = bank_id
867
+ if document_id is not None:
868
+ _path_params['document_id'] = document_id
869
+ # process the query parameters
870
+ # process the header parameters
871
+ if authorization is not None:
872
+ _header_params['authorization'] = authorization
873
+ # process the form parameters
874
+ # process the body parameter
875
+
876
+
877
+ # set the HTTP header `Accept`
878
+ if 'Accept' not in _header_params:
879
+ _header_params['Accept'] = self.api_client.select_header_accept(
880
+ [
881
+ 'application/json'
882
+ ]
883
+ )
884
+
885
+
886
+ # authentication setting
887
+ _auth_settings: List[str] = [
888
+ ]
889
+
890
+ return self.api_client.param_serialize(
891
+ method='GET',
892
+ resource_path='/v1/default/banks/{bank_id}/documents/{document_id}',
893
+ path_params=_path_params,
894
+ query_params=_query_params,
895
+ header_params=_header_params,
896
+ body=_body_params,
897
+ post_params=_form_params,
898
+ files=_files,
899
+ auth_settings=_auth_settings,
900
+ collection_formats=_collection_formats,
901
+ _host=_host,
902
+ _request_auth=_request_auth
903
+ )
904
+
905
+
906
+
907
+
908
+ @validate_call
909
+ async def list_documents(
910
+ self,
911
+ bank_id: StrictStr,
912
+ q: Optional[StrictStr] = None,
913
+ limit: Optional[StrictInt] = None,
914
+ offset: Optional[StrictInt] = None,
915
+ authorization: Optional[StrictStr] = None,
916
+ _request_timeout: Union[
917
+ None,
918
+ Annotated[StrictFloat, Field(gt=0)],
919
+ Tuple[
920
+ Annotated[StrictFloat, Field(gt=0)],
921
+ Annotated[StrictFloat, Field(gt=0)]
922
+ ]
923
+ ] = None,
924
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
925
+ _content_type: Optional[StrictStr] = None,
926
+ _headers: Optional[Dict[StrictStr, Any]] = None,
927
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
928
+ ) -> ListDocumentsResponse:
929
+ """List documents
930
+
931
+ List documents with pagination and optional search. Documents are the source content from which memory units are extracted.
932
+
933
+ :param bank_id: (required)
934
+ :type bank_id: str
935
+ :param q:
936
+ :type q: str
937
+ :param limit:
938
+ :type limit: int
939
+ :param offset:
940
+ :type offset: int
941
+ :param authorization:
942
+ :type authorization: str
943
+ :param _request_timeout: timeout setting for this request. If one
944
+ number provided, it will be total request
945
+ timeout. It can also be a pair (tuple) of
946
+ (connection, read) timeouts.
947
+ :type _request_timeout: int, tuple(int, int), optional
948
+ :param _request_auth: set to override the auth_settings for an a single
949
+ request; this effectively ignores the
950
+ authentication in the spec for a single request.
951
+ :type _request_auth: dict, optional
952
+ :param _content_type: force content-type for the request.
953
+ :type _content_type: str, Optional
954
+ :param _headers: set to override the headers for a single
955
+ request; this effectively ignores the headers
956
+ in the spec for a single request.
957
+ :type _headers: dict, optional
958
+ :param _host_index: set to override the host_index for a single
959
+ request; this effectively ignores the host_index
960
+ in the spec for a single request.
961
+ :type _host_index: int, optional
962
+ :return: Returns the result object.
963
+ """ # noqa: E501
964
+
965
+ _param = self._list_documents_serialize(
966
+ bank_id=bank_id,
967
+ q=q,
968
+ limit=limit,
969
+ offset=offset,
970
+ authorization=authorization,
971
+ _request_auth=_request_auth,
972
+ _content_type=_content_type,
973
+ _headers=_headers,
974
+ _host_index=_host_index
975
+ )
976
+
977
+ _response_types_map: Dict[str, Optional[str]] = {
978
+ '200': "ListDocumentsResponse",
979
+ '422': "HTTPValidationError",
980
+ }
981
+ response_data = await self.api_client.call_api(
982
+ *_param,
983
+ _request_timeout=_request_timeout
984
+ )
985
+ await response_data.read()
986
+ return self.api_client.response_deserialize(
987
+ response_data=response_data,
988
+ response_types_map=_response_types_map,
989
+ ).data
990
+
991
+
992
+ @validate_call
993
+ async def list_documents_with_http_info(
994
+ self,
995
+ bank_id: StrictStr,
996
+ q: Optional[StrictStr] = None,
997
+ limit: Optional[StrictInt] = None,
998
+ offset: Optional[StrictInt] = None,
999
+ authorization: Optional[StrictStr] = None,
1000
+ _request_timeout: Union[
1001
+ None,
1002
+ Annotated[StrictFloat, Field(gt=0)],
1003
+ Tuple[
1004
+ Annotated[StrictFloat, Field(gt=0)],
1005
+ Annotated[StrictFloat, Field(gt=0)]
1006
+ ]
1007
+ ] = None,
1008
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1009
+ _content_type: Optional[StrictStr] = None,
1010
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1011
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1012
+ ) -> ApiResponse[ListDocumentsResponse]:
1013
+ """List documents
1014
+
1015
+ List documents with pagination and optional search. Documents are the source content from which memory units are extracted.
1016
+
1017
+ :param bank_id: (required)
1018
+ :type bank_id: str
1019
+ :param q:
1020
+ :type q: str
1021
+ :param limit:
1022
+ :type limit: int
1023
+ :param offset:
1024
+ :type offset: int
1025
+ :param authorization:
1026
+ :type authorization: str
1027
+ :param _request_timeout: timeout setting for this request. If one
1028
+ number provided, it will be total request
1029
+ timeout. It can also be a pair (tuple) of
1030
+ (connection, read) timeouts.
1031
+ :type _request_timeout: int, tuple(int, int), optional
1032
+ :param _request_auth: set to override the auth_settings for an a single
1033
+ request; this effectively ignores the
1034
+ authentication in the spec for a single request.
1035
+ :type _request_auth: dict, optional
1036
+ :param _content_type: force content-type for the request.
1037
+ :type _content_type: str, Optional
1038
+ :param _headers: set to override the headers for a single
1039
+ request; this effectively ignores the headers
1040
+ in the spec for a single request.
1041
+ :type _headers: dict, optional
1042
+ :param _host_index: set to override the host_index for a single
1043
+ request; this effectively ignores the host_index
1044
+ in the spec for a single request.
1045
+ :type _host_index: int, optional
1046
+ :return: Returns the result object.
1047
+ """ # noqa: E501
1048
+
1049
+ _param = self._list_documents_serialize(
1050
+ bank_id=bank_id,
1051
+ q=q,
1052
+ limit=limit,
1053
+ offset=offset,
1054
+ authorization=authorization,
1055
+ _request_auth=_request_auth,
1056
+ _content_type=_content_type,
1057
+ _headers=_headers,
1058
+ _host_index=_host_index
1059
+ )
1060
+
1061
+ _response_types_map: Dict[str, Optional[str]] = {
1062
+ '200': "ListDocumentsResponse",
1063
+ '422': "HTTPValidationError",
1064
+ }
1065
+ response_data = await self.api_client.call_api(
1066
+ *_param,
1067
+ _request_timeout=_request_timeout
1068
+ )
1069
+ await response_data.read()
1070
+ return self.api_client.response_deserialize(
1071
+ response_data=response_data,
1072
+ response_types_map=_response_types_map,
1073
+ )
1074
+
1075
+
1076
+ @validate_call
1077
+ async def list_documents_without_preload_content(
1078
+ self,
1079
+ bank_id: StrictStr,
1080
+ q: Optional[StrictStr] = None,
1081
+ limit: Optional[StrictInt] = None,
1082
+ offset: Optional[StrictInt] = None,
1083
+ authorization: Optional[StrictStr] = None,
1084
+ _request_timeout: Union[
1085
+ None,
1086
+ Annotated[StrictFloat, Field(gt=0)],
1087
+ Tuple[
1088
+ Annotated[StrictFloat, Field(gt=0)],
1089
+ Annotated[StrictFloat, Field(gt=0)]
1090
+ ]
1091
+ ] = None,
1092
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1093
+ _content_type: Optional[StrictStr] = None,
1094
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1095
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1096
+ ) -> RESTResponseType:
1097
+ """List documents
1098
+
1099
+ List documents with pagination and optional search. Documents are the source content from which memory units are extracted.
1100
+
1101
+ :param bank_id: (required)
1102
+ :type bank_id: str
1103
+ :param q:
1104
+ :type q: str
1105
+ :param limit:
1106
+ :type limit: int
1107
+ :param offset:
1108
+ :type offset: int
1109
+ :param authorization:
1110
+ :type authorization: str
1111
+ :param _request_timeout: timeout setting for this request. If one
1112
+ number provided, it will be total request
1113
+ timeout. It can also be a pair (tuple) of
1114
+ (connection, read) timeouts.
1115
+ :type _request_timeout: int, tuple(int, int), optional
1116
+ :param _request_auth: set to override the auth_settings for an a single
1117
+ request; this effectively ignores the
1118
+ authentication in the spec for a single request.
1119
+ :type _request_auth: dict, optional
1120
+ :param _content_type: force content-type for the request.
1121
+ :type _content_type: str, Optional
1122
+ :param _headers: set to override the headers for a single
1123
+ request; this effectively ignores the headers
1124
+ in the spec for a single request.
1125
+ :type _headers: dict, optional
1126
+ :param _host_index: set to override the host_index for a single
1127
+ request; this effectively ignores the host_index
1128
+ in the spec for a single request.
1129
+ :type _host_index: int, optional
1130
+ :return: Returns the result object.
1131
+ """ # noqa: E501
1132
+
1133
+ _param = self._list_documents_serialize(
1134
+ bank_id=bank_id,
1135
+ q=q,
1136
+ limit=limit,
1137
+ offset=offset,
1138
+ authorization=authorization,
1139
+ _request_auth=_request_auth,
1140
+ _content_type=_content_type,
1141
+ _headers=_headers,
1142
+ _host_index=_host_index
1143
+ )
1144
+
1145
+ _response_types_map: Dict[str, Optional[str]] = {
1146
+ '200': "ListDocumentsResponse",
1147
+ '422': "HTTPValidationError",
1148
+ }
1149
+ response_data = await self.api_client.call_api(
1150
+ *_param,
1151
+ _request_timeout=_request_timeout
1152
+ )
1153
+ return response_data.response
1154
+
1155
+
1156
+ def _list_documents_serialize(
1157
+ self,
1158
+ bank_id,
1159
+ q,
1160
+ limit,
1161
+ offset,
1162
+ authorization,
1163
+ _request_auth,
1164
+ _content_type,
1165
+ _headers,
1166
+ _host_index,
1167
+ ) -> RequestSerialized:
1168
+
1169
+ _host = None
1170
+
1171
+ _collection_formats: Dict[str, str] = {
1172
+ }
1173
+
1174
+ _path_params: Dict[str, str] = {}
1175
+ _query_params: List[Tuple[str, str]] = []
1176
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1177
+ _form_params: List[Tuple[str, str]] = []
1178
+ _files: Dict[
1179
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1180
+ ] = {}
1181
+ _body_params: Optional[bytes] = None
1182
+
1183
+ # process the path parameters
1184
+ if bank_id is not None:
1185
+ _path_params['bank_id'] = bank_id
1186
+ # process the query parameters
1187
+ if q is not None:
1188
+
1189
+ _query_params.append(('q', q))
1190
+
1191
+ if limit is not None:
1192
+
1193
+ _query_params.append(('limit', limit))
1194
+
1195
+ if offset is not None:
1196
+
1197
+ _query_params.append(('offset', offset))
1198
+
1199
+ # process the header parameters
1200
+ if authorization is not None:
1201
+ _header_params['authorization'] = authorization
1202
+ # process the form parameters
1203
+ # process the body parameter
1204
+
1205
+
1206
+ # set the HTTP header `Accept`
1207
+ if 'Accept' not in _header_params:
1208
+ _header_params['Accept'] = self.api_client.select_header_accept(
1209
+ [
1210
+ 'application/json'
1211
+ ]
1212
+ )
1213
+
1214
+
1215
+ # authentication setting
1216
+ _auth_settings: List[str] = [
1217
+ ]
1218
+
1219
+ return self.api_client.param_serialize(
1220
+ method='GET',
1221
+ resource_path='/v1/default/banks/{bank_id}/documents',
1222
+ path_params=_path_params,
1223
+ query_params=_query_params,
1224
+ header_params=_header_params,
1225
+ body=_body_params,
1226
+ post_params=_form_params,
1227
+ files=_files,
1228
+ auth_settings=_auth_settings,
1229
+ collection_formats=_collection_formats,
1230
+ _host=_host,
1231
+ _request_auth=_request_auth
1232
+ )
1233
+
1234
+