h2ogpte 1.6.41rc3__py3-none-any.whl → 1.6.41rc4__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.
@@ -0,0 +1,1148 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ h2oGPTe REST API
5
+
6
+ # Overview Users can easily interact with the h2oGPTe API through its REST API, allowing HTTP requests from any programming language. ## Authorization: Getting an API key Sign up/in at Enterprise h2oGPTe and generate one of the following two types of API keys: - **Global API key**: If a Collection is not specified when creating a new API Key, that key is considered to be a global API Key. Use global API Keys to grant full user impersonation and system-wide access to all of your work. Anyone with access to one of your global API Keys can create, delete, or interact with any of your past, current, and future Collections, Documents, Chats, and settings. - **Collection-specific API key**: Use Collection-specific API Keys to grant external access to only Chat with a specified Collection and make related API calls to it. Collection-specific API keys do not allow other API calls, such as creation, deletion, or access to other Collections or Chats. Access Enterprise h2oGPTe through your [H2O Generative AI](https://genai.h2o.ai/appstore) app store account, available with a freemium tier. ## Authorization: Using an API key All h2oGPTe REST API requests must include an API Key in the \"Authorization\" HTTP header, formatted as follows: ``` Authorization: Bearer sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ``` ```sh curl -X 'POST' \\ 'https://h2ogpte.genai.h2o.ai/api/v1/collections' \\ -H 'accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'Authorization: Bearer sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \\ -d '{ \"name\": \"The name of my Collection\", \"description\": \"The description of my Collection\", \"embedding_model\": \"BAAI/bge-large-en-v1.5\" }' ``` ## Interactive h2oGPTe API testing This page only showcases the h2oGPTe REST API; you can test it directly in the [Swagger UI](https://h2ogpte.genai.h2o.ai/swagger-ui/). Ensure that you are logged into your Enterprise h2oGPTe account.
7
+
8
+ The version of the OpenAPI document: v1.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 Field, StrictInt, StrictStr
20
+ from typing import List, Optional
21
+ from typing_extensions import Annotated
22
+ from h2ogpte.rest_sync.models.extractor import Extractor
23
+ from h2ogpte.rest_sync.models.extractor_create_request import ExtractorCreateRequest
24
+
25
+ from h2ogpte.rest_sync.api_client import ApiClient, RequestSerialized
26
+ from h2ogpte.rest_sync.api_response import ApiResponse
27
+ from h2ogpte.rest_sync.rest import RESTResponseType
28
+
29
+
30
+ class ExtractorsApi:
31
+ """NOTE: This class is auto generated by OpenAPI Generator
32
+ Ref: https://openapi-generator.tech
33
+
34
+ Do not edit the class manually.
35
+ """
36
+
37
+ def __init__(self, api_client=None) -> None:
38
+ if api_client is None:
39
+ api_client = ApiClient.get_default()
40
+ self.api_client = api_client
41
+
42
+
43
+ @validate_call
44
+ def create_extractor(
45
+ self,
46
+ extractor_create_request: ExtractorCreateRequest,
47
+ _request_timeout: Union[
48
+ None,
49
+ Annotated[StrictFloat, Field(gt=0)],
50
+ Tuple[
51
+ Annotated[StrictFloat, Field(gt=0)],
52
+ Annotated[StrictFloat, Field(gt=0)]
53
+ ]
54
+ ] = None,
55
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
56
+ _content_type: Optional[StrictStr] = None,
57
+ _headers: Optional[Dict[StrictStr, Any]] = None,
58
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
59
+ ) -> Extractor:
60
+ """Creates extractor.
61
+
62
+
63
+ :param extractor_create_request: (required)
64
+ :type extractor_create_request: ExtractorCreateRequest
65
+ :param _request_timeout: timeout setting for this request. If one
66
+ number provided, it will be total request
67
+ timeout. It can also be a pair (tuple) of
68
+ (connection, read) timeouts.
69
+ :type _request_timeout: int, tuple(int, int), optional
70
+ :param _request_auth: set to override the auth_settings for an a single
71
+ request; this effectively ignores the
72
+ authentication in the spec for a single request.
73
+ :type _request_auth: dict, optional
74
+ :param _content_type: force content-type for the request.
75
+ :type _content_type: str, Optional
76
+ :param _headers: set to override the headers for a single
77
+ request; this effectively ignores the headers
78
+ in the spec for a single request.
79
+ :type _headers: dict, optional
80
+ :param _host_index: set to override the host_index for a single
81
+ request; this effectively ignores the host_index
82
+ in the spec for a single request.
83
+ :type _host_index: int, optional
84
+ :return: Returns the result object.
85
+ """ # noqa: E501
86
+
87
+ _param = self._create_extractor_serialize(
88
+ extractor_create_request=extractor_create_request,
89
+ _request_auth=_request_auth,
90
+ _content_type=_content_type,
91
+ _headers=_headers,
92
+ _host_index=_host_index
93
+ )
94
+
95
+ _response_types_map: Dict[str, Optional[str]] = {
96
+ '200': "Extractor",
97
+ '401': "EndpointError",
98
+ '404': "EndpointError",
99
+ }
100
+ response_data = self.api_client.call_api(
101
+ *_param,
102
+ _request_timeout=_request_timeout
103
+ )
104
+ response_data.read()
105
+ return self.api_client.response_deserialize(
106
+ response_data=response_data,
107
+ response_types_map=_response_types_map,
108
+ ).data
109
+
110
+
111
+ @validate_call
112
+ def create_extractor_with_http_info(
113
+ self,
114
+ extractor_create_request: ExtractorCreateRequest,
115
+ _request_timeout: Union[
116
+ None,
117
+ Annotated[StrictFloat, Field(gt=0)],
118
+ Tuple[
119
+ Annotated[StrictFloat, Field(gt=0)],
120
+ Annotated[StrictFloat, Field(gt=0)]
121
+ ]
122
+ ] = None,
123
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
124
+ _content_type: Optional[StrictStr] = None,
125
+ _headers: Optional[Dict[StrictStr, Any]] = None,
126
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
127
+ ) -> ApiResponse[Extractor]:
128
+ """Creates extractor.
129
+
130
+
131
+ :param extractor_create_request: (required)
132
+ :type extractor_create_request: ExtractorCreateRequest
133
+ :param _request_timeout: timeout setting for this request. If one
134
+ number provided, it will be total request
135
+ timeout. It can also be a pair (tuple) of
136
+ (connection, read) timeouts.
137
+ :type _request_timeout: int, tuple(int, int), optional
138
+ :param _request_auth: set to override the auth_settings for an a single
139
+ request; this effectively ignores the
140
+ authentication in the spec for a single request.
141
+ :type _request_auth: dict, optional
142
+ :param _content_type: force content-type for the request.
143
+ :type _content_type: str, Optional
144
+ :param _headers: set to override the headers for a single
145
+ request; this effectively ignores the headers
146
+ in the spec for a single request.
147
+ :type _headers: dict, optional
148
+ :param _host_index: set to override the host_index for a single
149
+ request; this effectively ignores the host_index
150
+ in the spec for a single request.
151
+ :type _host_index: int, optional
152
+ :return: Returns the result object.
153
+ """ # noqa: E501
154
+
155
+ _param = self._create_extractor_serialize(
156
+ extractor_create_request=extractor_create_request,
157
+ _request_auth=_request_auth,
158
+ _content_type=_content_type,
159
+ _headers=_headers,
160
+ _host_index=_host_index
161
+ )
162
+
163
+ _response_types_map: Dict[str, Optional[str]] = {
164
+ '200': "Extractor",
165
+ '401': "EndpointError",
166
+ '404': "EndpointError",
167
+ }
168
+ response_data = self.api_client.call_api(
169
+ *_param,
170
+ _request_timeout=_request_timeout
171
+ )
172
+ response_data.read()
173
+ return self.api_client.response_deserialize(
174
+ response_data=response_data,
175
+ response_types_map=_response_types_map,
176
+ )
177
+
178
+
179
+ @validate_call
180
+ def create_extractor_without_preload_content(
181
+ self,
182
+ extractor_create_request: ExtractorCreateRequest,
183
+ _request_timeout: Union[
184
+ None,
185
+ Annotated[StrictFloat, Field(gt=0)],
186
+ Tuple[
187
+ Annotated[StrictFloat, Field(gt=0)],
188
+ Annotated[StrictFloat, Field(gt=0)]
189
+ ]
190
+ ] = None,
191
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
192
+ _content_type: Optional[StrictStr] = None,
193
+ _headers: Optional[Dict[StrictStr, Any]] = None,
194
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
195
+ ) -> RESTResponseType:
196
+ """Creates extractor.
197
+
198
+
199
+ :param extractor_create_request: (required)
200
+ :type extractor_create_request: ExtractorCreateRequest
201
+ :param _request_timeout: timeout setting for this request. If one
202
+ number provided, it will be total request
203
+ timeout. It can also be a pair (tuple) of
204
+ (connection, read) timeouts.
205
+ :type _request_timeout: int, tuple(int, int), optional
206
+ :param _request_auth: set to override the auth_settings for an a single
207
+ request; this effectively ignores the
208
+ authentication in the spec for a single request.
209
+ :type _request_auth: dict, optional
210
+ :param _content_type: force content-type for the request.
211
+ :type _content_type: str, Optional
212
+ :param _headers: set to override the headers for a single
213
+ request; this effectively ignores the headers
214
+ in the spec for a single request.
215
+ :type _headers: dict, optional
216
+ :param _host_index: set to override the host_index for a single
217
+ request; this effectively ignores the host_index
218
+ in the spec for a single request.
219
+ :type _host_index: int, optional
220
+ :return: Returns the result object.
221
+ """ # noqa: E501
222
+
223
+ _param = self._create_extractor_serialize(
224
+ extractor_create_request=extractor_create_request,
225
+ _request_auth=_request_auth,
226
+ _content_type=_content_type,
227
+ _headers=_headers,
228
+ _host_index=_host_index
229
+ )
230
+
231
+ _response_types_map: Dict[str, Optional[str]] = {
232
+ '200': "Extractor",
233
+ '401': "EndpointError",
234
+ '404': "EndpointError",
235
+ }
236
+ response_data = self.api_client.call_api(
237
+ *_param,
238
+ _request_timeout=_request_timeout
239
+ )
240
+ return response_data.response
241
+
242
+
243
+ def _create_extractor_serialize(
244
+ self,
245
+ extractor_create_request,
246
+ _request_auth,
247
+ _content_type,
248
+ _headers,
249
+ _host_index,
250
+ ) -> RequestSerialized:
251
+
252
+ _host = None
253
+
254
+ _collection_formats: Dict[str, str] = {
255
+ }
256
+
257
+ _path_params: Dict[str, str] = {}
258
+ _query_params: List[Tuple[str, str]] = []
259
+ _header_params: Dict[str, Optional[str]] = _headers or {}
260
+ _form_params: List[Tuple[str, str]] = []
261
+ _files: Dict[
262
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
263
+ ] = {}
264
+ _body_params: Optional[bytes] = None
265
+
266
+ # process the path parameters
267
+ # process the query parameters
268
+ # process the header parameters
269
+ # process the form parameters
270
+ # process the body parameter
271
+ if extractor_create_request is not None:
272
+ _body_params = extractor_create_request
273
+
274
+
275
+ # set the HTTP header `Accept`
276
+ if 'Accept' not in _header_params:
277
+ _header_params['Accept'] = self.api_client.select_header_accept(
278
+ [
279
+ 'application/json'
280
+ ]
281
+ )
282
+
283
+ # set the HTTP header `Content-Type`
284
+ if _content_type:
285
+ _header_params['Content-Type'] = _content_type
286
+ else:
287
+ _default_content_type = (
288
+ self.api_client.select_header_content_type(
289
+ [
290
+ 'application/json'
291
+ ]
292
+ )
293
+ )
294
+ if _default_content_type is not None:
295
+ _header_params['Content-Type'] = _default_content_type
296
+
297
+ # authentication setting
298
+ _auth_settings: List[str] = [
299
+ 'bearerAuth'
300
+ ]
301
+
302
+ return self.api_client.param_serialize(
303
+ method='POST',
304
+ resource_path='/extractors',
305
+ path_params=_path_params,
306
+ query_params=_query_params,
307
+ header_params=_header_params,
308
+ body=_body_params,
309
+ post_params=_form_params,
310
+ files=_files,
311
+ auth_settings=_auth_settings,
312
+ collection_formats=_collection_formats,
313
+ _host=_host,
314
+ _request_auth=_request_auth
315
+ )
316
+
317
+
318
+
319
+
320
+ @validate_call
321
+ def delete_extractor(
322
+ self,
323
+ extractor_id: Annotated[StrictStr, Field(description="ID of the extractor to delete.")],
324
+ _request_timeout: Union[
325
+ None,
326
+ Annotated[StrictFloat, Field(gt=0)],
327
+ Tuple[
328
+ Annotated[StrictFloat, Field(gt=0)],
329
+ Annotated[StrictFloat, Field(gt=0)]
330
+ ]
331
+ ] = None,
332
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
333
+ _content_type: Optional[StrictStr] = None,
334
+ _headers: Optional[Dict[StrictStr, Any]] = None,
335
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
336
+ ) -> None:
337
+ """Deletes extractor.
338
+
339
+ Deletes extractor.
340
+
341
+ :param extractor_id: ID of the extractor to delete. (required)
342
+ :type extractor_id: str
343
+ :param _request_timeout: timeout setting for this request. If one
344
+ number provided, it will be total request
345
+ timeout. It can also be a pair (tuple) of
346
+ (connection, read) timeouts.
347
+ :type _request_timeout: int, tuple(int, int), optional
348
+ :param _request_auth: set to override the auth_settings for an a single
349
+ request; this effectively ignores the
350
+ authentication in the spec for a single request.
351
+ :type _request_auth: dict, optional
352
+ :param _content_type: force content-type for the request.
353
+ :type _content_type: str, Optional
354
+ :param _headers: set to override the headers for a single
355
+ request; this effectively ignores the headers
356
+ in the spec for a single request.
357
+ :type _headers: dict, optional
358
+ :param _host_index: set to override the host_index for a single
359
+ request; this effectively ignores the host_index
360
+ in the spec for a single request.
361
+ :type _host_index: int, optional
362
+ :return: Returns the result object.
363
+ """ # noqa: E501
364
+
365
+ _param = self._delete_extractor_serialize(
366
+ extractor_id=extractor_id,
367
+ _request_auth=_request_auth,
368
+ _content_type=_content_type,
369
+ _headers=_headers,
370
+ _host_index=_host_index
371
+ )
372
+
373
+ _response_types_map: Dict[str, Optional[str]] = {
374
+ '204': None,
375
+ '401': "EndpointError",
376
+ }
377
+ response_data = self.api_client.call_api(
378
+ *_param,
379
+ _request_timeout=_request_timeout
380
+ )
381
+ response_data.read()
382
+ return self.api_client.response_deserialize(
383
+ response_data=response_data,
384
+ response_types_map=_response_types_map,
385
+ ).data
386
+
387
+
388
+ @validate_call
389
+ def delete_extractor_with_http_info(
390
+ self,
391
+ extractor_id: Annotated[StrictStr, Field(description="ID of the extractor to delete.")],
392
+ _request_timeout: Union[
393
+ None,
394
+ Annotated[StrictFloat, Field(gt=0)],
395
+ Tuple[
396
+ Annotated[StrictFloat, Field(gt=0)],
397
+ Annotated[StrictFloat, Field(gt=0)]
398
+ ]
399
+ ] = None,
400
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
401
+ _content_type: Optional[StrictStr] = None,
402
+ _headers: Optional[Dict[StrictStr, Any]] = None,
403
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
404
+ ) -> ApiResponse[None]:
405
+ """Deletes extractor.
406
+
407
+ Deletes extractor.
408
+
409
+ :param extractor_id: ID of the extractor to delete. (required)
410
+ :type extractor_id: str
411
+ :param _request_timeout: timeout setting for this request. If one
412
+ number provided, it will be total request
413
+ timeout. It can also be a pair (tuple) of
414
+ (connection, read) timeouts.
415
+ :type _request_timeout: int, tuple(int, int), optional
416
+ :param _request_auth: set to override the auth_settings for an a single
417
+ request; this effectively ignores the
418
+ authentication in the spec for a single request.
419
+ :type _request_auth: dict, optional
420
+ :param _content_type: force content-type for the request.
421
+ :type _content_type: str, Optional
422
+ :param _headers: set to override the headers for a single
423
+ request; this effectively ignores the headers
424
+ in the spec for a single request.
425
+ :type _headers: dict, optional
426
+ :param _host_index: set to override the host_index for a single
427
+ request; this effectively ignores the host_index
428
+ in the spec for a single request.
429
+ :type _host_index: int, optional
430
+ :return: Returns the result object.
431
+ """ # noqa: E501
432
+
433
+ _param = self._delete_extractor_serialize(
434
+ extractor_id=extractor_id,
435
+ _request_auth=_request_auth,
436
+ _content_type=_content_type,
437
+ _headers=_headers,
438
+ _host_index=_host_index
439
+ )
440
+
441
+ _response_types_map: Dict[str, Optional[str]] = {
442
+ '204': None,
443
+ '401': "EndpointError",
444
+ }
445
+ response_data = self.api_client.call_api(
446
+ *_param,
447
+ _request_timeout=_request_timeout
448
+ )
449
+ response_data.read()
450
+ return self.api_client.response_deserialize(
451
+ response_data=response_data,
452
+ response_types_map=_response_types_map,
453
+ )
454
+
455
+
456
+ @validate_call
457
+ def delete_extractor_without_preload_content(
458
+ self,
459
+ extractor_id: Annotated[StrictStr, Field(description="ID of the extractor to delete.")],
460
+ _request_timeout: Union[
461
+ None,
462
+ Annotated[StrictFloat, Field(gt=0)],
463
+ Tuple[
464
+ Annotated[StrictFloat, Field(gt=0)],
465
+ Annotated[StrictFloat, Field(gt=0)]
466
+ ]
467
+ ] = None,
468
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
469
+ _content_type: Optional[StrictStr] = None,
470
+ _headers: Optional[Dict[StrictStr, Any]] = None,
471
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
472
+ ) -> RESTResponseType:
473
+ """Deletes extractor.
474
+
475
+ Deletes extractor.
476
+
477
+ :param extractor_id: ID of the extractor to delete. (required)
478
+ :type extractor_id: str
479
+ :param _request_timeout: timeout setting for this request. If one
480
+ number provided, it will be total request
481
+ timeout. It can also be a pair (tuple) of
482
+ (connection, read) timeouts.
483
+ :type _request_timeout: int, tuple(int, int), optional
484
+ :param _request_auth: set to override the auth_settings for an a single
485
+ request; this effectively ignores the
486
+ authentication in the spec for a single request.
487
+ :type _request_auth: dict, optional
488
+ :param _content_type: force content-type for the request.
489
+ :type _content_type: str, Optional
490
+ :param _headers: set to override the headers for a single
491
+ request; this effectively ignores the headers
492
+ in the spec for a single request.
493
+ :type _headers: dict, optional
494
+ :param _host_index: set to override the host_index for a single
495
+ request; this effectively ignores the host_index
496
+ in the spec for a single request.
497
+ :type _host_index: int, optional
498
+ :return: Returns the result object.
499
+ """ # noqa: E501
500
+
501
+ _param = self._delete_extractor_serialize(
502
+ extractor_id=extractor_id,
503
+ _request_auth=_request_auth,
504
+ _content_type=_content_type,
505
+ _headers=_headers,
506
+ _host_index=_host_index
507
+ )
508
+
509
+ _response_types_map: Dict[str, Optional[str]] = {
510
+ '204': None,
511
+ '401': "EndpointError",
512
+ }
513
+ response_data = self.api_client.call_api(
514
+ *_param,
515
+ _request_timeout=_request_timeout
516
+ )
517
+ return response_data.response
518
+
519
+
520
+ def _delete_extractor_serialize(
521
+ self,
522
+ extractor_id,
523
+ _request_auth,
524
+ _content_type,
525
+ _headers,
526
+ _host_index,
527
+ ) -> RequestSerialized:
528
+
529
+ _host = None
530
+
531
+ _collection_formats: Dict[str, str] = {
532
+ }
533
+
534
+ _path_params: Dict[str, str] = {}
535
+ _query_params: List[Tuple[str, str]] = []
536
+ _header_params: Dict[str, Optional[str]] = _headers or {}
537
+ _form_params: List[Tuple[str, str]] = []
538
+ _files: Dict[
539
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
540
+ ] = {}
541
+ _body_params: Optional[bytes] = None
542
+
543
+ # process the path parameters
544
+ if extractor_id is not None:
545
+ _path_params['extractor_id'] = extractor_id
546
+ # process the query parameters
547
+ # process the header parameters
548
+ # process the form parameters
549
+ # process the body parameter
550
+
551
+
552
+ # set the HTTP header `Accept`
553
+ if 'Accept' not in _header_params:
554
+ _header_params['Accept'] = self.api_client.select_header_accept(
555
+ [
556
+ 'application/json'
557
+ ]
558
+ )
559
+
560
+
561
+ # authentication setting
562
+ _auth_settings: List[str] = [
563
+ 'bearerAuth'
564
+ ]
565
+
566
+ return self.api_client.param_serialize(
567
+ method='DELETE',
568
+ resource_path='/extractors/{extractor_id}',
569
+ path_params=_path_params,
570
+ query_params=_query_params,
571
+ header_params=_header_params,
572
+ body=_body_params,
573
+ post_params=_form_params,
574
+ files=_files,
575
+ auth_settings=_auth_settings,
576
+ collection_formats=_collection_formats,
577
+ _host=_host,
578
+ _request_auth=_request_auth
579
+ )
580
+
581
+
582
+
583
+
584
+ @validate_call
585
+ def get_extractor(
586
+ self,
587
+ extractor_id: Annotated[StrictStr, Field(description="ID of the extractor to get.")],
588
+ _request_timeout: Union[
589
+ None,
590
+ Annotated[StrictFloat, Field(gt=0)],
591
+ Tuple[
592
+ Annotated[StrictFloat, Field(gt=0)],
593
+ Annotated[StrictFloat, Field(gt=0)]
594
+ ]
595
+ ] = None,
596
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
597
+ _content_type: Optional[StrictStr] = None,
598
+ _headers: Optional[Dict[StrictStr, Any]] = None,
599
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
600
+ ) -> Extractor:
601
+ """Fetch an extractor by ID
602
+
603
+ This endpoint retrieves information about a specific extractor based on its unique ID. It requires an authenticated user and returns a JSON response containing the extractor's details.
604
+
605
+ :param extractor_id: ID of the extractor to get. (required)
606
+ :type extractor_id: str
607
+ :param _request_timeout: timeout setting for this request. If one
608
+ number provided, it will be total request
609
+ timeout. It can also be a pair (tuple) of
610
+ (connection, read) timeouts.
611
+ :type _request_timeout: int, tuple(int, int), optional
612
+ :param _request_auth: set to override the auth_settings for an a single
613
+ request; this effectively ignores the
614
+ authentication in the spec for a single request.
615
+ :type _request_auth: dict, optional
616
+ :param _content_type: force content-type for the request.
617
+ :type _content_type: str, Optional
618
+ :param _headers: set to override the headers for a single
619
+ request; this effectively ignores the headers
620
+ in the spec for a single request.
621
+ :type _headers: dict, optional
622
+ :param _host_index: set to override the host_index for a single
623
+ request; this effectively ignores the host_index
624
+ in the spec for a single request.
625
+ :type _host_index: int, optional
626
+ :return: Returns the result object.
627
+ """ # noqa: E501
628
+
629
+ _param = self._get_extractor_serialize(
630
+ extractor_id=extractor_id,
631
+ _request_auth=_request_auth,
632
+ _content_type=_content_type,
633
+ _headers=_headers,
634
+ _host_index=_host_index
635
+ )
636
+
637
+ _response_types_map: Dict[str, Optional[str]] = {
638
+ '200': "Extractor",
639
+ '401': "EndpointError",
640
+ '404': "EndpointError",
641
+ }
642
+ response_data = self.api_client.call_api(
643
+ *_param,
644
+ _request_timeout=_request_timeout
645
+ )
646
+ response_data.read()
647
+ return self.api_client.response_deserialize(
648
+ response_data=response_data,
649
+ response_types_map=_response_types_map,
650
+ ).data
651
+
652
+
653
+ @validate_call
654
+ def get_extractor_with_http_info(
655
+ self,
656
+ extractor_id: Annotated[StrictStr, Field(description="ID of the extractor to get.")],
657
+ _request_timeout: Union[
658
+ None,
659
+ Annotated[StrictFloat, Field(gt=0)],
660
+ Tuple[
661
+ Annotated[StrictFloat, Field(gt=0)],
662
+ Annotated[StrictFloat, Field(gt=0)]
663
+ ]
664
+ ] = None,
665
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
666
+ _content_type: Optional[StrictStr] = None,
667
+ _headers: Optional[Dict[StrictStr, Any]] = None,
668
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
669
+ ) -> ApiResponse[Extractor]:
670
+ """Fetch an extractor by ID
671
+
672
+ This endpoint retrieves information about a specific extractor based on its unique ID. It requires an authenticated user and returns a JSON response containing the extractor's details.
673
+
674
+ :param extractor_id: ID of the extractor to get. (required)
675
+ :type extractor_id: str
676
+ :param _request_timeout: timeout setting for this request. If one
677
+ number provided, it will be total request
678
+ timeout. It can also be a pair (tuple) of
679
+ (connection, read) timeouts.
680
+ :type _request_timeout: int, tuple(int, int), optional
681
+ :param _request_auth: set to override the auth_settings for an a single
682
+ request; this effectively ignores the
683
+ authentication in the spec for a single request.
684
+ :type _request_auth: dict, optional
685
+ :param _content_type: force content-type for the request.
686
+ :type _content_type: str, Optional
687
+ :param _headers: set to override the headers for a single
688
+ request; this effectively ignores the headers
689
+ in the spec for a single request.
690
+ :type _headers: dict, optional
691
+ :param _host_index: set to override the host_index for a single
692
+ request; this effectively ignores the host_index
693
+ in the spec for a single request.
694
+ :type _host_index: int, optional
695
+ :return: Returns the result object.
696
+ """ # noqa: E501
697
+
698
+ _param = self._get_extractor_serialize(
699
+ extractor_id=extractor_id,
700
+ _request_auth=_request_auth,
701
+ _content_type=_content_type,
702
+ _headers=_headers,
703
+ _host_index=_host_index
704
+ )
705
+
706
+ _response_types_map: Dict[str, Optional[str]] = {
707
+ '200': "Extractor",
708
+ '401': "EndpointError",
709
+ '404': "EndpointError",
710
+ }
711
+ response_data = self.api_client.call_api(
712
+ *_param,
713
+ _request_timeout=_request_timeout
714
+ )
715
+ response_data.read()
716
+ return self.api_client.response_deserialize(
717
+ response_data=response_data,
718
+ response_types_map=_response_types_map,
719
+ )
720
+
721
+
722
+ @validate_call
723
+ def get_extractor_without_preload_content(
724
+ self,
725
+ extractor_id: Annotated[StrictStr, Field(description="ID of the extractor to get.")],
726
+ _request_timeout: Union[
727
+ None,
728
+ Annotated[StrictFloat, Field(gt=0)],
729
+ Tuple[
730
+ Annotated[StrictFloat, Field(gt=0)],
731
+ Annotated[StrictFloat, Field(gt=0)]
732
+ ]
733
+ ] = None,
734
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
735
+ _content_type: Optional[StrictStr] = None,
736
+ _headers: Optional[Dict[StrictStr, Any]] = None,
737
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
738
+ ) -> RESTResponseType:
739
+ """Fetch an extractor by ID
740
+
741
+ This endpoint retrieves information about a specific extractor based on its unique ID. It requires an authenticated user and returns a JSON response containing the extractor's details.
742
+
743
+ :param extractor_id: ID of the extractor to get. (required)
744
+ :type extractor_id: str
745
+ :param _request_timeout: timeout setting for this request. If one
746
+ number provided, it will be total request
747
+ timeout. It can also be a pair (tuple) of
748
+ (connection, read) timeouts.
749
+ :type _request_timeout: int, tuple(int, int), optional
750
+ :param _request_auth: set to override the auth_settings for an a single
751
+ request; this effectively ignores the
752
+ authentication in the spec for a single request.
753
+ :type _request_auth: dict, optional
754
+ :param _content_type: force content-type for the request.
755
+ :type _content_type: str, Optional
756
+ :param _headers: set to override the headers for a single
757
+ request; this effectively ignores the headers
758
+ in the spec for a single request.
759
+ :type _headers: dict, optional
760
+ :param _host_index: set to override the host_index for a single
761
+ request; this effectively ignores the host_index
762
+ in the spec for a single request.
763
+ :type _host_index: int, optional
764
+ :return: Returns the result object.
765
+ """ # noqa: E501
766
+
767
+ _param = self._get_extractor_serialize(
768
+ extractor_id=extractor_id,
769
+ _request_auth=_request_auth,
770
+ _content_type=_content_type,
771
+ _headers=_headers,
772
+ _host_index=_host_index
773
+ )
774
+
775
+ _response_types_map: Dict[str, Optional[str]] = {
776
+ '200': "Extractor",
777
+ '401': "EndpointError",
778
+ '404': "EndpointError",
779
+ }
780
+ response_data = self.api_client.call_api(
781
+ *_param,
782
+ _request_timeout=_request_timeout
783
+ )
784
+ return response_data.response
785
+
786
+
787
+ def _get_extractor_serialize(
788
+ self,
789
+ extractor_id,
790
+ _request_auth,
791
+ _content_type,
792
+ _headers,
793
+ _host_index,
794
+ ) -> RequestSerialized:
795
+
796
+ _host = None
797
+
798
+ _collection_formats: Dict[str, str] = {
799
+ }
800
+
801
+ _path_params: Dict[str, str] = {}
802
+ _query_params: List[Tuple[str, str]] = []
803
+ _header_params: Dict[str, Optional[str]] = _headers or {}
804
+ _form_params: List[Tuple[str, str]] = []
805
+ _files: Dict[
806
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
807
+ ] = {}
808
+ _body_params: Optional[bytes] = None
809
+
810
+ # process the path parameters
811
+ if extractor_id is not None:
812
+ _path_params['extractor_id'] = extractor_id
813
+ # process the query parameters
814
+ # process the header parameters
815
+ # process the form parameters
816
+ # process the body parameter
817
+
818
+
819
+ # set the HTTP header `Accept`
820
+ if 'Accept' not in _header_params:
821
+ _header_params['Accept'] = self.api_client.select_header_accept(
822
+ [
823
+ 'application/json'
824
+ ]
825
+ )
826
+
827
+
828
+ # authentication setting
829
+ _auth_settings: List[str] = [
830
+ 'bearerAuth'
831
+ ]
832
+
833
+ return self.api_client.param_serialize(
834
+ method='GET',
835
+ resource_path='/extractors/{extractor_id}',
836
+ path_params=_path_params,
837
+ query_params=_query_params,
838
+ header_params=_header_params,
839
+ body=_body_params,
840
+ post_params=_form_params,
841
+ files=_files,
842
+ auth_settings=_auth_settings,
843
+ collection_formats=_collection_formats,
844
+ _host=_host,
845
+ _request_auth=_request_auth
846
+ )
847
+
848
+
849
+
850
+
851
+ @validate_call
852
+ def list_extractors(
853
+ self,
854
+ offset: Annotated[Optional[StrictInt], Field(description="How many extractors to skip before returning.")] = None,
855
+ limit: Annotated[Optional[StrictInt], Field(description="How many extractors to return.")] = None,
856
+ name_filter: Annotated[Optional[StrictStr], Field(description="Filter extractors by name.")] = None,
857
+ _request_timeout: Union[
858
+ None,
859
+ Annotated[StrictFloat, Field(gt=0)],
860
+ Tuple[
861
+ Annotated[StrictFloat, Field(gt=0)],
862
+ Annotated[StrictFloat, Field(gt=0)]
863
+ ]
864
+ ] = None,
865
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
866
+ _content_type: Optional[StrictStr] = None,
867
+ _headers: Optional[Dict[StrictStr, Any]] = None,
868
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
869
+ ) -> List[Extractor]:
870
+ """List extractors.
871
+
872
+ List extractors. The output is sorted by create time in descending order.
873
+
874
+ :param offset: How many extractors to skip before returning.
875
+ :type offset: int
876
+ :param limit: How many extractors to return.
877
+ :type limit: int
878
+ :param name_filter: Filter extractors by name.
879
+ :type name_filter: str
880
+ :param _request_timeout: timeout setting for this request. If one
881
+ number provided, it will be total request
882
+ timeout. It can also be a pair (tuple) of
883
+ (connection, read) timeouts.
884
+ :type _request_timeout: int, tuple(int, int), optional
885
+ :param _request_auth: set to override the auth_settings for an a single
886
+ request; this effectively ignores the
887
+ authentication in the spec for a single request.
888
+ :type _request_auth: dict, optional
889
+ :param _content_type: force content-type for the request.
890
+ :type _content_type: str, Optional
891
+ :param _headers: set to override the headers for a single
892
+ request; this effectively ignores the headers
893
+ in the spec for a single request.
894
+ :type _headers: dict, optional
895
+ :param _host_index: set to override the host_index for a single
896
+ request; this effectively ignores the host_index
897
+ in the spec for a single request.
898
+ :type _host_index: int, optional
899
+ :return: Returns the result object.
900
+ """ # noqa: E501
901
+
902
+ _param = self._list_extractors_serialize(
903
+ offset=offset,
904
+ limit=limit,
905
+ name_filter=name_filter,
906
+ _request_auth=_request_auth,
907
+ _content_type=_content_type,
908
+ _headers=_headers,
909
+ _host_index=_host_index
910
+ )
911
+
912
+ _response_types_map: Dict[str, Optional[str]] = {
913
+ '200': "List[Extractor]",
914
+ '401': "EndpointError",
915
+ }
916
+ response_data = self.api_client.call_api(
917
+ *_param,
918
+ _request_timeout=_request_timeout
919
+ )
920
+ response_data.read()
921
+ return self.api_client.response_deserialize(
922
+ response_data=response_data,
923
+ response_types_map=_response_types_map,
924
+ ).data
925
+
926
+
927
+ @validate_call
928
+ def list_extractors_with_http_info(
929
+ self,
930
+ offset: Annotated[Optional[StrictInt], Field(description="How many extractors to skip before returning.")] = None,
931
+ limit: Annotated[Optional[StrictInt], Field(description="How many extractors to return.")] = None,
932
+ name_filter: Annotated[Optional[StrictStr], Field(description="Filter extractors by name.")] = None,
933
+ _request_timeout: Union[
934
+ None,
935
+ Annotated[StrictFloat, Field(gt=0)],
936
+ Tuple[
937
+ Annotated[StrictFloat, Field(gt=0)],
938
+ Annotated[StrictFloat, Field(gt=0)]
939
+ ]
940
+ ] = None,
941
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
942
+ _content_type: Optional[StrictStr] = None,
943
+ _headers: Optional[Dict[StrictStr, Any]] = None,
944
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
945
+ ) -> ApiResponse[List[Extractor]]:
946
+ """List extractors.
947
+
948
+ List extractors. The output is sorted by create time in descending order.
949
+
950
+ :param offset: How many extractors to skip before returning.
951
+ :type offset: int
952
+ :param limit: How many extractors to return.
953
+ :type limit: int
954
+ :param name_filter: Filter extractors by name.
955
+ :type name_filter: str
956
+ :param _request_timeout: timeout setting for this request. If one
957
+ number provided, it will be total request
958
+ timeout. It can also be a pair (tuple) of
959
+ (connection, read) timeouts.
960
+ :type _request_timeout: int, tuple(int, int), optional
961
+ :param _request_auth: set to override the auth_settings for an a single
962
+ request; this effectively ignores the
963
+ authentication in the spec for a single request.
964
+ :type _request_auth: dict, optional
965
+ :param _content_type: force content-type for the request.
966
+ :type _content_type: str, Optional
967
+ :param _headers: set to override the headers for a single
968
+ request; this effectively ignores the headers
969
+ in the spec for a single request.
970
+ :type _headers: dict, optional
971
+ :param _host_index: set to override the host_index for a single
972
+ request; this effectively ignores the host_index
973
+ in the spec for a single request.
974
+ :type _host_index: int, optional
975
+ :return: Returns the result object.
976
+ """ # noqa: E501
977
+
978
+ _param = self._list_extractors_serialize(
979
+ offset=offset,
980
+ limit=limit,
981
+ name_filter=name_filter,
982
+ _request_auth=_request_auth,
983
+ _content_type=_content_type,
984
+ _headers=_headers,
985
+ _host_index=_host_index
986
+ )
987
+
988
+ _response_types_map: Dict[str, Optional[str]] = {
989
+ '200': "List[Extractor]",
990
+ '401': "EndpointError",
991
+ }
992
+ response_data = self.api_client.call_api(
993
+ *_param,
994
+ _request_timeout=_request_timeout
995
+ )
996
+ response_data.read()
997
+ return self.api_client.response_deserialize(
998
+ response_data=response_data,
999
+ response_types_map=_response_types_map,
1000
+ )
1001
+
1002
+
1003
+ @validate_call
1004
+ def list_extractors_without_preload_content(
1005
+ self,
1006
+ offset: Annotated[Optional[StrictInt], Field(description="How many extractors to skip before returning.")] = None,
1007
+ limit: Annotated[Optional[StrictInt], Field(description="How many extractors to return.")] = None,
1008
+ name_filter: Annotated[Optional[StrictStr], Field(description="Filter extractors by name.")] = None,
1009
+ _request_timeout: Union[
1010
+ None,
1011
+ Annotated[StrictFloat, Field(gt=0)],
1012
+ Tuple[
1013
+ Annotated[StrictFloat, Field(gt=0)],
1014
+ Annotated[StrictFloat, Field(gt=0)]
1015
+ ]
1016
+ ] = None,
1017
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1018
+ _content_type: Optional[StrictStr] = None,
1019
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1020
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1021
+ ) -> RESTResponseType:
1022
+ """List extractors.
1023
+
1024
+ List extractors. The output is sorted by create time in descending order.
1025
+
1026
+ :param offset: How many extractors to skip before returning.
1027
+ :type offset: int
1028
+ :param limit: How many extractors to return.
1029
+ :type limit: int
1030
+ :param name_filter: Filter extractors by name.
1031
+ :type name_filter: str
1032
+ :param _request_timeout: timeout setting for this request. If one
1033
+ number provided, it will be total request
1034
+ timeout. It can also be a pair (tuple) of
1035
+ (connection, read) timeouts.
1036
+ :type _request_timeout: int, tuple(int, int), optional
1037
+ :param _request_auth: set to override the auth_settings for an a single
1038
+ request; this effectively ignores the
1039
+ authentication in the spec for a single request.
1040
+ :type _request_auth: dict, optional
1041
+ :param _content_type: force content-type for the request.
1042
+ :type _content_type: str, Optional
1043
+ :param _headers: set to override the headers for a single
1044
+ request; this effectively ignores the headers
1045
+ in the spec for a single request.
1046
+ :type _headers: dict, optional
1047
+ :param _host_index: set to override the host_index for a single
1048
+ request; this effectively ignores the host_index
1049
+ in the spec for a single request.
1050
+ :type _host_index: int, optional
1051
+ :return: Returns the result object.
1052
+ """ # noqa: E501
1053
+
1054
+ _param = self._list_extractors_serialize(
1055
+ offset=offset,
1056
+ limit=limit,
1057
+ name_filter=name_filter,
1058
+ _request_auth=_request_auth,
1059
+ _content_type=_content_type,
1060
+ _headers=_headers,
1061
+ _host_index=_host_index
1062
+ )
1063
+
1064
+ _response_types_map: Dict[str, Optional[str]] = {
1065
+ '200': "List[Extractor]",
1066
+ '401': "EndpointError",
1067
+ }
1068
+ response_data = self.api_client.call_api(
1069
+ *_param,
1070
+ _request_timeout=_request_timeout
1071
+ )
1072
+ return response_data.response
1073
+
1074
+
1075
+ def _list_extractors_serialize(
1076
+ self,
1077
+ offset,
1078
+ limit,
1079
+ name_filter,
1080
+ _request_auth,
1081
+ _content_type,
1082
+ _headers,
1083
+ _host_index,
1084
+ ) -> RequestSerialized:
1085
+
1086
+ _host = None
1087
+
1088
+ _collection_formats: Dict[str, str] = {
1089
+ }
1090
+
1091
+ _path_params: Dict[str, str] = {}
1092
+ _query_params: List[Tuple[str, str]] = []
1093
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1094
+ _form_params: List[Tuple[str, str]] = []
1095
+ _files: Dict[
1096
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1097
+ ] = {}
1098
+ _body_params: Optional[bytes] = None
1099
+
1100
+ # process the path parameters
1101
+ # process the query parameters
1102
+ if offset is not None:
1103
+
1104
+ _query_params.append(('offset', offset))
1105
+
1106
+ if limit is not None:
1107
+
1108
+ _query_params.append(('limit', limit))
1109
+
1110
+ if name_filter is not None:
1111
+
1112
+ _query_params.append(('name_filter', name_filter))
1113
+
1114
+ # process the header parameters
1115
+ # process the form parameters
1116
+ # process the body parameter
1117
+
1118
+
1119
+ # set the HTTP header `Accept`
1120
+ if 'Accept' not in _header_params:
1121
+ _header_params['Accept'] = self.api_client.select_header_accept(
1122
+ [
1123
+ 'application/json'
1124
+ ]
1125
+ )
1126
+
1127
+
1128
+ # authentication setting
1129
+ _auth_settings: List[str] = [
1130
+ 'bearerAuth'
1131
+ ]
1132
+
1133
+ return self.api_client.param_serialize(
1134
+ method='GET',
1135
+ resource_path='/extractors',
1136
+ path_params=_path_params,
1137
+ query_params=_query_params,
1138
+ header_params=_header_params,
1139
+ body=_body_params,
1140
+ post_params=_form_params,
1141
+ files=_files,
1142
+ auth_settings=_auth_settings,
1143
+ collection_formats=_collection_formats,
1144
+ _host=_host,
1145
+ _request_auth=_request_auth
1146
+ )
1147
+
1148
+