daytona_api_client 0.24.1__py3-none-any.whl → 0.24.4__py3-none-any.whl

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

Potentially problematic release.


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

@@ -0,0 +1,885 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Daytona
5
+
6
+ Daytona AI platform API Docs
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Contact: support@daytona.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+ import warnings
16
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
17
+ from typing import Any, Dict, List, Optional, Tuple, Union
18
+ from typing_extensions import Annotated
19
+
20
+ from pydantic import Field, StrictFloat, StrictInt, StrictStr
21
+ from typing import Optional, Union
22
+ from typing_extensions import Annotated
23
+ from daytona_api_client.models.audit_log import AuditLog
24
+ from daytona_api_client.models.create_audit_log import CreateAuditLog
25
+ from daytona_api_client.models.paginated_audit_logs import PaginatedAuditLogs
26
+
27
+ from daytona_api_client.api_client import ApiClient, RequestSerialized
28
+ from daytona_api_client.api_response import ApiResponse
29
+ from daytona_api_client.rest import RESTResponseType
30
+
31
+
32
+ class AuditApi:
33
+ """NOTE: This class is auto generated by OpenAPI Generator
34
+ Ref: https://openapi-generator.tech
35
+
36
+ Do not edit the class manually.
37
+ """
38
+
39
+ def __init__(self, api_client=None) -> None:
40
+ if api_client is None:
41
+ api_client = ApiClient.get_default()
42
+ self.api_client = api_client
43
+
44
+
45
+ @validate_call
46
+ def create_audit_log(
47
+ self,
48
+ create_audit_log: CreateAuditLog,
49
+ _request_timeout: Union[
50
+ None,
51
+ Annotated[StrictFloat, Field(gt=0)],
52
+ Tuple[
53
+ Annotated[StrictFloat, Field(gt=0)],
54
+ Annotated[StrictFloat, Field(gt=0)]
55
+ ]
56
+ ] = None,
57
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
58
+ _content_type: Optional[StrictStr] = None,
59
+ _headers: Optional[Dict[StrictStr, Any]] = None,
60
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
61
+ ) -> AuditLog:
62
+ """Create audit log entry
63
+
64
+
65
+ :param create_audit_log: (required)
66
+ :type create_audit_log: CreateAuditLog
67
+ :param _request_timeout: timeout setting for this request. If one
68
+ number provided, it will be total request
69
+ timeout. It can also be a pair (tuple) of
70
+ (connection, read) timeouts.
71
+ :type _request_timeout: int, tuple(int, int), optional
72
+ :param _request_auth: set to override the auth_settings for an a single
73
+ request; this effectively ignores the
74
+ authentication in the spec for a single request.
75
+ :type _request_auth: dict, optional
76
+ :param _content_type: force content-type for the request.
77
+ :type _content_type: str, Optional
78
+ :param _headers: set to override the headers for a single
79
+ request; this effectively ignores the headers
80
+ in the spec for a single request.
81
+ :type _headers: dict, optional
82
+ :param _host_index: set to override the host_index for a single
83
+ request; this effectively ignores the host_index
84
+ in the spec for a single request.
85
+ :type _host_index: int, optional
86
+ :return: Returns the result object.
87
+ """ # noqa: E501
88
+
89
+ _param = self._create_audit_log_serialize(
90
+ create_audit_log=create_audit_log,
91
+ _request_auth=_request_auth,
92
+ _content_type=_content_type,
93
+ _headers=_headers,
94
+ _host_index=_host_index
95
+ )
96
+
97
+ _response_types_map: Dict[str, Optional[str]] = {
98
+ '201': "AuditLog",
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_audit_log_with_http_info(
113
+ self,
114
+ create_audit_log: CreateAuditLog,
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[AuditLog]:
128
+ """Create audit log entry
129
+
130
+
131
+ :param create_audit_log: (required)
132
+ :type create_audit_log: CreateAuditLog
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_audit_log_serialize(
156
+ create_audit_log=create_audit_log,
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
+ '201': "AuditLog",
165
+ }
166
+ response_data = self.api_client.call_api(
167
+ *_param,
168
+ _request_timeout=_request_timeout
169
+ )
170
+ response_data.read()
171
+ return self.api_client.response_deserialize(
172
+ response_data=response_data,
173
+ response_types_map=_response_types_map,
174
+ )
175
+
176
+
177
+ @validate_call
178
+ def create_audit_log_without_preload_content(
179
+ self,
180
+ create_audit_log: CreateAuditLog,
181
+ _request_timeout: Union[
182
+ None,
183
+ Annotated[StrictFloat, Field(gt=0)],
184
+ Tuple[
185
+ Annotated[StrictFloat, Field(gt=0)],
186
+ Annotated[StrictFloat, Field(gt=0)]
187
+ ]
188
+ ] = None,
189
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
190
+ _content_type: Optional[StrictStr] = None,
191
+ _headers: Optional[Dict[StrictStr, Any]] = None,
192
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
193
+ ) -> RESTResponseType:
194
+ """Create audit log entry
195
+
196
+
197
+ :param create_audit_log: (required)
198
+ :type create_audit_log: CreateAuditLog
199
+ :param _request_timeout: timeout setting for this request. If one
200
+ number provided, it will be total request
201
+ timeout. It can also be a pair (tuple) of
202
+ (connection, read) timeouts.
203
+ :type _request_timeout: int, tuple(int, int), optional
204
+ :param _request_auth: set to override the auth_settings for an a single
205
+ request; this effectively ignores the
206
+ authentication in the spec for a single request.
207
+ :type _request_auth: dict, optional
208
+ :param _content_type: force content-type for the request.
209
+ :type _content_type: str, Optional
210
+ :param _headers: set to override the headers for a single
211
+ request; this effectively ignores the headers
212
+ in the spec for a single request.
213
+ :type _headers: dict, optional
214
+ :param _host_index: set to override the host_index for a single
215
+ request; this effectively ignores the host_index
216
+ in the spec for a single request.
217
+ :type _host_index: int, optional
218
+ :return: Returns the result object.
219
+ """ # noqa: E501
220
+
221
+ _param = self._create_audit_log_serialize(
222
+ create_audit_log=create_audit_log,
223
+ _request_auth=_request_auth,
224
+ _content_type=_content_type,
225
+ _headers=_headers,
226
+ _host_index=_host_index
227
+ )
228
+
229
+ _response_types_map: Dict[str, Optional[str]] = {
230
+ '201': "AuditLog",
231
+ }
232
+ response_data = self.api_client.call_api(
233
+ *_param,
234
+ _request_timeout=_request_timeout
235
+ )
236
+ return response_data.response
237
+
238
+
239
+ def _create_audit_log_serialize(
240
+ self,
241
+ create_audit_log,
242
+ _request_auth,
243
+ _content_type,
244
+ _headers,
245
+ _host_index,
246
+ ) -> RequestSerialized:
247
+
248
+ _host = None
249
+
250
+ _collection_formats: Dict[str, str] = {
251
+ }
252
+
253
+ _path_params: Dict[str, str] = {}
254
+ _query_params: List[Tuple[str, str]] = []
255
+ _header_params: Dict[str, Optional[str]] = _headers or {}
256
+ _form_params: List[Tuple[str, str]] = []
257
+ _files: Dict[
258
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
259
+ ] = {}
260
+ _body_params: Optional[bytes] = None
261
+
262
+ # process the path parameters
263
+ # process the query parameters
264
+ # process the header parameters
265
+ # process the form parameters
266
+ # process the body parameter
267
+ if create_audit_log is not None:
268
+ _body_params = create_audit_log
269
+
270
+
271
+ # set the HTTP header `Accept`
272
+ if 'Accept' not in _header_params:
273
+ _header_params['Accept'] = self.api_client.select_header_accept(
274
+ [
275
+ 'application/json'
276
+ ]
277
+ )
278
+
279
+ # set the HTTP header `Content-Type`
280
+ if _content_type:
281
+ _header_params['Content-Type'] = _content_type
282
+ else:
283
+ _default_content_type = (
284
+ self.api_client.select_header_content_type(
285
+ [
286
+ 'application/json'
287
+ ]
288
+ )
289
+ )
290
+ if _default_content_type is not None:
291
+ _header_params['Content-Type'] = _default_content_type
292
+
293
+ # authentication setting
294
+ _auth_settings: List[str] = [
295
+ 'bearer',
296
+ 'oauth2'
297
+ ]
298
+
299
+ return self.api_client.param_serialize(
300
+ method='POST',
301
+ resource_path='/audit',
302
+ path_params=_path_params,
303
+ query_params=_query_params,
304
+ header_params=_header_params,
305
+ body=_body_params,
306
+ post_params=_form_params,
307
+ files=_files,
308
+ auth_settings=_auth_settings,
309
+ collection_formats=_collection_formats,
310
+ _host=_host,
311
+ _request_auth=_request_auth
312
+ )
313
+
314
+
315
+
316
+
317
+ @validate_call
318
+ def get_all_audit_logs(
319
+ self,
320
+ limit: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Number of items per page (default: 10)")] = None,
321
+ page: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Page number (default: 1)")] = None,
322
+ _request_timeout: Union[
323
+ None,
324
+ Annotated[StrictFloat, Field(gt=0)],
325
+ Tuple[
326
+ Annotated[StrictFloat, Field(gt=0)],
327
+ Annotated[StrictFloat, Field(gt=0)]
328
+ ]
329
+ ] = None,
330
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
331
+ _content_type: Optional[StrictStr] = None,
332
+ _headers: Optional[Dict[StrictStr, Any]] = None,
333
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
334
+ ) -> PaginatedAuditLogs:
335
+ """Get all audit logs
336
+
337
+
338
+ :param limit: Number of items per page (default: 10)
339
+ :type limit: float
340
+ :param page: Page number (default: 1)
341
+ :type page: float
342
+ :param _request_timeout: timeout setting for this request. If one
343
+ number provided, it will be total request
344
+ timeout. It can also be a pair (tuple) of
345
+ (connection, read) timeouts.
346
+ :type _request_timeout: int, tuple(int, int), optional
347
+ :param _request_auth: set to override the auth_settings for an a single
348
+ request; this effectively ignores the
349
+ authentication in the spec for a single request.
350
+ :type _request_auth: dict, optional
351
+ :param _content_type: force content-type for the request.
352
+ :type _content_type: str, Optional
353
+ :param _headers: set to override the headers for a single
354
+ request; this effectively ignores the headers
355
+ in the spec for a single request.
356
+ :type _headers: dict, optional
357
+ :param _host_index: set to override the host_index for a single
358
+ request; this effectively ignores the host_index
359
+ in the spec for a single request.
360
+ :type _host_index: int, optional
361
+ :return: Returns the result object.
362
+ """ # noqa: E501
363
+
364
+ _param = self._get_all_audit_logs_serialize(
365
+ limit=limit,
366
+ page=page,
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
+ '200': "PaginatedAuditLogs",
375
+ }
376
+ response_data = self.api_client.call_api(
377
+ *_param,
378
+ _request_timeout=_request_timeout
379
+ )
380
+ response_data.read()
381
+ return self.api_client.response_deserialize(
382
+ response_data=response_data,
383
+ response_types_map=_response_types_map,
384
+ ).data
385
+
386
+
387
+ @validate_call
388
+ def get_all_audit_logs_with_http_info(
389
+ self,
390
+ limit: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Number of items per page (default: 10)")] = None,
391
+ page: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Page number (default: 1)")] = None,
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[PaginatedAuditLogs]:
405
+ """Get all audit logs
406
+
407
+
408
+ :param limit: Number of items per page (default: 10)
409
+ :type limit: float
410
+ :param page: Page number (default: 1)
411
+ :type page: float
412
+ :param _request_timeout: timeout setting for this request. If one
413
+ number provided, it will be total request
414
+ timeout. It can also be a pair (tuple) of
415
+ (connection, read) timeouts.
416
+ :type _request_timeout: int, tuple(int, int), optional
417
+ :param _request_auth: set to override the auth_settings for an a single
418
+ request; this effectively ignores the
419
+ authentication in the spec for a single request.
420
+ :type _request_auth: dict, optional
421
+ :param _content_type: force content-type for the request.
422
+ :type _content_type: str, Optional
423
+ :param _headers: set to override the headers for a single
424
+ request; this effectively ignores the headers
425
+ in the spec for a single request.
426
+ :type _headers: dict, optional
427
+ :param _host_index: set to override the host_index for a single
428
+ request; this effectively ignores the host_index
429
+ in the spec for a single request.
430
+ :type _host_index: int, optional
431
+ :return: Returns the result object.
432
+ """ # noqa: E501
433
+
434
+ _param = self._get_all_audit_logs_serialize(
435
+ limit=limit,
436
+ page=page,
437
+ _request_auth=_request_auth,
438
+ _content_type=_content_type,
439
+ _headers=_headers,
440
+ _host_index=_host_index
441
+ )
442
+
443
+ _response_types_map: Dict[str, Optional[str]] = {
444
+ '200': "PaginatedAuditLogs",
445
+ }
446
+ response_data = self.api_client.call_api(
447
+ *_param,
448
+ _request_timeout=_request_timeout
449
+ )
450
+ response_data.read()
451
+ return self.api_client.response_deserialize(
452
+ response_data=response_data,
453
+ response_types_map=_response_types_map,
454
+ )
455
+
456
+
457
+ @validate_call
458
+ def get_all_audit_logs_without_preload_content(
459
+ self,
460
+ limit: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Number of items per page (default: 10)")] = None,
461
+ page: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Page number (default: 1)")] = None,
462
+ _request_timeout: Union[
463
+ None,
464
+ Annotated[StrictFloat, Field(gt=0)],
465
+ Tuple[
466
+ Annotated[StrictFloat, Field(gt=0)],
467
+ Annotated[StrictFloat, Field(gt=0)]
468
+ ]
469
+ ] = None,
470
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
471
+ _content_type: Optional[StrictStr] = None,
472
+ _headers: Optional[Dict[StrictStr, Any]] = None,
473
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
474
+ ) -> RESTResponseType:
475
+ """Get all audit logs
476
+
477
+
478
+ :param limit: Number of items per page (default: 10)
479
+ :type limit: float
480
+ :param page: Page number (default: 1)
481
+ :type page: float
482
+ :param _request_timeout: timeout setting for this request. If one
483
+ number provided, it will be total request
484
+ timeout. It can also be a pair (tuple) of
485
+ (connection, read) timeouts.
486
+ :type _request_timeout: int, tuple(int, int), optional
487
+ :param _request_auth: set to override the auth_settings for an a single
488
+ request; this effectively ignores the
489
+ authentication in the spec for a single request.
490
+ :type _request_auth: dict, optional
491
+ :param _content_type: force content-type for the request.
492
+ :type _content_type: str, Optional
493
+ :param _headers: set to override the headers for a single
494
+ request; this effectively ignores the headers
495
+ in the spec for a single request.
496
+ :type _headers: dict, optional
497
+ :param _host_index: set to override the host_index for a single
498
+ request; this effectively ignores the host_index
499
+ in the spec for a single request.
500
+ :type _host_index: int, optional
501
+ :return: Returns the result object.
502
+ """ # noqa: E501
503
+
504
+ _param = self._get_all_audit_logs_serialize(
505
+ limit=limit,
506
+ page=page,
507
+ _request_auth=_request_auth,
508
+ _content_type=_content_type,
509
+ _headers=_headers,
510
+ _host_index=_host_index
511
+ )
512
+
513
+ _response_types_map: Dict[str, Optional[str]] = {
514
+ '200': "PaginatedAuditLogs",
515
+ }
516
+ response_data = self.api_client.call_api(
517
+ *_param,
518
+ _request_timeout=_request_timeout
519
+ )
520
+ return response_data.response
521
+
522
+
523
+ def _get_all_audit_logs_serialize(
524
+ self,
525
+ limit,
526
+ page,
527
+ _request_auth,
528
+ _content_type,
529
+ _headers,
530
+ _host_index,
531
+ ) -> RequestSerialized:
532
+
533
+ _host = None
534
+
535
+ _collection_formats: Dict[str, str] = {
536
+ }
537
+
538
+ _path_params: Dict[str, str] = {}
539
+ _query_params: List[Tuple[str, str]] = []
540
+ _header_params: Dict[str, Optional[str]] = _headers or {}
541
+ _form_params: List[Tuple[str, str]] = []
542
+ _files: Dict[
543
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
544
+ ] = {}
545
+ _body_params: Optional[bytes] = None
546
+
547
+ # process the path parameters
548
+ # process the query parameters
549
+ if limit is not None:
550
+
551
+ _query_params.append(('limit', limit))
552
+
553
+ if page is not None:
554
+
555
+ _query_params.append(('page', page))
556
+
557
+ # process the header parameters
558
+ # process the form parameters
559
+ # process the body parameter
560
+
561
+
562
+ # set the HTTP header `Accept`
563
+ if 'Accept' not in _header_params:
564
+ _header_params['Accept'] = self.api_client.select_header_accept(
565
+ [
566
+ 'application/json'
567
+ ]
568
+ )
569
+
570
+
571
+ # authentication setting
572
+ _auth_settings: List[str] = [
573
+ 'bearer',
574
+ 'oauth2'
575
+ ]
576
+
577
+ return self.api_client.param_serialize(
578
+ method='GET',
579
+ resource_path='/audit',
580
+ path_params=_path_params,
581
+ query_params=_query_params,
582
+ header_params=_header_params,
583
+ body=_body_params,
584
+ post_params=_form_params,
585
+ files=_files,
586
+ auth_settings=_auth_settings,
587
+ collection_formats=_collection_formats,
588
+ _host=_host,
589
+ _request_auth=_request_auth
590
+ )
591
+
592
+
593
+
594
+
595
+ @validate_call
596
+ def get_organization_audit_logs(
597
+ self,
598
+ organization_id: Annotated[StrictStr, Field(description="Organization ID")],
599
+ limit: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Number of items per page (default: 10)")] = None,
600
+ page: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Page number (default: 1)")] = None,
601
+ _request_timeout: Union[
602
+ None,
603
+ Annotated[StrictFloat, Field(gt=0)],
604
+ Tuple[
605
+ Annotated[StrictFloat, Field(gt=0)],
606
+ Annotated[StrictFloat, Field(gt=0)]
607
+ ]
608
+ ] = None,
609
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
610
+ _content_type: Optional[StrictStr] = None,
611
+ _headers: Optional[Dict[StrictStr, Any]] = None,
612
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
613
+ ) -> PaginatedAuditLogs:
614
+ """Get audit logs for organization
615
+
616
+
617
+ :param organization_id: Organization ID (required)
618
+ :type organization_id: str
619
+ :param limit: Number of items per page (default: 10)
620
+ :type limit: float
621
+ :param page: Page number (default: 1)
622
+ :type page: float
623
+ :param _request_timeout: timeout setting for this request. If one
624
+ number provided, it will be total request
625
+ timeout. It can also be a pair (tuple) of
626
+ (connection, read) timeouts.
627
+ :type _request_timeout: int, tuple(int, int), optional
628
+ :param _request_auth: set to override the auth_settings for an a single
629
+ request; this effectively ignores the
630
+ authentication in the spec for a single request.
631
+ :type _request_auth: dict, optional
632
+ :param _content_type: force content-type for the request.
633
+ :type _content_type: str, Optional
634
+ :param _headers: set to override the headers for a single
635
+ request; this effectively ignores the headers
636
+ in the spec for a single request.
637
+ :type _headers: dict, optional
638
+ :param _host_index: set to override the host_index for a single
639
+ request; this effectively ignores the host_index
640
+ in the spec for a single request.
641
+ :type _host_index: int, optional
642
+ :return: Returns the result object.
643
+ """ # noqa: E501
644
+
645
+ _param = self._get_organization_audit_logs_serialize(
646
+ organization_id=organization_id,
647
+ limit=limit,
648
+ page=page,
649
+ _request_auth=_request_auth,
650
+ _content_type=_content_type,
651
+ _headers=_headers,
652
+ _host_index=_host_index
653
+ )
654
+
655
+ _response_types_map: Dict[str, Optional[str]] = {
656
+ '200': "PaginatedAuditLogs",
657
+ }
658
+ response_data = self.api_client.call_api(
659
+ *_param,
660
+ _request_timeout=_request_timeout
661
+ )
662
+ response_data.read()
663
+ return self.api_client.response_deserialize(
664
+ response_data=response_data,
665
+ response_types_map=_response_types_map,
666
+ ).data
667
+
668
+
669
+ @validate_call
670
+ def get_organization_audit_logs_with_http_info(
671
+ self,
672
+ organization_id: Annotated[StrictStr, Field(description="Organization ID")],
673
+ limit: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Number of items per page (default: 10)")] = None,
674
+ page: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Page number (default: 1)")] = None,
675
+ _request_timeout: Union[
676
+ None,
677
+ Annotated[StrictFloat, Field(gt=0)],
678
+ Tuple[
679
+ Annotated[StrictFloat, Field(gt=0)],
680
+ Annotated[StrictFloat, Field(gt=0)]
681
+ ]
682
+ ] = None,
683
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
684
+ _content_type: Optional[StrictStr] = None,
685
+ _headers: Optional[Dict[StrictStr, Any]] = None,
686
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
687
+ ) -> ApiResponse[PaginatedAuditLogs]:
688
+ """Get audit logs for organization
689
+
690
+
691
+ :param organization_id: Organization ID (required)
692
+ :type organization_id: str
693
+ :param limit: Number of items per page (default: 10)
694
+ :type limit: float
695
+ :param page: Page number (default: 1)
696
+ :type page: float
697
+ :param _request_timeout: timeout setting for this request. If one
698
+ number provided, it will be total request
699
+ timeout. It can also be a pair (tuple) of
700
+ (connection, read) timeouts.
701
+ :type _request_timeout: int, tuple(int, int), optional
702
+ :param _request_auth: set to override the auth_settings for an a single
703
+ request; this effectively ignores the
704
+ authentication in the spec for a single request.
705
+ :type _request_auth: dict, optional
706
+ :param _content_type: force content-type for the request.
707
+ :type _content_type: str, Optional
708
+ :param _headers: set to override the headers for a single
709
+ request; this effectively ignores the headers
710
+ in the spec for a single request.
711
+ :type _headers: dict, optional
712
+ :param _host_index: set to override the host_index for a single
713
+ request; this effectively ignores the host_index
714
+ in the spec for a single request.
715
+ :type _host_index: int, optional
716
+ :return: Returns the result object.
717
+ """ # noqa: E501
718
+
719
+ _param = self._get_organization_audit_logs_serialize(
720
+ organization_id=organization_id,
721
+ limit=limit,
722
+ page=page,
723
+ _request_auth=_request_auth,
724
+ _content_type=_content_type,
725
+ _headers=_headers,
726
+ _host_index=_host_index
727
+ )
728
+
729
+ _response_types_map: Dict[str, Optional[str]] = {
730
+ '200': "PaginatedAuditLogs",
731
+ }
732
+ response_data = self.api_client.call_api(
733
+ *_param,
734
+ _request_timeout=_request_timeout
735
+ )
736
+ response_data.read()
737
+ return self.api_client.response_deserialize(
738
+ response_data=response_data,
739
+ response_types_map=_response_types_map,
740
+ )
741
+
742
+
743
+ @validate_call
744
+ def get_organization_audit_logs_without_preload_content(
745
+ self,
746
+ organization_id: Annotated[StrictStr, Field(description="Organization ID")],
747
+ limit: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Number of items per page (default: 10)")] = None,
748
+ page: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Page number (default: 1)")] = None,
749
+ _request_timeout: Union[
750
+ None,
751
+ Annotated[StrictFloat, Field(gt=0)],
752
+ Tuple[
753
+ Annotated[StrictFloat, Field(gt=0)],
754
+ Annotated[StrictFloat, Field(gt=0)]
755
+ ]
756
+ ] = None,
757
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
758
+ _content_type: Optional[StrictStr] = None,
759
+ _headers: Optional[Dict[StrictStr, Any]] = None,
760
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
761
+ ) -> RESTResponseType:
762
+ """Get audit logs for organization
763
+
764
+
765
+ :param organization_id: Organization ID (required)
766
+ :type organization_id: str
767
+ :param limit: Number of items per page (default: 10)
768
+ :type limit: float
769
+ :param page: Page number (default: 1)
770
+ :type page: float
771
+ :param _request_timeout: timeout setting for this request. If one
772
+ number provided, it will be total request
773
+ timeout. It can also be a pair (tuple) of
774
+ (connection, read) timeouts.
775
+ :type _request_timeout: int, tuple(int, int), optional
776
+ :param _request_auth: set to override the auth_settings for an a single
777
+ request; this effectively ignores the
778
+ authentication in the spec for a single request.
779
+ :type _request_auth: dict, optional
780
+ :param _content_type: force content-type for the request.
781
+ :type _content_type: str, Optional
782
+ :param _headers: set to override the headers for a single
783
+ request; this effectively ignores the headers
784
+ in the spec for a single request.
785
+ :type _headers: dict, optional
786
+ :param _host_index: set to override the host_index for a single
787
+ request; this effectively ignores the host_index
788
+ in the spec for a single request.
789
+ :type _host_index: int, optional
790
+ :return: Returns the result object.
791
+ """ # noqa: E501
792
+
793
+ _param = self._get_organization_audit_logs_serialize(
794
+ organization_id=organization_id,
795
+ limit=limit,
796
+ page=page,
797
+ _request_auth=_request_auth,
798
+ _content_type=_content_type,
799
+ _headers=_headers,
800
+ _host_index=_host_index
801
+ )
802
+
803
+ _response_types_map: Dict[str, Optional[str]] = {
804
+ '200': "PaginatedAuditLogs",
805
+ }
806
+ response_data = self.api_client.call_api(
807
+ *_param,
808
+ _request_timeout=_request_timeout
809
+ )
810
+ return response_data.response
811
+
812
+
813
+ def _get_organization_audit_logs_serialize(
814
+ self,
815
+ organization_id,
816
+ limit,
817
+ page,
818
+ _request_auth,
819
+ _content_type,
820
+ _headers,
821
+ _host_index,
822
+ ) -> RequestSerialized:
823
+
824
+ _host = None
825
+
826
+ _collection_formats: Dict[str, str] = {
827
+ }
828
+
829
+ _path_params: Dict[str, str] = {}
830
+ _query_params: List[Tuple[str, str]] = []
831
+ _header_params: Dict[str, Optional[str]] = _headers or {}
832
+ _form_params: List[Tuple[str, str]] = []
833
+ _files: Dict[
834
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
835
+ ] = {}
836
+ _body_params: Optional[bytes] = None
837
+
838
+ # process the path parameters
839
+ if organization_id is not None:
840
+ _path_params['organizationId'] = organization_id
841
+ # process the query parameters
842
+ if limit is not None:
843
+
844
+ _query_params.append(('limit', limit))
845
+
846
+ if page is not None:
847
+
848
+ _query_params.append(('page', page))
849
+
850
+ # process the header parameters
851
+ # process the form parameters
852
+ # process the body parameter
853
+
854
+
855
+ # set the HTTP header `Accept`
856
+ if 'Accept' not in _header_params:
857
+ _header_params['Accept'] = self.api_client.select_header_accept(
858
+ [
859
+ 'application/json'
860
+ ]
861
+ )
862
+
863
+
864
+ # authentication setting
865
+ _auth_settings: List[str] = [
866
+ 'bearer',
867
+ 'oauth2'
868
+ ]
869
+
870
+ return self.api_client.param_serialize(
871
+ method='GET',
872
+ resource_path='/audit/organizations/{organizationId}',
873
+ path_params=_path_params,
874
+ query_params=_query_params,
875
+ header_params=_header_params,
876
+ body=_body_params,
877
+ post_params=_form_params,
878
+ files=_files,
879
+ auth_settings=_auth_settings,
880
+ collection_formats=_collection_formats,
881
+ _host=_host,
882
+ _request_auth=_request_auth
883
+ )
884
+
885
+