ksapi 1.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.
ksapi/__init__.py ADDED
@@ -0,0 +1,50 @@
1
+ # coding: utf-8
2
+
3
+ # flake8: noqa
4
+
5
+ """
6
+ Knowledge Stack API
7
+
8
+ Knowledge Stack backend API for authentication and knowledge management
9
+
10
+ The version of the OpenAPI document: 0.1.0
11
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
12
+
13
+ Do not edit the class manually.
14
+ """ # noqa: E501
15
+
16
+
17
+ __version__ = "1.0.0"
18
+
19
+ # Define package exports
20
+ __all__ = [
21
+ "DefaultApi",
22
+ "ApiResponse",
23
+ "ApiClient",
24
+ "Configuration",
25
+ "OpenApiException",
26
+ "ApiTypeError",
27
+ "ApiValueError",
28
+ "ApiKeyError",
29
+ "ApiAttributeError",
30
+ "ApiException",
31
+ "HealthCheckResponse",
32
+ ]
33
+
34
+ # import apis into sdk package
35
+ from ksapi.api.default_api import DefaultApi as DefaultApi
36
+
37
+ # import ApiClient
38
+ from ksapi.api_response import ApiResponse as ApiResponse
39
+ from ksapi.api_client import ApiClient as ApiClient
40
+ from ksapi.configuration import Configuration as Configuration
41
+ from ksapi.exceptions import OpenApiException as OpenApiException
42
+ from ksapi.exceptions import ApiTypeError as ApiTypeError
43
+ from ksapi.exceptions import ApiValueError as ApiValueError
44
+ from ksapi.exceptions import ApiKeyError as ApiKeyError
45
+ from ksapi.exceptions import ApiAttributeError as ApiAttributeError
46
+ from ksapi.exceptions import ApiException as ApiException
47
+
48
+ # import models into sdk package
49
+ from ksapi.models.health_check_response import HealthCheckResponse as HealthCheckResponse
50
+
ksapi/api/__init__.py ADDED
@@ -0,0 +1,5 @@
1
+ # flake8: noqa
2
+
3
+ # import apis into api package
4
+ from ksapi.api.default_api import DefaultApi
5
+
@@ -0,0 +1,527 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Knowledge Stack API
5
+
6
+ Knowledge Stack backend API for authentication and knowledge management
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 typing import Any
20
+ from ksapi.models.health_check_response import HealthCheckResponse
21
+
22
+ from ksapi.api_client import ApiClient, RequestSerialized
23
+ from ksapi.api_response import ApiResponse
24
+ from ksapi.rest import RESTResponseType
25
+
26
+
27
+ class DefaultApi:
28
+ """NOTE: This class is auto generated by OpenAPI Generator
29
+ Ref: https://openapi-generator.tech
30
+
31
+ Do not edit the class manually.
32
+ """
33
+
34
+ def __init__(self, api_client=None) -> None:
35
+ if api_client is None:
36
+ api_client = ApiClient.get_default()
37
+ self.api_client = api_client
38
+
39
+
40
+ @validate_call
41
+ def health_check_healthz_get(
42
+ self,
43
+ _request_timeout: Union[
44
+ None,
45
+ Annotated[StrictFloat, Field(gt=0)],
46
+ Tuple[
47
+ Annotated[StrictFloat, Field(gt=0)],
48
+ Annotated[StrictFloat, Field(gt=0)]
49
+ ]
50
+ ] = None,
51
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
52
+ _content_type: Optional[StrictStr] = None,
53
+ _headers: Optional[Dict[StrictStr, Any]] = None,
54
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
55
+ ) -> HealthCheckResponse:
56
+ """Health Check
57
+
58
+ Health check endpoint.
59
+
60
+ :param _request_timeout: timeout setting for this request. If one
61
+ number provided, it will be total request
62
+ timeout. It can also be a pair (tuple) of
63
+ (connection, read) timeouts.
64
+ :type _request_timeout: int, tuple(int, int), optional
65
+ :param _request_auth: set to override the auth_settings for an a single
66
+ request; this effectively ignores the
67
+ authentication in the spec for a single request.
68
+ :type _request_auth: dict, optional
69
+ :param _content_type: force content-type for the request.
70
+ :type _content_type: str, Optional
71
+ :param _headers: set to override the headers for a single
72
+ request; this effectively ignores the headers
73
+ in the spec for a single request.
74
+ :type _headers: dict, optional
75
+ :param _host_index: set to override the host_index for a single
76
+ request; this effectively ignores the host_index
77
+ in the spec for a single request.
78
+ :type _host_index: int, optional
79
+ :return: Returns the result object.
80
+ """ # noqa: E501
81
+
82
+ _param = self._health_check_healthz_get_serialize(
83
+ _request_auth=_request_auth,
84
+ _content_type=_content_type,
85
+ _headers=_headers,
86
+ _host_index=_host_index
87
+ )
88
+
89
+ _response_types_map: Dict[str, Optional[str]] = {
90
+ '200': "HealthCheckResponse",
91
+ }
92
+ response_data = self.api_client.call_api(
93
+ *_param,
94
+ _request_timeout=_request_timeout
95
+ )
96
+ response_data.read()
97
+ return self.api_client.response_deserialize(
98
+ response_data=response_data,
99
+ response_types_map=_response_types_map,
100
+ ).data
101
+
102
+
103
+ @validate_call
104
+ def health_check_healthz_get_with_http_info(
105
+ self,
106
+ _request_timeout: Union[
107
+ None,
108
+ Annotated[StrictFloat, Field(gt=0)],
109
+ Tuple[
110
+ Annotated[StrictFloat, Field(gt=0)],
111
+ Annotated[StrictFloat, Field(gt=0)]
112
+ ]
113
+ ] = None,
114
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
115
+ _content_type: Optional[StrictStr] = None,
116
+ _headers: Optional[Dict[StrictStr, Any]] = None,
117
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
118
+ ) -> ApiResponse[HealthCheckResponse]:
119
+ """Health Check
120
+
121
+ Health check endpoint.
122
+
123
+ :param _request_timeout: timeout setting for this request. If one
124
+ number provided, it will be total request
125
+ timeout. It can also be a pair (tuple) of
126
+ (connection, read) timeouts.
127
+ :type _request_timeout: int, tuple(int, int), optional
128
+ :param _request_auth: set to override the auth_settings for an a single
129
+ request; this effectively ignores the
130
+ authentication in the spec for a single request.
131
+ :type _request_auth: dict, optional
132
+ :param _content_type: force content-type for the request.
133
+ :type _content_type: str, Optional
134
+ :param _headers: set to override the headers for a single
135
+ request; this effectively ignores the headers
136
+ in the spec for a single request.
137
+ :type _headers: dict, optional
138
+ :param _host_index: set to override the host_index for a single
139
+ request; this effectively ignores the host_index
140
+ in the spec for a single request.
141
+ :type _host_index: int, optional
142
+ :return: Returns the result object.
143
+ """ # noqa: E501
144
+
145
+ _param = self._health_check_healthz_get_serialize(
146
+ _request_auth=_request_auth,
147
+ _content_type=_content_type,
148
+ _headers=_headers,
149
+ _host_index=_host_index
150
+ )
151
+
152
+ _response_types_map: Dict[str, Optional[str]] = {
153
+ '200': "HealthCheckResponse",
154
+ }
155
+ response_data = self.api_client.call_api(
156
+ *_param,
157
+ _request_timeout=_request_timeout
158
+ )
159
+ response_data.read()
160
+ return self.api_client.response_deserialize(
161
+ response_data=response_data,
162
+ response_types_map=_response_types_map,
163
+ )
164
+
165
+
166
+ @validate_call
167
+ def health_check_healthz_get_without_preload_content(
168
+ self,
169
+ _request_timeout: Union[
170
+ None,
171
+ Annotated[StrictFloat, Field(gt=0)],
172
+ Tuple[
173
+ Annotated[StrictFloat, Field(gt=0)],
174
+ Annotated[StrictFloat, Field(gt=0)]
175
+ ]
176
+ ] = None,
177
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
178
+ _content_type: Optional[StrictStr] = None,
179
+ _headers: Optional[Dict[StrictStr, Any]] = None,
180
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
181
+ ) -> RESTResponseType:
182
+ """Health Check
183
+
184
+ Health check endpoint.
185
+
186
+ :param _request_timeout: timeout setting for this request. If one
187
+ number provided, it will be total request
188
+ timeout. It can also be a pair (tuple) of
189
+ (connection, read) timeouts.
190
+ :type _request_timeout: int, tuple(int, int), optional
191
+ :param _request_auth: set to override the auth_settings for an a single
192
+ request; this effectively ignores the
193
+ authentication in the spec for a single request.
194
+ :type _request_auth: dict, optional
195
+ :param _content_type: force content-type for the request.
196
+ :type _content_type: str, Optional
197
+ :param _headers: set to override the headers for a single
198
+ request; this effectively ignores the headers
199
+ in the spec for a single request.
200
+ :type _headers: dict, optional
201
+ :param _host_index: set to override the host_index for a single
202
+ request; this effectively ignores the host_index
203
+ in the spec for a single request.
204
+ :type _host_index: int, optional
205
+ :return: Returns the result object.
206
+ """ # noqa: E501
207
+
208
+ _param = self._health_check_healthz_get_serialize(
209
+ _request_auth=_request_auth,
210
+ _content_type=_content_type,
211
+ _headers=_headers,
212
+ _host_index=_host_index
213
+ )
214
+
215
+ _response_types_map: Dict[str, Optional[str]] = {
216
+ '200': "HealthCheckResponse",
217
+ }
218
+ response_data = self.api_client.call_api(
219
+ *_param,
220
+ _request_timeout=_request_timeout
221
+ )
222
+ return response_data.response
223
+
224
+
225
+ def _health_check_healthz_get_serialize(
226
+ self,
227
+ _request_auth,
228
+ _content_type,
229
+ _headers,
230
+ _host_index,
231
+ ) -> RequestSerialized:
232
+
233
+ _host = None
234
+
235
+ _collection_formats: Dict[str, str] = {
236
+ }
237
+
238
+ _path_params: Dict[str, str] = {}
239
+ _query_params: List[Tuple[str, str]] = []
240
+ _header_params: Dict[str, Optional[str]] = _headers or {}
241
+ _form_params: List[Tuple[str, str]] = []
242
+ _files: Dict[
243
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
244
+ ] = {}
245
+ _body_params: Optional[bytes] = None
246
+
247
+ # process the path parameters
248
+ # process the query parameters
249
+ # process the header parameters
250
+ # process the form parameters
251
+ # process the body parameter
252
+
253
+
254
+ # set the HTTP header `Accept`
255
+ if 'Accept' not in _header_params:
256
+ _header_params['Accept'] = self.api_client.select_header_accept(
257
+ [
258
+ 'application/json'
259
+ ]
260
+ )
261
+
262
+
263
+ # authentication setting
264
+ _auth_settings: List[str] = [
265
+ ]
266
+
267
+ return self.api_client.param_serialize(
268
+ method='GET',
269
+ resource_path='/healthz',
270
+ path_params=_path_params,
271
+ query_params=_query_params,
272
+ header_params=_header_params,
273
+ body=_body_params,
274
+ post_params=_form_params,
275
+ files=_files,
276
+ auth_settings=_auth_settings,
277
+ collection_formats=_collection_formats,
278
+ _host=_host,
279
+ _request_auth=_request_auth
280
+ )
281
+
282
+
283
+
284
+
285
+ @validate_call
286
+ def root_get(
287
+ self,
288
+ _request_timeout: Union[
289
+ None,
290
+ Annotated[StrictFloat, Field(gt=0)],
291
+ Tuple[
292
+ Annotated[StrictFloat, Field(gt=0)],
293
+ Annotated[StrictFloat, Field(gt=0)]
294
+ ]
295
+ ] = None,
296
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
297
+ _content_type: Optional[StrictStr] = None,
298
+ _headers: Optional[Dict[StrictStr, Any]] = None,
299
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
300
+ ) -> object:
301
+ """Root
302
+
303
+ Root endpoint.
304
+
305
+ :param _request_timeout: timeout setting for this request. If one
306
+ number provided, it will be total request
307
+ timeout. It can also be a pair (tuple) of
308
+ (connection, read) timeouts.
309
+ :type _request_timeout: int, tuple(int, int), optional
310
+ :param _request_auth: set to override the auth_settings for an a single
311
+ request; this effectively ignores the
312
+ authentication in the spec for a single request.
313
+ :type _request_auth: dict, optional
314
+ :param _content_type: force content-type for the request.
315
+ :type _content_type: str, Optional
316
+ :param _headers: set to override the headers for a single
317
+ request; this effectively ignores the headers
318
+ in the spec for a single request.
319
+ :type _headers: dict, optional
320
+ :param _host_index: set to override the host_index for a single
321
+ request; this effectively ignores the host_index
322
+ in the spec for a single request.
323
+ :type _host_index: int, optional
324
+ :return: Returns the result object.
325
+ """ # noqa: E501
326
+
327
+ _param = self._root_get_serialize(
328
+ _request_auth=_request_auth,
329
+ _content_type=_content_type,
330
+ _headers=_headers,
331
+ _host_index=_host_index
332
+ )
333
+
334
+ _response_types_map: Dict[str, Optional[str]] = {
335
+ '200': "object",
336
+ }
337
+ response_data = self.api_client.call_api(
338
+ *_param,
339
+ _request_timeout=_request_timeout
340
+ )
341
+ response_data.read()
342
+ return self.api_client.response_deserialize(
343
+ response_data=response_data,
344
+ response_types_map=_response_types_map,
345
+ ).data
346
+
347
+
348
+ @validate_call
349
+ def root_get_with_http_info(
350
+ self,
351
+ _request_timeout: Union[
352
+ None,
353
+ Annotated[StrictFloat, Field(gt=0)],
354
+ Tuple[
355
+ Annotated[StrictFloat, Field(gt=0)],
356
+ Annotated[StrictFloat, Field(gt=0)]
357
+ ]
358
+ ] = None,
359
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
360
+ _content_type: Optional[StrictStr] = None,
361
+ _headers: Optional[Dict[StrictStr, Any]] = None,
362
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
363
+ ) -> ApiResponse[object]:
364
+ """Root
365
+
366
+ Root endpoint.
367
+
368
+ :param _request_timeout: timeout setting for this request. If one
369
+ number provided, it will be total request
370
+ timeout. It can also be a pair (tuple) of
371
+ (connection, read) timeouts.
372
+ :type _request_timeout: int, tuple(int, int), optional
373
+ :param _request_auth: set to override the auth_settings for an a single
374
+ request; this effectively ignores the
375
+ authentication in the spec for a single request.
376
+ :type _request_auth: dict, optional
377
+ :param _content_type: force content-type for the request.
378
+ :type _content_type: str, Optional
379
+ :param _headers: set to override the headers for a single
380
+ request; this effectively ignores the headers
381
+ in the spec for a single request.
382
+ :type _headers: dict, optional
383
+ :param _host_index: set to override the host_index for a single
384
+ request; this effectively ignores the host_index
385
+ in the spec for a single request.
386
+ :type _host_index: int, optional
387
+ :return: Returns the result object.
388
+ """ # noqa: E501
389
+
390
+ _param = self._root_get_serialize(
391
+ _request_auth=_request_auth,
392
+ _content_type=_content_type,
393
+ _headers=_headers,
394
+ _host_index=_host_index
395
+ )
396
+
397
+ _response_types_map: Dict[str, Optional[str]] = {
398
+ '200': "object",
399
+ }
400
+ response_data = self.api_client.call_api(
401
+ *_param,
402
+ _request_timeout=_request_timeout
403
+ )
404
+ response_data.read()
405
+ return self.api_client.response_deserialize(
406
+ response_data=response_data,
407
+ response_types_map=_response_types_map,
408
+ )
409
+
410
+
411
+ @validate_call
412
+ def root_get_without_preload_content(
413
+ self,
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
+ ) -> RESTResponseType:
427
+ """Root
428
+
429
+ Root endpoint.
430
+
431
+ :param _request_timeout: timeout setting for this request. If one
432
+ number provided, it will be total request
433
+ timeout. It can also be a pair (tuple) of
434
+ (connection, read) timeouts.
435
+ :type _request_timeout: int, tuple(int, int), optional
436
+ :param _request_auth: set to override the auth_settings for an a single
437
+ request; this effectively ignores the
438
+ authentication in the spec for a single request.
439
+ :type _request_auth: dict, optional
440
+ :param _content_type: force content-type for the request.
441
+ :type _content_type: str, Optional
442
+ :param _headers: set to override the headers for a single
443
+ request; this effectively ignores the headers
444
+ in the spec for a single request.
445
+ :type _headers: dict, optional
446
+ :param _host_index: set to override the host_index for a single
447
+ request; this effectively ignores the host_index
448
+ in the spec for a single request.
449
+ :type _host_index: int, optional
450
+ :return: Returns the result object.
451
+ """ # noqa: E501
452
+
453
+ _param = self._root_get_serialize(
454
+ _request_auth=_request_auth,
455
+ _content_type=_content_type,
456
+ _headers=_headers,
457
+ _host_index=_host_index
458
+ )
459
+
460
+ _response_types_map: Dict[str, Optional[str]] = {
461
+ '200': "object",
462
+ }
463
+ response_data = self.api_client.call_api(
464
+ *_param,
465
+ _request_timeout=_request_timeout
466
+ )
467
+ return response_data.response
468
+
469
+
470
+ def _root_get_serialize(
471
+ self,
472
+ _request_auth,
473
+ _content_type,
474
+ _headers,
475
+ _host_index,
476
+ ) -> RequestSerialized:
477
+
478
+ _host = None
479
+
480
+ _collection_formats: Dict[str, str] = {
481
+ }
482
+
483
+ _path_params: Dict[str, str] = {}
484
+ _query_params: List[Tuple[str, str]] = []
485
+ _header_params: Dict[str, Optional[str]] = _headers or {}
486
+ _form_params: List[Tuple[str, str]] = []
487
+ _files: Dict[
488
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
489
+ ] = {}
490
+ _body_params: Optional[bytes] = None
491
+
492
+ # process the path parameters
493
+ # process the query parameters
494
+ # process the header parameters
495
+ # process the form parameters
496
+ # process the body parameter
497
+
498
+
499
+ # set the HTTP header `Accept`
500
+ if 'Accept' not in _header_params:
501
+ _header_params['Accept'] = self.api_client.select_header_accept(
502
+ [
503
+ 'application/json'
504
+ ]
505
+ )
506
+
507
+
508
+ # authentication setting
509
+ _auth_settings: List[str] = [
510
+ ]
511
+
512
+ return self.api_client.param_serialize(
513
+ method='GET',
514
+ resource_path='/',
515
+ path_params=_path_params,
516
+ query_params=_query_params,
517
+ header_params=_header_params,
518
+ body=_body_params,
519
+ post_params=_form_params,
520
+ files=_files,
521
+ auth_settings=_auth_settings,
522
+ collection_formats=_collection_formats,
523
+ _host=_host,
524
+ _request_auth=_request_auth
525
+ )
526
+
527
+