arthur-client 1.4.1233__py3-none-any.whl → 1.4.1234__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. arthur_client/api_bindings/__init__.py +13 -1
  2. arthur_client/api_bindings/api/__init__.py +1 -0
  3. arthur_client/api_bindings/api/custom_aggregations_v1_api.py +1477 -0
  4. arthur_client/api_bindings/docs/AggregationSpecSchemaInitArgsInner.md +2 -2
  5. arthur_client/api_bindings/docs/BaseColumnParameterSchema.md +36 -0
  6. arthur_client/api_bindings/docs/BaseColumnParameterSchemaAllowedColumnTypesInner.md +31 -0
  7. arthur_client/api_bindings/docs/BaseDatasetParameterSchema.md +33 -0
  8. arthur_client/api_bindings/docs/BaseLiteralParameterSchema.md +33 -0
  9. arthur_client/api_bindings/docs/CustomAggregationSpecSchema.md +38 -0
  10. arthur_client/api_bindings/docs/CustomAggregationSpecSchemaAggregateArgsInner.md +38 -0
  11. arthur_client/api_bindings/docs/CustomAggregationsV1Api.md +410 -0
  12. arthur_client/api_bindings/docs/Items1.md +1 -1
  13. arthur_client/api_bindings/docs/MetricsColumnListParameterSchema.md +2 -2
  14. arthur_client/api_bindings/docs/MetricsColumnParameterSchema.md +2 -2
  15. arthur_client/api_bindings/docs/MetricsDatasetParameterSchema.md +1 -1
  16. arthur_client/api_bindings/docs/MetricsLiteralParameterSchema.md +1 -1
  17. arthur_client/api_bindings/docs/ObjectType.md +1 -1
  18. arthur_client/api_bindings/docs/PermissionName.md +10 -0
  19. arthur_client/api_bindings/docs/PostCustomAggregationSpecSchema.md +33 -0
  20. arthur_client/api_bindings/docs/PutCustomAggregationSpecSchema.md +33 -0
  21. arthur_client/api_bindings/docs/ReportedCustomAggregation.md +34 -0
  22. arthur_client/api_bindings/docs/ResourceKind.md +2 -0
  23. arthur_client/api_bindings/docs/RuleType.md +0 -4
  24. arthur_client/api_bindings/docs/ValidationOutcome.md +13 -0
  25. arthur_client/api_bindings/docs/ValidationResult.md +31 -0
  26. arthur_client/api_bindings/docs/ValidationResults.md +30 -0
  27. arthur_client/api_bindings/models/__init__.py +12 -1
  28. arthur_client/api_bindings/models/base_column_parameter_schema.py +125 -0
  29. arthur_client/api_bindings/models/{metrics_column_list_parameter_schema_allowed_column_types_inner.py → base_column_parameter_schema_allowed_column_types_inner.py} +7 -7
  30. arthur_client/api_bindings/models/base_dataset_parameter_schema.py +111 -0
  31. arthur_client/api_bindings/models/base_literal_parameter_schema.py +106 -0
  32. arthur_client/api_bindings/models/custom_aggregation_spec_schema.py +126 -0
  33. arthur_client/api_bindings/models/custom_aggregation_spec_schema_aggregate_args_inner.py +149 -0
  34. arthur_client/api_bindings/models/metrics_column_list_parameter_schema.py +7 -7
  35. arthur_client/api_bindings/models/metrics_column_parameter_schema.py +7 -7
  36. arthur_client/api_bindings/models/metrics_dataset_parameter_schema.py +4 -4
  37. arthur_client/api_bindings/models/metrics_literal_parameter_schema.py +4 -4
  38. arthur_client/api_bindings/models/object_type.py +3 -3
  39. arthur_client/api_bindings/models/permission_name.py +5 -0
  40. arthur_client/api_bindings/models/post_custom_aggregation_spec_schema.py +111 -0
  41. arthur_client/api_bindings/models/put_custom_aggregation_spec_schema.py +111 -0
  42. arthur_client/api_bindings/models/reported_custom_aggregation.py +98 -0
  43. arthur_client/api_bindings/models/resource_kind.py +1 -0
  44. arthur_client/api_bindings/models/rule_type.py +0 -2
  45. arthur_client/api_bindings/models/validation_outcome.py +37 -0
  46. arthur_client/api_bindings/models/validation_result.py +90 -0
  47. arthur_client/api_bindings/models/validation_results.py +95 -0
  48. arthur_client/api_bindings/test/test_aggregation_spec_schema_init_args_inner.py +1 -1
  49. arthur_client/api_bindings/test/test_base_column_parameter_schema.py +66 -0
  50. arthur_client/api_bindings/test/{test_metrics_column_list_parameter_schema_allowed_column_types_inner.py → test_base_column_parameter_schema_allowed_column_types_inner.py} +11 -11
  51. arthur_client/api_bindings/test/test_base_dataset_parameter_schema.py +58 -0
  52. arthur_client/api_bindings/test/test_base_literal_parameter_schema.py +59 -0
  53. arthur_client/api_bindings/test/test_custom_aggregation_spec_schema.py +118 -0
  54. arthur_client/api_bindings/test/test_custom_aggregation_spec_schema_aggregate_args_inner.py +69 -0
  55. arthur_client/api_bindings/test/test_custom_aggregations_v1_api.py +66 -0
  56. arthur_client/api_bindings/test/test_metrics_column_list_parameter_schema.py +2 -2
  57. arthur_client/api_bindings/test/test_metrics_column_parameter_schema.py +2 -2
  58. arthur_client/api_bindings/test/test_metrics_dataset_parameter_schema.py +2 -2
  59. arthur_client/api_bindings/test/test_metrics_literal_parameter_schema.py +2 -2
  60. arthur_client/api_bindings/test/test_post_custom_aggregation_spec_schema.py +84 -0
  61. arthur_client/api_bindings/test/test_put_custom_aggregation_spec_schema.py +84 -0
  62. arthur_client/api_bindings/test/test_reported_custom_aggregation.py +66 -0
  63. arthur_client/api_bindings/test/test_validation_outcome.py +33 -0
  64. arthur_client/api_bindings/test/test_validation_result.py +54 -0
  65. arthur_client/api_bindings/test/test_validation_results.py +60 -0
  66. arthur_client/api_bindings_README.md +17 -1
  67. {arthur_client-1.4.1233.dist-info → arthur_client-1.4.1234.dist-info}/METADATA +1 -1
  68. {arthur_client-1.4.1233.dist-info → arthur_client-1.4.1234.dist-info}/RECORD +69 -33
  69. arthur_client/api_bindings/docs/MetricsColumnListParameterSchemaAllowedColumnTypesInner.md +0 -31
  70. {arthur_client-1.4.1233.dist-info → arthur_client-1.4.1234.dist-info}/WHEEL +0 -0
@@ -0,0 +1,1477 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Arthur Scope
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ import warnings
15
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+ from typing_extensions import Annotated
18
+
19
+ from pydantic import StrictStr
20
+ from arthur_client.api_bindings.models.custom_aggregation_spec_schema import CustomAggregationSpecSchema
21
+ from arthur_client.api_bindings.models.post_custom_aggregation_spec_schema import PostCustomAggregationSpecSchema
22
+ from arthur_client.api_bindings.models.put_custom_aggregation_spec_schema import PutCustomAggregationSpecSchema
23
+ from arthur_client.api_bindings.models.validation_results import ValidationResults
24
+
25
+ from arthur_client.api_bindings.api_client import ApiClient, RequestSerialized
26
+ from arthur_client.api_bindings.api_response import ApiResponse
27
+ from arthur_client.api_bindings.rest import RESTResponseType
28
+
29
+
30
+ class CustomAggregationsV1Api:
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 delete_custom_aggregation(
45
+ self,
46
+ custom_aggregation_id: StrictStr,
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
+ ) -> None:
60
+ """Delete Custom Aggregation.
61
+
62
+ Requires custom_aggregation_delete permission.
63
+
64
+ :param custom_aggregation_id: (required)
65
+ :type custom_aggregation_id: str
66
+ :param _request_timeout: timeout setting for this request. If one
67
+ number provided, it will be total request
68
+ timeout. It can also be a pair (tuple) of
69
+ (connection, read) timeouts.
70
+ :type _request_timeout: int, tuple(int, int), optional
71
+ :param _request_auth: set to override the auth_settings for an a single
72
+ request; this effectively ignores the
73
+ authentication in the spec for a single request.
74
+ :type _request_auth: dict, optional
75
+ :param _content_type: force content-type for the request.
76
+ :type _content_type: str, Optional
77
+ :param _headers: set to override the headers for a single
78
+ request; this effectively ignores the headers
79
+ in the spec for a single request.
80
+ :type _headers: dict, optional
81
+ :param _host_index: set to override the host_index for a single
82
+ request; this effectively ignores the host_index
83
+ in the spec for a single request.
84
+ :type _host_index: int, optional
85
+ :return: Returns the result object.
86
+ """ # noqa: E501
87
+
88
+ _param = self._delete_custom_aggregation_serialize(
89
+ custom_aggregation_id=custom_aggregation_id,
90
+ _request_auth=_request_auth,
91
+ _content_type=_content_type,
92
+ _headers=_headers,
93
+ _host_index=_host_index
94
+ )
95
+
96
+ _response_types_map: Dict[str, Optional[str]] = {
97
+ '204': None,
98
+ '500': "InternalServerError",
99
+ '404': "NotFoundError",
100
+ '422': "HTTPValidationError",
101
+ }
102
+ response_data = self.api_client.call_api(
103
+ *_param,
104
+ _request_timeout=_request_timeout
105
+ )
106
+ response_data.read()
107
+ return self.api_client.response_deserialize(
108
+ response_data=response_data,
109
+ response_types_map=_response_types_map,
110
+ ).data
111
+
112
+
113
+ @validate_call
114
+ def delete_custom_aggregation_with_http_info(
115
+ self,
116
+ custom_aggregation_id: StrictStr,
117
+ _request_timeout: Union[
118
+ None,
119
+ Annotated[StrictFloat, Field(gt=0)],
120
+ Tuple[
121
+ Annotated[StrictFloat, Field(gt=0)],
122
+ Annotated[StrictFloat, Field(gt=0)]
123
+ ]
124
+ ] = None,
125
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
126
+ _content_type: Optional[StrictStr] = None,
127
+ _headers: Optional[Dict[StrictStr, Any]] = None,
128
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
129
+ ) -> ApiResponse[None]:
130
+ """Delete Custom Aggregation.
131
+
132
+ Requires custom_aggregation_delete permission.
133
+
134
+ :param custom_aggregation_id: (required)
135
+ :type custom_aggregation_id: str
136
+ :param _request_timeout: timeout setting for this request. If one
137
+ number provided, it will be total request
138
+ timeout. It can also be a pair (tuple) of
139
+ (connection, read) timeouts.
140
+ :type _request_timeout: int, tuple(int, int), optional
141
+ :param _request_auth: set to override the auth_settings for an a single
142
+ request; this effectively ignores the
143
+ authentication in the spec for a single request.
144
+ :type _request_auth: dict, optional
145
+ :param _content_type: force content-type for the request.
146
+ :type _content_type: str, Optional
147
+ :param _headers: set to override the headers for a single
148
+ request; this effectively ignores the headers
149
+ in the spec for a single request.
150
+ :type _headers: dict, optional
151
+ :param _host_index: set to override the host_index for a single
152
+ request; this effectively ignores the host_index
153
+ in the spec for a single request.
154
+ :type _host_index: int, optional
155
+ :return: Returns the result object.
156
+ """ # noqa: E501
157
+
158
+ _param = self._delete_custom_aggregation_serialize(
159
+ custom_aggregation_id=custom_aggregation_id,
160
+ _request_auth=_request_auth,
161
+ _content_type=_content_type,
162
+ _headers=_headers,
163
+ _host_index=_host_index
164
+ )
165
+
166
+ _response_types_map: Dict[str, Optional[str]] = {
167
+ '204': None,
168
+ '500': "InternalServerError",
169
+ '404': "NotFoundError",
170
+ '422': "HTTPValidationError",
171
+ }
172
+ response_data = self.api_client.call_api(
173
+ *_param,
174
+ _request_timeout=_request_timeout
175
+ )
176
+ response_data.read()
177
+ return self.api_client.response_deserialize(
178
+ response_data=response_data,
179
+ response_types_map=_response_types_map,
180
+ )
181
+
182
+
183
+ @validate_call
184
+ def delete_custom_aggregation_without_preload_content(
185
+ self,
186
+ custom_aggregation_id: StrictStr,
187
+ _request_timeout: Union[
188
+ None,
189
+ Annotated[StrictFloat, Field(gt=0)],
190
+ Tuple[
191
+ Annotated[StrictFloat, Field(gt=0)],
192
+ Annotated[StrictFloat, Field(gt=0)]
193
+ ]
194
+ ] = None,
195
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
196
+ _content_type: Optional[StrictStr] = None,
197
+ _headers: Optional[Dict[StrictStr, Any]] = None,
198
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
199
+ ) -> RESTResponseType:
200
+ """Delete Custom Aggregation.
201
+
202
+ Requires custom_aggregation_delete permission.
203
+
204
+ :param custom_aggregation_id: (required)
205
+ :type custom_aggregation_id: str
206
+ :param _request_timeout: timeout setting for this request. If one
207
+ number provided, it will be total request
208
+ timeout. It can also be a pair (tuple) of
209
+ (connection, read) timeouts.
210
+ :type _request_timeout: int, tuple(int, int), optional
211
+ :param _request_auth: set to override the auth_settings for an a single
212
+ request; this effectively ignores the
213
+ authentication in the spec for a single request.
214
+ :type _request_auth: dict, optional
215
+ :param _content_type: force content-type for the request.
216
+ :type _content_type: str, Optional
217
+ :param _headers: set to override the headers for a single
218
+ request; this effectively ignores the headers
219
+ in the spec for a single request.
220
+ :type _headers: dict, optional
221
+ :param _host_index: set to override the host_index for a single
222
+ request; this effectively ignores the host_index
223
+ in the spec for a single request.
224
+ :type _host_index: int, optional
225
+ :return: Returns the result object.
226
+ """ # noqa: E501
227
+
228
+ _param = self._delete_custom_aggregation_serialize(
229
+ custom_aggregation_id=custom_aggregation_id,
230
+ _request_auth=_request_auth,
231
+ _content_type=_content_type,
232
+ _headers=_headers,
233
+ _host_index=_host_index
234
+ )
235
+
236
+ _response_types_map: Dict[str, Optional[str]] = {
237
+ '204': None,
238
+ '500': "InternalServerError",
239
+ '404': "NotFoundError",
240
+ '422': "HTTPValidationError",
241
+ }
242
+ response_data = self.api_client.call_api(
243
+ *_param,
244
+ _request_timeout=_request_timeout
245
+ )
246
+ return response_data.response
247
+
248
+
249
+ def _delete_custom_aggregation_serialize(
250
+ self,
251
+ custom_aggregation_id,
252
+ _request_auth,
253
+ _content_type,
254
+ _headers,
255
+ _host_index,
256
+ ) -> RequestSerialized:
257
+
258
+ _host = None
259
+
260
+ _collection_formats: Dict[str, str] = {
261
+ }
262
+
263
+ _path_params: Dict[str, str] = {}
264
+ _query_params: List[Tuple[str, str]] = []
265
+ _header_params: Dict[str, Optional[str]] = _headers or {}
266
+ _form_params: List[Tuple[str, str]] = []
267
+ _files: Dict[
268
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
269
+ ] = {}
270
+ _body_params: Optional[bytes] = None
271
+
272
+ # process the path parameters
273
+ if custom_aggregation_id is not None:
274
+ _path_params['custom_aggregation_id'] = custom_aggregation_id
275
+ # process the query parameters
276
+ # process the header parameters
277
+ # process the form parameters
278
+ # process the body parameter
279
+
280
+
281
+ # set the HTTP header `Accept`
282
+ if 'Accept' not in _header_params:
283
+ _header_params['Accept'] = self.api_client.select_header_accept(
284
+ [
285
+ 'application/json'
286
+ ]
287
+ )
288
+
289
+
290
+ # authentication setting
291
+ _auth_settings: List[str] = [
292
+ 'OAuth2AuthorizationCode'
293
+ ]
294
+
295
+ return self.api_client.param_serialize(
296
+ method='DELETE',
297
+ resource_path='/api/v1/custom_aggregations/{custom_aggregation_id}',
298
+ path_params=_path_params,
299
+ query_params=_query_params,
300
+ header_params=_header_params,
301
+ body=_body_params,
302
+ post_params=_form_params,
303
+ files=_files,
304
+ auth_settings=_auth_settings,
305
+ collection_formats=_collection_formats,
306
+ _host=_host,
307
+ _request_auth=_request_auth
308
+ )
309
+
310
+
311
+
312
+
313
+ @validate_call
314
+ def get_custom_aggregation(
315
+ self,
316
+ custom_aggregation_id: StrictStr,
317
+ _request_timeout: Union[
318
+ None,
319
+ Annotated[StrictFloat, Field(gt=0)],
320
+ Tuple[
321
+ Annotated[StrictFloat, Field(gt=0)],
322
+ Annotated[StrictFloat, Field(gt=0)]
323
+ ]
324
+ ] = None,
325
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
326
+ _content_type: Optional[StrictStr] = None,
327
+ _headers: Optional[Dict[StrictStr, Any]] = None,
328
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
329
+ ) -> CustomAggregationSpecSchema:
330
+ """Get Custom Aggregation By Id.
331
+
332
+ Requires custom_aggregation_read permission.
333
+
334
+ :param custom_aggregation_id: (required)
335
+ :type custom_aggregation_id: str
336
+ :param _request_timeout: timeout setting for this request. If one
337
+ number provided, it will be total request
338
+ timeout. It can also be a pair (tuple) of
339
+ (connection, read) timeouts.
340
+ :type _request_timeout: int, tuple(int, int), optional
341
+ :param _request_auth: set to override the auth_settings for an a single
342
+ request; this effectively ignores the
343
+ authentication in the spec for a single request.
344
+ :type _request_auth: dict, optional
345
+ :param _content_type: force content-type for the request.
346
+ :type _content_type: str, Optional
347
+ :param _headers: set to override the headers for a single
348
+ request; this effectively ignores the headers
349
+ in the spec for a single request.
350
+ :type _headers: dict, optional
351
+ :param _host_index: set to override the host_index for a single
352
+ request; this effectively ignores the host_index
353
+ in the spec for a single request.
354
+ :type _host_index: int, optional
355
+ :return: Returns the result object.
356
+ """ # noqa: E501
357
+
358
+ _param = self._get_custom_aggregation_serialize(
359
+ custom_aggregation_id=custom_aggregation_id,
360
+ _request_auth=_request_auth,
361
+ _content_type=_content_type,
362
+ _headers=_headers,
363
+ _host_index=_host_index
364
+ )
365
+
366
+ _response_types_map: Dict[str, Optional[str]] = {
367
+ '200': "CustomAggregationSpecSchema",
368
+ '500': "InternalServerError",
369
+ '404': "NotFoundError",
370
+ '422': "HTTPValidationError",
371
+ }
372
+ response_data = self.api_client.call_api(
373
+ *_param,
374
+ _request_timeout=_request_timeout
375
+ )
376
+ response_data.read()
377
+ return self.api_client.response_deserialize(
378
+ response_data=response_data,
379
+ response_types_map=_response_types_map,
380
+ ).data
381
+
382
+
383
+ @validate_call
384
+ def get_custom_aggregation_with_http_info(
385
+ self,
386
+ custom_aggregation_id: StrictStr,
387
+ _request_timeout: Union[
388
+ None,
389
+ Annotated[StrictFloat, Field(gt=0)],
390
+ Tuple[
391
+ Annotated[StrictFloat, Field(gt=0)],
392
+ Annotated[StrictFloat, Field(gt=0)]
393
+ ]
394
+ ] = None,
395
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
396
+ _content_type: Optional[StrictStr] = None,
397
+ _headers: Optional[Dict[StrictStr, Any]] = None,
398
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
399
+ ) -> ApiResponse[CustomAggregationSpecSchema]:
400
+ """Get Custom Aggregation By Id.
401
+
402
+ Requires custom_aggregation_read permission.
403
+
404
+ :param custom_aggregation_id: (required)
405
+ :type custom_aggregation_id: str
406
+ :param _request_timeout: timeout setting for this request. If one
407
+ number provided, it will be total request
408
+ timeout. It can also be a pair (tuple) of
409
+ (connection, read) timeouts.
410
+ :type _request_timeout: int, tuple(int, int), optional
411
+ :param _request_auth: set to override the auth_settings for an a single
412
+ request; this effectively ignores the
413
+ authentication in the spec for a single request.
414
+ :type _request_auth: dict, optional
415
+ :param _content_type: force content-type for the request.
416
+ :type _content_type: str, Optional
417
+ :param _headers: set to override the headers for a single
418
+ request; this effectively ignores the headers
419
+ in the spec for a single request.
420
+ :type _headers: dict, optional
421
+ :param _host_index: set to override the host_index for a single
422
+ request; this effectively ignores the host_index
423
+ in the spec for a single request.
424
+ :type _host_index: int, optional
425
+ :return: Returns the result object.
426
+ """ # noqa: E501
427
+
428
+ _param = self._get_custom_aggregation_serialize(
429
+ custom_aggregation_id=custom_aggregation_id,
430
+ _request_auth=_request_auth,
431
+ _content_type=_content_type,
432
+ _headers=_headers,
433
+ _host_index=_host_index
434
+ )
435
+
436
+ _response_types_map: Dict[str, Optional[str]] = {
437
+ '200': "CustomAggregationSpecSchema",
438
+ '500': "InternalServerError",
439
+ '404': "NotFoundError",
440
+ '422': "HTTPValidationError",
441
+ }
442
+ response_data = self.api_client.call_api(
443
+ *_param,
444
+ _request_timeout=_request_timeout
445
+ )
446
+ response_data.read()
447
+ return self.api_client.response_deserialize(
448
+ response_data=response_data,
449
+ response_types_map=_response_types_map,
450
+ )
451
+
452
+
453
+ @validate_call
454
+ def get_custom_aggregation_without_preload_content(
455
+ self,
456
+ custom_aggregation_id: StrictStr,
457
+ _request_timeout: Union[
458
+ None,
459
+ Annotated[StrictFloat, Field(gt=0)],
460
+ Tuple[
461
+ Annotated[StrictFloat, Field(gt=0)],
462
+ Annotated[StrictFloat, Field(gt=0)]
463
+ ]
464
+ ] = None,
465
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
466
+ _content_type: Optional[StrictStr] = None,
467
+ _headers: Optional[Dict[StrictStr, Any]] = None,
468
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
469
+ ) -> RESTResponseType:
470
+ """Get Custom Aggregation By Id.
471
+
472
+ Requires custom_aggregation_read permission.
473
+
474
+ :param custom_aggregation_id: (required)
475
+ :type custom_aggregation_id: str
476
+ :param _request_timeout: timeout setting for this request. If one
477
+ number provided, it will be total request
478
+ timeout. It can also be a pair (tuple) of
479
+ (connection, read) timeouts.
480
+ :type _request_timeout: int, tuple(int, int), optional
481
+ :param _request_auth: set to override the auth_settings for an a single
482
+ request; this effectively ignores the
483
+ authentication in the spec for a single request.
484
+ :type _request_auth: dict, optional
485
+ :param _content_type: force content-type for the request.
486
+ :type _content_type: str, Optional
487
+ :param _headers: set to override the headers for a single
488
+ request; this effectively ignores the headers
489
+ in the spec for a single request.
490
+ :type _headers: dict, optional
491
+ :param _host_index: set to override the host_index for a single
492
+ request; this effectively ignores the host_index
493
+ in the spec for a single request.
494
+ :type _host_index: int, optional
495
+ :return: Returns the result object.
496
+ """ # noqa: E501
497
+
498
+ _param = self._get_custom_aggregation_serialize(
499
+ custom_aggregation_id=custom_aggregation_id,
500
+ _request_auth=_request_auth,
501
+ _content_type=_content_type,
502
+ _headers=_headers,
503
+ _host_index=_host_index
504
+ )
505
+
506
+ _response_types_map: Dict[str, Optional[str]] = {
507
+ '200': "CustomAggregationSpecSchema",
508
+ '500': "InternalServerError",
509
+ '404': "NotFoundError",
510
+ '422': "HTTPValidationError",
511
+ }
512
+ response_data = self.api_client.call_api(
513
+ *_param,
514
+ _request_timeout=_request_timeout
515
+ )
516
+ return response_data.response
517
+
518
+
519
+ def _get_custom_aggregation_serialize(
520
+ self,
521
+ custom_aggregation_id,
522
+ _request_auth,
523
+ _content_type,
524
+ _headers,
525
+ _host_index,
526
+ ) -> RequestSerialized:
527
+
528
+ _host = None
529
+
530
+ _collection_formats: Dict[str, str] = {
531
+ }
532
+
533
+ _path_params: Dict[str, str] = {}
534
+ _query_params: List[Tuple[str, str]] = []
535
+ _header_params: Dict[str, Optional[str]] = _headers or {}
536
+ _form_params: List[Tuple[str, str]] = []
537
+ _files: Dict[
538
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
539
+ ] = {}
540
+ _body_params: Optional[bytes] = None
541
+
542
+ # process the path parameters
543
+ if custom_aggregation_id is not None:
544
+ _path_params['custom_aggregation_id'] = custom_aggregation_id
545
+ # process the query parameters
546
+ # process the header parameters
547
+ # process the form parameters
548
+ # process the body parameter
549
+
550
+
551
+ # set the HTTP header `Accept`
552
+ if 'Accept' not in _header_params:
553
+ _header_params['Accept'] = self.api_client.select_header_accept(
554
+ [
555
+ 'application/json'
556
+ ]
557
+ )
558
+
559
+
560
+ # authentication setting
561
+ _auth_settings: List[str] = [
562
+ 'OAuth2AuthorizationCode'
563
+ ]
564
+
565
+ return self.api_client.param_serialize(
566
+ method='GET',
567
+ resource_path='/api/v1/custom_aggregations/{custom_aggregation_id}',
568
+ path_params=_path_params,
569
+ query_params=_query_params,
570
+ header_params=_header_params,
571
+ body=_body_params,
572
+ post_params=_form_params,
573
+ files=_files,
574
+ auth_settings=_auth_settings,
575
+ collection_formats=_collection_formats,
576
+ _host=_host,
577
+ _request_auth=_request_auth
578
+ )
579
+
580
+
581
+
582
+
583
+ @validate_call
584
+ def post_custom_aggregation(
585
+ self,
586
+ workspace_id: StrictStr,
587
+ post_custom_aggregation_spec_schema: PostCustomAggregationSpecSchema,
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
+ ) -> CustomAggregationSpecSchema:
601
+ """Post Custom Aggregation.
602
+
603
+ Requires workspace_create_custom_aggregation permission.
604
+
605
+ :param workspace_id: (required)
606
+ :type workspace_id: str
607
+ :param post_custom_aggregation_spec_schema: (required)
608
+ :type post_custom_aggregation_spec_schema: PostCustomAggregationSpecSchema
609
+ :param _request_timeout: timeout setting for this request. If one
610
+ number provided, it will be total request
611
+ timeout. It can also be a pair (tuple) of
612
+ (connection, read) timeouts.
613
+ :type _request_timeout: int, tuple(int, int), optional
614
+ :param _request_auth: set to override the auth_settings for an a single
615
+ request; this effectively ignores the
616
+ authentication in the spec for a single request.
617
+ :type _request_auth: dict, optional
618
+ :param _content_type: force content-type for the request.
619
+ :type _content_type: str, Optional
620
+ :param _headers: set to override the headers for a single
621
+ request; this effectively ignores the headers
622
+ in the spec for a single request.
623
+ :type _headers: dict, optional
624
+ :param _host_index: set to override the host_index for a single
625
+ request; this effectively ignores the host_index
626
+ in the spec for a single request.
627
+ :type _host_index: int, optional
628
+ :return: Returns the result object.
629
+ """ # noqa: E501
630
+
631
+ _param = self._post_custom_aggregation_serialize(
632
+ workspace_id=workspace_id,
633
+ post_custom_aggregation_spec_schema=post_custom_aggregation_spec_schema,
634
+ _request_auth=_request_auth,
635
+ _content_type=_content_type,
636
+ _headers=_headers,
637
+ _host_index=_host_index
638
+ )
639
+
640
+ _response_types_map: Dict[str, Optional[str]] = {
641
+ '200': "CustomAggregationSpecSchema",
642
+ '500': "InternalServerError",
643
+ '400': "BadRequestError",
644
+ '404': "NotFoundError",
645
+ '422': "HTTPValidationError",
646
+ }
647
+ response_data = self.api_client.call_api(
648
+ *_param,
649
+ _request_timeout=_request_timeout
650
+ )
651
+ response_data.read()
652
+ return self.api_client.response_deserialize(
653
+ response_data=response_data,
654
+ response_types_map=_response_types_map,
655
+ ).data
656
+
657
+
658
+ @validate_call
659
+ def post_custom_aggregation_with_http_info(
660
+ self,
661
+ workspace_id: StrictStr,
662
+ post_custom_aggregation_spec_schema: PostCustomAggregationSpecSchema,
663
+ _request_timeout: Union[
664
+ None,
665
+ Annotated[StrictFloat, Field(gt=0)],
666
+ Tuple[
667
+ Annotated[StrictFloat, Field(gt=0)],
668
+ Annotated[StrictFloat, Field(gt=0)]
669
+ ]
670
+ ] = None,
671
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
672
+ _content_type: Optional[StrictStr] = None,
673
+ _headers: Optional[Dict[StrictStr, Any]] = None,
674
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
675
+ ) -> ApiResponse[CustomAggregationSpecSchema]:
676
+ """Post Custom Aggregation.
677
+
678
+ Requires workspace_create_custom_aggregation permission.
679
+
680
+ :param workspace_id: (required)
681
+ :type workspace_id: str
682
+ :param post_custom_aggregation_spec_schema: (required)
683
+ :type post_custom_aggregation_spec_schema: PostCustomAggregationSpecSchema
684
+ :param _request_timeout: timeout setting for this request. If one
685
+ number provided, it will be total request
686
+ timeout. It can also be a pair (tuple) of
687
+ (connection, read) timeouts.
688
+ :type _request_timeout: int, tuple(int, int), optional
689
+ :param _request_auth: set to override the auth_settings for an a single
690
+ request; this effectively ignores the
691
+ authentication in the spec for a single request.
692
+ :type _request_auth: dict, optional
693
+ :param _content_type: force content-type for the request.
694
+ :type _content_type: str, Optional
695
+ :param _headers: set to override the headers for a single
696
+ request; this effectively ignores the headers
697
+ in the spec for a single request.
698
+ :type _headers: dict, optional
699
+ :param _host_index: set to override the host_index for a single
700
+ request; this effectively ignores the host_index
701
+ in the spec for a single request.
702
+ :type _host_index: int, optional
703
+ :return: Returns the result object.
704
+ """ # noqa: E501
705
+
706
+ _param = self._post_custom_aggregation_serialize(
707
+ workspace_id=workspace_id,
708
+ post_custom_aggregation_spec_schema=post_custom_aggregation_spec_schema,
709
+ _request_auth=_request_auth,
710
+ _content_type=_content_type,
711
+ _headers=_headers,
712
+ _host_index=_host_index
713
+ )
714
+
715
+ _response_types_map: Dict[str, Optional[str]] = {
716
+ '200': "CustomAggregationSpecSchema",
717
+ '500': "InternalServerError",
718
+ '400': "BadRequestError",
719
+ '404': "NotFoundError",
720
+ '422': "HTTPValidationError",
721
+ }
722
+ response_data = self.api_client.call_api(
723
+ *_param,
724
+ _request_timeout=_request_timeout
725
+ )
726
+ response_data.read()
727
+ return self.api_client.response_deserialize(
728
+ response_data=response_data,
729
+ response_types_map=_response_types_map,
730
+ )
731
+
732
+
733
+ @validate_call
734
+ def post_custom_aggregation_without_preload_content(
735
+ self,
736
+ workspace_id: StrictStr,
737
+ post_custom_aggregation_spec_schema: PostCustomAggregationSpecSchema,
738
+ _request_timeout: Union[
739
+ None,
740
+ Annotated[StrictFloat, Field(gt=0)],
741
+ Tuple[
742
+ Annotated[StrictFloat, Field(gt=0)],
743
+ Annotated[StrictFloat, Field(gt=0)]
744
+ ]
745
+ ] = None,
746
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
747
+ _content_type: Optional[StrictStr] = None,
748
+ _headers: Optional[Dict[StrictStr, Any]] = None,
749
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
750
+ ) -> RESTResponseType:
751
+ """Post Custom Aggregation.
752
+
753
+ Requires workspace_create_custom_aggregation permission.
754
+
755
+ :param workspace_id: (required)
756
+ :type workspace_id: str
757
+ :param post_custom_aggregation_spec_schema: (required)
758
+ :type post_custom_aggregation_spec_schema: PostCustomAggregationSpecSchema
759
+ :param _request_timeout: timeout setting for this request. If one
760
+ number provided, it will be total request
761
+ timeout. It can also be a pair (tuple) of
762
+ (connection, read) timeouts.
763
+ :type _request_timeout: int, tuple(int, int), optional
764
+ :param _request_auth: set to override the auth_settings for an a single
765
+ request; this effectively ignores the
766
+ authentication in the spec for a single request.
767
+ :type _request_auth: dict, optional
768
+ :param _content_type: force content-type for the request.
769
+ :type _content_type: str, Optional
770
+ :param _headers: set to override the headers for a single
771
+ request; this effectively ignores the headers
772
+ in the spec for a single request.
773
+ :type _headers: dict, optional
774
+ :param _host_index: set to override the host_index for a single
775
+ request; this effectively ignores the host_index
776
+ in the spec for a single request.
777
+ :type _host_index: int, optional
778
+ :return: Returns the result object.
779
+ """ # noqa: E501
780
+
781
+ _param = self._post_custom_aggregation_serialize(
782
+ workspace_id=workspace_id,
783
+ post_custom_aggregation_spec_schema=post_custom_aggregation_spec_schema,
784
+ _request_auth=_request_auth,
785
+ _content_type=_content_type,
786
+ _headers=_headers,
787
+ _host_index=_host_index
788
+ )
789
+
790
+ _response_types_map: Dict[str, Optional[str]] = {
791
+ '200': "CustomAggregationSpecSchema",
792
+ '500': "InternalServerError",
793
+ '400': "BadRequestError",
794
+ '404': "NotFoundError",
795
+ '422': "HTTPValidationError",
796
+ }
797
+ response_data = self.api_client.call_api(
798
+ *_param,
799
+ _request_timeout=_request_timeout
800
+ )
801
+ return response_data.response
802
+
803
+
804
+ def _post_custom_aggregation_serialize(
805
+ self,
806
+ workspace_id,
807
+ post_custom_aggregation_spec_schema,
808
+ _request_auth,
809
+ _content_type,
810
+ _headers,
811
+ _host_index,
812
+ ) -> RequestSerialized:
813
+
814
+ _host = None
815
+
816
+ _collection_formats: Dict[str, str] = {
817
+ }
818
+
819
+ _path_params: Dict[str, str] = {}
820
+ _query_params: List[Tuple[str, str]] = []
821
+ _header_params: Dict[str, Optional[str]] = _headers or {}
822
+ _form_params: List[Tuple[str, str]] = []
823
+ _files: Dict[
824
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
825
+ ] = {}
826
+ _body_params: Optional[bytes] = None
827
+
828
+ # process the path parameters
829
+ if workspace_id is not None:
830
+ _path_params['workspace_id'] = workspace_id
831
+ # process the query parameters
832
+ # process the header parameters
833
+ # process the form parameters
834
+ # process the body parameter
835
+ if post_custom_aggregation_spec_schema is not None:
836
+ _body_params = post_custom_aggregation_spec_schema
837
+
838
+
839
+ # set the HTTP header `Accept`
840
+ if 'Accept' not in _header_params:
841
+ _header_params['Accept'] = self.api_client.select_header_accept(
842
+ [
843
+ 'application/json'
844
+ ]
845
+ )
846
+
847
+ # set the HTTP header `Content-Type`
848
+ if _content_type:
849
+ _header_params['Content-Type'] = _content_type
850
+ else:
851
+ _default_content_type = (
852
+ self.api_client.select_header_content_type(
853
+ [
854
+ 'application/json'
855
+ ]
856
+ )
857
+ )
858
+ if _default_content_type is not None:
859
+ _header_params['Content-Type'] = _default_content_type
860
+
861
+ # authentication setting
862
+ _auth_settings: List[str] = [
863
+ 'OAuth2AuthorizationCode'
864
+ ]
865
+
866
+ return self.api_client.param_serialize(
867
+ method='POST',
868
+ resource_path='/api/v1/workspaces/{workspace_id}/custom_aggregations',
869
+ path_params=_path_params,
870
+ query_params=_query_params,
871
+ header_params=_header_params,
872
+ body=_body_params,
873
+ post_params=_form_params,
874
+ files=_files,
875
+ auth_settings=_auth_settings,
876
+ collection_formats=_collection_formats,
877
+ _host=_host,
878
+ _request_auth=_request_auth
879
+ )
880
+
881
+
882
+
883
+
884
+ @validate_call
885
+ def put_custom_aggregation(
886
+ self,
887
+ custom_aggregation_id: StrictStr,
888
+ put_custom_aggregation_spec_schema: PutCustomAggregationSpecSchema,
889
+ _request_timeout: Union[
890
+ None,
891
+ Annotated[StrictFloat, Field(gt=0)],
892
+ Tuple[
893
+ Annotated[StrictFloat, Field(gt=0)],
894
+ Annotated[StrictFloat, Field(gt=0)]
895
+ ]
896
+ ] = None,
897
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
898
+ _content_type: Optional[StrictStr] = None,
899
+ _headers: Optional[Dict[StrictStr, Any]] = None,
900
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
901
+ ) -> CustomAggregationSpecSchema:
902
+ """Update Custom Aggregation By Id.
903
+
904
+ Creates a new version of the custom aggregation. Requires custom_aggregation_put permission.
905
+
906
+ :param custom_aggregation_id: (required)
907
+ :type custom_aggregation_id: str
908
+ :param put_custom_aggregation_spec_schema: (required)
909
+ :type put_custom_aggregation_spec_schema: PutCustomAggregationSpecSchema
910
+ :param _request_timeout: timeout setting for this request. If one
911
+ number provided, it will be total request
912
+ timeout. It can also be a pair (tuple) of
913
+ (connection, read) timeouts.
914
+ :type _request_timeout: int, tuple(int, int), optional
915
+ :param _request_auth: set to override the auth_settings for an a single
916
+ request; this effectively ignores the
917
+ authentication in the spec for a single request.
918
+ :type _request_auth: dict, optional
919
+ :param _content_type: force content-type for the request.
920
+ :type _content_type: str, Optional
921
+ :param _headers: set to override the headers for a single
922
+ request; this effectively ignores the headers
923
+ in the spec for a single request.
924
+ :type _headers: dict, optional
925
+ :param _host_index: set to override the host_index for a single
926
+ request; this effectively ignores the host_index
927
+ in the spec for a single request.
928
+ :type _host_index: int, optional
929
+ :return: Returns the result object.
930
+ """ # noqa: E501
931
+
932
+ _param = self._put_custom_aggregation_serialize(
933
+ custom_aggregation_id=custom_aggregation_id,
934
+ put_custom_aggregation_spec_schema=put_custom_aggregation_spec_schema,
935
+ _request_auth=_request_auth,
936
+ _content_type=_content_type,
937
+ _headers=_headers,
938
+ _host_index=_host_index
939
+ )
940
+
941
+ _response_types_map: Dict[str, Optional[str]] = {
942
+ '200': "CustomAggregationSpecSchema",
943
+ '500': "InternalServerError",
944
+ '404': "NotFoundError",
945
+ '422': "HTTPValidationError",
946
+ }
947
+ response_data = self.api_client.call_api(
948
+ *_param,
949
+ _request_timeout=_request_timeout
950
+ )
951
+ response_data.read()
952
+ return self.api_client.response_deserialize(
953
+ response_data=response_data,
954
+ response_types_map=_response_types_map,
955
+ ).data
956
+
957
+
958
+ @validate_call
959
+ def put_custom_aggregation_with_http_info(
960
+ self,
961
+ custom_aggregation_id: StrictStr,
962
+ put_custom_aggregation_spec_schema: PutCustomAggregationSpecSchema,
963
+ _request_timeout: Union[
964
+ None,
965
+ Annotated[StrictFloat, Field(gt=0)],
966
+ Tuple[
967
+ Annotated[StrictFloat, Field(gt=0)],
968
+ Annotated[StrictFloat, Field(gt=0)]
969
+ ]
970
+ ] = None,
971
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
972
+ _content_type: Optional[StrictStr] = None,
973
+ _headers: Optional[Dict[StrictStr, Any]] = None,
974
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
975
+ ) -> ApiResponse[CustomAggregationSpecSchema]:
976
+ """Update Custom Aggregation By Id.
977
+
978
+ Creates a new version of the custom aggregation. Requires custom_aggregation_put permission.
979
+
980
+ :param custom_aggregation_id: (required)
981
+ :type custom_aggregation_id: str
982
+ :param put_custom_aggregation_spec_schema: (required)
983
+ :type put_custom_aggregation_spec_schema: PutCustomAggregationSpecSchema
984
+ :param _request_timeout: timeout setting for this request. If one
985
+ number provided, it will be total request
986
+ timeout. It can also be a pair (tuple) of
987
+ (connection, read) timeouts.
988
+ :type _request_timeout: int, tuple(int, int), optional
989
+ :param _request_auth: set to override the auth_settings for an a single
990
+ request; this effectively ignores the
991
+ authentication in the spec for a single request.
992
+ :type _request_auth: dict, optional
993
+ :param _content_type: force content-type for the request.
994
+ :type _content_type: str, Optional
995
+ :param _headers: set to override the headers for a single
996
+ request; this effectively ignores the headers
997
+ in the spec for a single request.
998
+ :type _headers: dict, optional
999
+ :param _host_index: set to override the host_index for a single
1000
+ request; this effectively ignores the host_index
1001
+ in the spec for a single request.
1002
+ :type _host_index: int, optional
1003
+ :return: Returns the result object.
1004
+ """ # noqa: E501
1005
+
1006
+ _param = self._put_custom_aggregation_serialize(
1007
+ custom_aggregation_id=custom_aggregation_id,
1008
+ put_custom_aggregation_spec_schema=put_custom_aggregation_spec_schema,
1009
+ _request_auth=_request_auth,
1010
+ _content_type=_content_type,
1011
+ _headers=_headers,
1012
+ _host_index=_host_index
1013
+ )
1014
+
1015
+ _response_types_map: Dict[str, Optional[str]] = {
1016
+ '200': "CustomAggregationSpecSchema",
1017
+ '500': "InternalServerError",
1018
+ '404': "NotFoundError",
1019
+ '422': "HTTPValidationError",
1020
+ }
1021
+ response_data = self.api_client.call_api(
1022
+ *_param,
1023
+ _request_timeout=_request_timeout
1024
+ )
1025
+ response_data.read()
1026
+ return self.api_client.response_deserialize(
1027
+ response_data=response_data,
1028
+ response_types_map=_response_types_map,
1029
+ )
1030
+
1031
+
1032
+ @validate_call
1033
+ def put_custom_aggregation_without_preload_content(
1034
+ self,
1035
+ custom_aggregation_id: StrictStr,
1036
+ put_custom_aggregation_spec_schema: PutCustomAggregationSpecSchema,
1037
+ _request_timeout: Union[
1038
+ None,
1039
+ Annotated[StrictFloat, Field(gt=0)],
1040
+ Tuple[
1041
+ Annotated[StrictFloat, Field(gt=0)],
1042
+ Annotated[StrictFloat, Field(gt=0)]
1043
+ ]
1044
+ ] = None,
1045
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1046
+ _content_type: Optional[StrictStr] = None,
1047
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1048
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1049
+ ) -> RESTResponseType:
1050
+ """Update Custom Aggregation By Id.
1051
+
1052
+ Creates a new version of the custom aggregation. Requires custom_aggregation_put permission.
1053
+
1054
+ :param custom_aggregation_id: (required)
1055
+ :type custom_aggregation_id: str
1056
+ :param put_custom_aggregation_spec_schema: (required)
1057
+ :type put_custom_aggregation_spec_schema: PutCustomAggregationSpecSchema
1058
+ :param _request_timeout: timeout setting for this request. If one
1059
+ number provided, it will be total request
1060
+ timeout. It can also be a pair (tuple) of
1061
+ (connection, read) timeouts.
1062
+ :type _request_timeout: int, tuple(int, int), optional
1063
+ :param _request_auth: set to override the auth_settings for an a single
1064
+ request; this effectively ignores the
1065
+ authentication in the spec for a single request.
1066
+ :type _request_auth: dict, optional
1067
+ :param _content_type: force content-type for the request.
1068
+ :type _content_type: str, Optional
1069
+ :param _headers: set to override the headers for a single
1070
+ request; this effectively ignores the headers
1071
+ in the spec for a single request.
1072
+ :type _headers: dict, optional
1073
+ :param _host_index: set to override the host_index for a single
1074
+ request; this effectively ignores the host_index
1075
+ in the spec for a single request.
1076
+ :type _host_index: int, optional
1077
+ :return: Returns the result object.
1078
+ """ # noqa: E501
1079
+
1080
+ _param = self._put_custom_aggregation_serialize(
1081
+ custom_aggregation_id=custom_aggregation_id,
1082
+ put_custom_aggregation_spec_schema=put_custom_aggregation_spec_schema,
1083
+ _request_auth=_request_auth,
1084
+ _content_type=_content_type,
1085
+ _headers=_headers,
1086
+ _host_index=_host_index
1087
+ )
1088
+
1089
+ _response_types_map: Dict[str, Optional[str]] = {
1090
+ '200': "CustomAggregationSpecSchema",
1091
+ '500': "InternalServerError",
1092
+ '404': "NotFoundError",
1093
+ '422': "HTTPValidationError",
1094
+ }
1095
+ response_data = self.api_client.call_api(
1096
+ *_param,
1097
+ _request_timeout=_request_timeout
1098
+ )
1099
+ return response_data.response
1100
+
1101
+
1102
+ def _put_custom_aggregation_serialize(
1103
+ self,
1104
+ custom_aggregation_id,
1105
+ put_custom_aggregation_spec_schema,
1106
+ _request_auth,
1107
+ _content_type,
1108
+ _headers,
1109
+ _host_index,
1110
+ ) -> RequestSerialized:
1111
+
1112
+ _host = None
1113
+
1114
+ _collection_formats: Dict[str, str] = {
1115
+ }
1116
+
1117
+ _path_params: Dict[str, str] = {}
1118
+ _query_params: List[Tuple[str, str]] = []
1119
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1120
+ _form_params: List[Tuple[str, str]] = []
1121
+ _files: Dict[
1122
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1123
+ ] = {}
1124
+ _body_params: Optional[bytes] = None
1125
+
1126
+ # process the path parameters
1127
+ if custom_aggregation_id is not None:
1128
+ _path_params['custom_aggregation_id'] = custom_aggregation_id
1129
+ # process the query parameters
1130
+ # process the header parameters
1131
+ # process the form parameters
1132
+ # process the body parameter
1133
+ if put_custom_aggregation_spec_schema is not None:
1134
+ _body_params = put_custom_aggregation_spec_schema
1135
+
1136
+
1137
+ # set the HTTP header `Accept`
1138
+ if 'Accept' not in _header_params:
1139
+ _header_params['Accept'] = self.api_client.select_header_accept(
1140
+ [
1141
+ 'application/json'
1142
+ ]
1143
+ )
1144
+
1145
+ # set the HTTP header `Content-Type`
1146
+ if _content_type:
1147
+ _header_params['Content-Type'] = _content_type
1148
+ else:
1149
+ _default_content_type = (
1150
+ self.api_client.select_header_content_type(
1151
+ [
1152
+ 'application/json'
1153
+ ]
1154
+ )
1155
+ )
1156
+ if _default_content_type is not None:
1157
+ _header_params['Content-Type'] = _default_content_type
1158
+
1159
+ # authentication setting
1160
+ _auth_settings: List[str] = [
1161
+ 'OAuth2AuthorizationCode'
1162
+ ]
1163
+
1164
+ return self.api_client.param_serialize(
1165
+ method='PUT',
1166
+ resource_path='/api/v1/custom_aggregations/{custom_aggregation_id}',
1167
+ path_params=_path_params,
1168
+ query_params=_query_params,
1169
+ header_params=_header_params,
1170
+ body=_body_params,
1171
+ post_params=_form_params,
1172
+ files=_files,
1173
+ auth_settings=_auth_settings,
1174
+ collection_formats=_collection_formats,
1175
+ _host=_host,
1176
+ _request_auth=_request_auth
1177
+ )
1178
+
1179
+
1180
+
1181
+
1182
+ @validate_call
1183
+ def validate_custom_aggregation(
1184
+ self,
1185
+ workspace_id: StrictStr,
1186
+ post_custom_aggregation_spec_schema: PostCustomAggregationSpecSchema,
1187
+ _request_timeout: Union[
1188
+ None,
1189
+ Annotated[StrictFloat, Field(gt=0)],
1190
+ Tuple[
1191
+ Annotated[StrictFloat, Field(gt=0)],
1192
+ Annotated[StrictFloat, Field(gt=0)]
1193
+ ]
1194
+ ] = None,
1195
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1196
+ _content_type: Optional[StrictStr] = None,
1197
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1198
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1199
+ ) -> ValidationResults:
1200
+ """Validate A Custom Aggregation Before Creation.
1201
+
1202
+ Validates the custom aggregation and returns any expected errors for aggregation creation. Requires workspace_validate_custom_aggregation permission.
1203
+
1204
+ :param workspace_id: (required)
1205
+ :type workspace_id: str
1206
+ :param post_custom_aggregation_spec_schema: (required)
1207
+ :type post_custom_aggregation_spec_schema: PostCustomAggregationSpecSchema
1208
+ :param _request_timeout: timeout setting for this request. If one
1209
+ number provided, it will be total request
1210
+ timeout. It can also be a pair (tuple) of
1211
+ (connection, read) timeouts.
1212
+ :type _request_timeout: int, tuple(int, int), optional
1213
+ :param _request_auth: set to override the auth_settings for an a single
1214
+ request; this effectively ignores the
1215
+ authentication in the spec for a single request.
1216
+ :type _request_auth: dict, optional
1217
+ :param _content_type: force content-type for the request.
1218
+ :type _content_type: str, Optional
1219
+ :param _headers: set to override the headers for a single
1220
+ request; this effectively ignores the headers
1221
+ in the spec for a single request.
1222
+ :type _headers: dict, optional
1223
+ :param _host_index: set to override the host_index for a single
1224
+ request; this effectively ignores the host_index
1225
+ in the spec for a single request.
1226
+ :type _host_index: int, optional
1227
+ :return: Returns the result object.
1228
+ """ # noqa: E501
1229
+
1230
+ _param = self._validate_custom_aggregation_serialize(
1231
+ workspace_id=workspace_id,
1232
+ post_custom_aggregation_spec_schema=post_custom_aggregation_spec_schema,
1233
+ _request_auth=_request_auth,
1234
+ _content_type=_content_type,
1235
+ _headers=_headers,
1236
+ _host_index=_host_index
1237
+ )
1238
+
1239
+ _response_types_map: Dict[str, Optional[str]] = {
1240
+ '200': "ValidationResults",
1241
+ '500': "InternalServerError",
1242
+ '404': "NotFoundError",
1243
+ '422': "HTTPValidationError",
1244
+ }
1245
+ response_data = self.api_client.call_api(
1246
+ *_param,
1247
+ _request_timeout=_request_timeout
1248
+ )
1249
+ response_data.read()
1250
+ return self.api_client.response_deserialize(
1251
+ response_data=response_data,
1252
+ response_types_map=_response_types_map,
1253
+ ).data
1254
+
1255
+
1256
+ @validate_call
1257
+ def validate_custom_aggregation_with_http_info(
1258
+ self,
1259
+ workspace_id: StrictStr,
1260
+ post_custom_aggregation_spec_schema: PostCustomAggregationSpecSchema,
1261
+ _request_timeout: Union[
1262
+ None,
1263
+ Annotated[StrictFloat, Field(gt=0)],
1264
+ Tuple[
1265
+ Annotated[StrictFloat, Field(gt=0)],
1266
+ Annotated[StrictFloat, Field(gt=0)]
1267
+ ]
1268
+ ] = None,
1269
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1270
+ _content_type: Optional[StrictStr] = None,
1271
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1272
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1273
+ ) -> ApiResponse[ValidationResults]:
1274
+ """Validate A Custom Aggregation Before Creation.
1275
+
1276
+ Validates the custom aggregation and returns any expected errors for aggregation creation. Requires workspace_validate_custom_aggregation permission.
1277
+
1278
+ :param workspace_id: (required)
1279
+ :type workspace_id: str
1280
+ :param post_custom_aggregation_spec_schema: (required)
1281
+ :type post_custom_aggregation_spec_schema: PostCustomAggregationSpecSchema
1282
+ :param _request_timeout: timeout setting for this request. If one
1283
+ number provided, it will be total request
1284
+ timeout. It can also be a pair (tuple) of
1285
+ (connection, read) timeouts.
1286
+ :type _request_timeout: int, tuple(int, int), optional
1287
+ :param _request_auth: set to override the auth_settings for an a single
1288
+ request; this effectively ignores the
1289
+ authentication in the spec for a single request.
1290
+ :type _request_auth: dict, optional
1291
+ :param _content_type: force content-type for the request.
1292
+ :type _content_type: str, Optional
1293
+ :param _headers: set to override the headers for a single
1294
+ request; this effectively ignores the headers
1295
+ in the spec for a single request.
1296
+ :type _headers: dict, optional
1297
+ :param _host_index: set to override the host_index for a single
1298
+ request; this effectively ignores the host_index
1299
+ in the spec for a single request.
1300
+ :type _host_index: int, optional
1301
+ :return: Returns the result object.
1302
+ """ # noqa: E501
1303
+
1304
+ _param = self._validate_custom_aggregation_serialize(
1305
+ workspace_id=workspace_id,
1306
+ post_custom_aggregation_spec_schema=post_custom_aggregation_spec_schema,
1307
+ _request_auth=_request_auth,
1308
+ _content_type=_content_type,
1309
+ _headers=_headers,
1310
+ _host_index=_host_index
1311
+ )
1312
+
1313
+ _response_types_map: Dict[str, Optional[str]] = {
1314
+ '200': "ValidationResults",
1315
+ '500': "InternalServerError",
1316
+ '404': "NotFoundError",
1317
+ '422': "HTTPValidationError",
1318
+ }
1319
+ response_data = self.api_client.call_api(
1320
+ *_param,
1321
+ _request_timeout=_request_timeout
1322
+ )
1323
+ response_data.read()
1324
+ return self.api_client.response_deserialize(
1325
+ response_data=response_data,
1326
+ response_types_map=_response_types_map,
1327
+ )
1328
+
1329
+
1330
+ @validate_call
1331
+ def validate_custom_aggregation_without_preload_content(
1332
+ self,
1333
+ workspace_id: StrictStr,
1334
+ post_custom_aggregation_spec_schema: PostCustomAggregationSpecSchema,
1335
+ _request_timeout: Union[
1336
+ None,
1337
+ Annotated[StrictFloat, Field(gt=0)],
1338
+ Tuple[
1339
+ Annotated[StrictFloat, Field(gt=0)],
1340
+ Annotated[StrictFloat, Field(gt=0)]
1341
+ ]
1342
+ ] = None,
1343
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1344
+ _content_type: Optional[StrictStr] = None,
1345
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1346
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1347
+ ) -> RESTResponseType:
1348
+ """Validate A Custom Aggregation Before Creation.
1349
+
1350
+ Validates the custom aggregation and returns any expected errors for aggregation creation. Requires workspace_validate_custom_aggregation permission.
1351
+
1352
+ :param workspace_id: (required)
1353
+ :type workspace_id: str
1354
+ :param post_custom_aggregation_spec_schema: (required)
1355
+ :type post_custom_aggregation_spec_schema: PostCustomAggregationSpecSchema
1356
+ :param _request_timeout: timeout setting for this request. If one
1357
+ number provided, it will be total request
1358
+ timeout. It can also be a pair (tuple) of
1359
+ (connection, read) timeouts.
1360
+ :type _request_timeout: int, tuple(int, int), optional
1361
+ :param _request_auth: set to override the auth_settings for an a single
1362
+ request; this effectively ignores the
1363
+ authentication in the spec for a single request.
1364
+ :type _request_auth: dict, optional
1365
+ :param _content_type: force content-type for the request.
1366
+ :type _content_type: str, Optional
1367
+ :param _headers: set to override the headers for a single
1368
+ request; this effectively ignores the headers
1369
+ in the spec for a single request.
1370
+ :type _headers: dict, optional
1371
+ :param _host_index: set to override the host_index for a single
1372
+ request; this effectively ignores the host_index
1373
+ in the spec for a single request.
1374
+ :type _host_index: int, optional
1375
+ :return: Returns the result object.
1376
+ """ # noqa: E501
1377
+
1378
+ _param = self._validate_custom_aggregation_serialize(
1379
+ workspace_id=workspace_id,
1380
+ post_custom_aggregation_spec_schema=post_custom_aggregation_spec_schema,
1381
+ _request_auth=_request_auth,
1382
+ _content_type=_content_type,
1383
+ _headers=_headers,
1384
+ _host_index=_host_index
1385
+ )
1386
+
1387
+ _response_types_map: Dict[str, Optional[str]] = {
1388
+ '200': "ValidationResults",
1389
+ '500': "InternalServerError",
1390
+ '404': "NotFoundError",
1391
+ '422': "HTTPValidationError",
1392
+ }
1393
+ response_data = self.api_client.call_api(
1394
+ *_param,
1395
+ _request_timeout=_request_timeout
1396
+ )
1397
+ return response_data.response
1398
+
1399
+
1400
+ def _validate_custom_aggregation_serialize(
1401
+ self,
1402
+ workspace_id,
1403
+ post_custom_aggregation_spec_schema,
1404
+ _request_auth,
1405
+ _content_type,
1406
+ _headers,
1407
+ _host_index,
1408
+ ) -> RequestSerialized:
1409
+
1410
+ _host = None
1411
+
1412
+ _collection_formats: Dict[str, str] = {
1413
+ }
1414
+
1415
+ _path_params: Dict[str, str] = {}
1416
+ _query_params: List[Tuple[str, str]] = []
1417
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1418
+ _form_params: List[Tuple[str, str]] = []
1419
+ _files: Dict[
1420
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1421
+ ] = {}
1422
+ _body_params: Optional[bytes] = None
1423
+
1424
+ # process the path parameters
1425
+ if workspace_id is not None:
1426
+ _path_params['workspace_id'] = workspace_id
1427
+ # process the query parameters
1428
+ # process the header parameters
1429
+ # process the form parameters
1430
+ # process the body parameter
1431
+ if post_custom_aggregation_spec_schema is not None:
1432
+ _body_params = post_custom_aggregation_spec_schema
1433
+
1434
+
1435
+ # set the HTTP header `Accept`
1436
+ if 'Accept' not in _header_params:
1437
+ _header_params['Accept'] = self.api_client.select_header_accept(
1438
+ [
1439
+ 'application/json'
1440
+ ]
1441
+ )
1442
+
1443
+ # set the HTTP header `Content-Type`
1444
+ if _content_type:
1445
+ _header_params['Content-Type'] = _content_type
1446
+ else:
1447
+ _default_content_type = (
1448
+ self.api_client.select_header_content_type(
1449
+ [
1450
+ 'application/json'
1451
+ ]
1452
+ )
1453
+ )
1454
+ if _default_content_type is not None:
1455
+ _header_params['Content-Type'] = _default_content_type
1456
+
1457
+ # authentication setting
1458
+ _auth_settings: List[str] = [
1459
+ 'OAuth2AuthorizationCode'
1460
+ ]
1461
+
1462
+ return self.api_client.param_serialize(
1463
+ method='POST',
1464
+ resource_path='/api/v1/workspaces/{workspace_id}/validate_custom_aggregation',
1465
+ path_params=_path_params,
1466
+ query_params=_query_params,
1467
+ header_params=_header_params,
1468
+ body=_body_params,
1469
+ post_params=_form_params,
1470
+ files=_files,
1471
+ auth_settings=_auth_settings,
1472
+ collection_formats=_collection_formats,
1473
+ _host=_host,
1474
+ _request_auth=_request_auth
1475
+ )
1476
+
1477
+