scope-client 1.4.1088__py3-none-any.whl → 1.4.1090__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.
- scope_client/api_bindings/__init__.py +2 -0
- scope_client/api_bindings/api/alert_rules_v1_api.py +303 -0
- scope_client/api_bindings/models/__init__.py +2 -0
- scope_client/api_bindings/models/alert_rule_sql_validation_resp.py +93 -0
- scope_client/api_bindings/models/validate_alert_rule_query_req.py +87 -0
- {scope_client-1.4.1088.dist-info → scope_client-1.4.1090.dist-info}/METADATA +1 -1
- {scope_client-1.4.1088.dist-info → scope_client-1.4.1090.dist-info}/RECORD +9 -7
- {scope_client-1.4.1088.dist-info → scope_client-1.4.1090.dist-info}/WHEEL +0 -0
- {scope_client-1.4.1088.dist-info → scope_client-1.4.1090.dist-info}/top_level.txt +0 -0
@@ -66,6 +66,7 @@ from scope_client.api_bindings.models.alert_check_job_spec import AlertCheckJobS
|
|
66
66
|
from scope_client.api_bindings.models.alert_rule import AlertRule
|
67
67
|
from scope_client.api_bindings.models.alert_rule_interval import AlertRuleInterval
|
68
68
|
from scope_client.api_bindings.models.alert_rule_notification_webhook import AlertRuleNotificationWebhook
|
69
|
+
from scope_client.api_bindings.models.alert_rule_sql_validation_resp import AlertRuleSQLValidationResp
|
69
70
|
from scope_client.api_bindings.models.alert_rule_sort import AlertRuleSort
|
70
71
|
from scope_client.api_bindings.models.alert_sort import AlertSort
|
71
72
|
from scope_client.api_bindings.models.alert_webhook_called import AlertWebhookCalled
|
@@ -322,6 +323,7 @@ from scope_client.api_bindings.models.user_credentials import UserCredentials
|
|
322
323
|
from scope_client.api_bindings.models.user_service_account_credentials import UserServiceAccountCredentials
|
323
324
|
from scope_client.api_bindings.models.user_sort import UserSort
|
324
325
|
from scope_client.api_bindings.models.user_type import UserType
|
326
|
+
from scope_client.api_bindings.models.validate_alert_rule_query_req import ValidateAlertRuleQueryReq
|
325
327
|
from scope_client.api_bindings.models.validation_error import ValidationError
|
326
328
|
from scope_client.api_bindings.models.validation_error_loc_inner import ValidationErrorLocInner
|
327
329
|
from scope_client.api_bindings.models.webhook import Webhook
|
@@ -21,11 +21,13 @@ from typing import Optional, Union
|
|
21
21
|
from typing_extensions import Annotated
|
22
22
|
from scope_client.api_bindings.models.alert_bound import AlertBound
|
23
23
|
from scope_client.api_bindings.models.alert_rule import AlertRule
|
24
|
+
from scope_client.api_bindings.models.alert_rule_sql_validation_resp import AlertRuleSQLValidationResp
|
24
25
|
from scope_client.api_bindings.models.alert_rule_sort import AlertRuleSort
|
25
26
|
from scope_client.api_bindings.models.patch_alert_rule import PatchAlertRule
|
26
27
|
from scope_client.api_bindings.models.post_alert_rule import PostAlertRule
|
27
28
|
from scope_client.api_bindings.models.resource_list_alert_rule import ResourceListAlertRule
|
28
29
|
from scope_client.api_bindings.models.sort_order import SortOrder
|
30
|
+
from scope_client.api_bindings.models.validate_alert_rule_query_req import ValidateAlertRuleQueryReq
|
29
31
|
|
30
32
|
from scope_client.api_bindings.api_client import ApiClient, RequestSerialized
|
31
33
|
from scope_client.api_bindings.api_response import ApiResponse
|
@@ -1326,6 +1328,307 @@ class AlertRulesV1Api:
|
|
1326
1328
|
|
1327
1329
|
|
1328
1330
|
|
1331
|
+
@validate_call
|
1332
|
+
def post_alert_rule_query_validation(
|
1333
|
+
self,
|
1334
|
+
model_id: StrictStr,
|
1335
|
+
validate_alert_rule_query_req: ValidateAlertRuleQueryReq,
|
1336
|
+
_request_timeout: Union[
|
1337
|
+
None,
|
1338
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1339
|
+
Tuple[
|
1340
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1341
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1342
|
+
]
|
1343
|
+
] = None,
|
1344
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1345
|
+
_content_type: Optional[StrictStr] = None,
|
1346
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1347
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1348
|
+
) -> AlertRuleSQLValidationResp:
|
1349
|
+
"""Validate A Model Alert Rule Query
|
1350
|
+
|
1351
|
+
Validates an alert rule query. Requires model_create_alert_rule permission.
|
1352
|
+
|
1353
|
+
:param model_id: (required)
|
1354
|
+
:type model_id: str
|
1355
|
+
:param validate_alert_rule_query_req: (required)
|
1356
|
+
:type validate_alert_rule_query_req: ValidateAlertRuleQueryReq
|
1357
|
+
:param _request_timeout: timeout setting for this request. If one
|
1358
|
+
number provided, it will be total request
|
1359
|
+
timeout. It can also be a pair (tuple) of
|
1360
|
+
(connection, read) timeouts.
|
1361
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1362
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1363
|
+
request; this effectively ignores the
|
1364
|
+
authentication in the spec for a single request.
|
1365
|
+
:type _request_auth: dict, optional
|
1366
|
+
:param _content_type: force content-type for the request.
|
1367
|
+
:type _content_type: str, Optional
|
1368
|
+
:param _headers: set to override the headers for a single
|
1369
|
+
request; this effectively ignores the headers
|
1370
|
+
in the spec for a single request.
|
1371
|
+
:type _headers: dict, optional
|
1372
|
+
:param _host_index: set to override the host_index for a single
|
1373
|
+
request; this effectively ignores the host_index
|
1374
|
+
in the spec for a single request.
|
1375
|
+
:type _host_index: int, optional
|
1376
|
+
:return: Returns the result object.
|
1377
|
+
""" # noqa: E501
|
1378
|
+
|
1379
|
+
_param = self._post_alert_rule_query_validation_serialize(
|
1380
|
+
model_id=model_id,
|
1381
|
+
validate_alert_rule_query_req=validate_alert_rule_query_req,
|
1382
|
+
_request_auth=_request_auth,
|
1383
|
+
_content_type=_content_type,
|
1384
|
+
_headers=_headers,
|
1385
|
+
_host_index=_host_index
|
1386
|
+
)
|
1387
|
+
|
1388
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1389
|
+
'200': "AlertRuleSQLValidationResp",
|
1390
|
+
'500': "InternalServerError",
|
1391
|
+
'404': "NotFoundError",
|
1392
|
+
'400': "BadRequestError",
|
1393
|
+
'422': "HTTPValidationError",
|
1394
|
+
}
|
1395
|
+
response_data = self.api_client.call_api(
|
1396
|
+
*_param,
|
1397
|
+
_request_timeout=_request_timeout
|
1398
|
+
)
|
1399
|
+
response_data.read()
|
1400
|
+
return self.api_client.response_deserialize(
|
1401
|
+
response_data=response_data,
|
1402
|
+
response_types_map=_response_types_map,
|
1403
|
+
).data
|
1404
|
+
|
1405
|
+
|
1406
|
+
@validate_call
|
1407
|
+
def post_alert_rule_query_validation_with_http_info(
|
1408
|
+
self,
|
1409
|
+
model_id: StrictStr,
|
1410
|
+
validate_alert_rule_query_req: ValidateAlertRuleQueryReq,
|
1411
|
+
_request_timeout: Union[
|
1412
|
+
None,
|
1413
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1414
|
+
Tuple[
|
1415
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1416
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1417
|
+
]
|
1418
|
+
] = None,
|
1419
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1420
|
+
_content_type: Optional[StrictStr] = None,
|
1421
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1422
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1423
|
+
) -> ApiResponse[AlertRuleSQLValidationResp]:
|
1424
|
+
"""Validate A Model Alert Rule Query
|
1425
|
+
|
1426
|
+
Validates an alert rule query. Requires model_create_alert_rule permission.
|
1427
|
+
|
1428
|
+
:param model_id: (required)
|
1429
|
+
:type model_id: str
|
1430
|
+
:param validate_alert_rule_query_req: (required)
|
1431
|
+
:type validate_alert_rule_query_req: ValidateAlertRuleQueryReq
|
1432
|
+
:param _request_timeout: timeout setting for this request. If one
|
1433
|
+
number provided, it will be total request
|
1434
|
+
timeout. It can also be a pair (tuple) of
|
1435
|
+
(connection, read) timeouts.
|
1436
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1437
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1438
|
+
request; this effectively ignores the
|
1439
|
+
authentication in the spec for a single request.
|
1440
|
+
:type _request_auth: dict, optional
|
1441
|
+
:param _content_type: force content-type for the request.
|
1442
|
+
:type _content_type: str, Optional
|
1443
|
+
:param _headers: set to override the headers for a single
|
1444
|
+
request; this effectively ignores the headers
|
1445
|
+
in the spec for a single request.
|
1446
|
+
:type _headers: dict, optional
|
1447
|
+
:param _host_index: set to override the host_index for a single
|
1448
|
+
request; this effectively ignores the host_index
|
1449
|
+
in the spec for a single request.
|
1450
|
+
:type _host_index: int, optional
|
1451
|
+
:return: Returns the result object.
|
1452
|
+
""" # noqa: E501
|
1453
|
+
|
1454
|
+
_param = self._post_alert_rule_query_validation_serialize(
|
1455
|
+
model_id=model_id,
|
1456
|
+
validate_alert_rule_query_req=validate_alert_rule_query_req,
|
1457
|
+
_request_auth=_request_auth,
|
1458
|
+
_content_type=_content_type,
|
1459
|
+
_headers=_headers,
|
1460
|
+
_host_index=_host_index
|
1461
|
+
)
|
1462
|
+
|
1463
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1464
|
+
'200': "AlertRuleSQLValidationResp",
|
1465
|
+
'500': "InternalServerError",
|
1466
|
+
'404': "NotFoundError",
|
1467
|
+
'400': "BadRequestError",
|
1468
|
+
'422': "HTTPValidationError",
|
1469
|
+
}
|
1470
|
+
response_data = self.api_client.call_api(
|
1471
|
+
*_param,
|
1472
|
+
_request_timeout=_request_timeout
|
1473
|
+
)
|
1474
|
+
response_data.read()
|
1475
|
+
return self.api_client.response_deserialize(
|
1476
|
+
response_data=response_data,
|
1477
|
+
response_types_map=_response_types_map,
|
1478
|
+
)
|
1479
|
+
|
1480
|
+
|
1481
|
+
@validate_call
|
1482
|
+
def post_alert_rule_query_validation_without_preload_content(
|
1483
|
+
self,
|
1484
|
+
model_id: StrictStr,
|
1485
|
+
validate_alert_rule_query_req: ValidateAlertRuleQueryReq,
|
1486
|
+
_request_timeout: Union[
|
1487
|
+
None,
|
1488
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1489
|
+
Tuple[
|
1490
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1491
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1492
|
+
]
|
1493
|
+
] = None,
|
1494
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1495
|
+
_content_type: Optional[StrictStr] = None,
|
1496
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1497
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1498
|
+
) -> RESTResponseType:
|
1499
|
+
"""Validate A Model Alert Rule Query
|
1500
|
+
|
1501
|
+
Validates an alert rule query. Requires model_create_alert_rule permission.
|
1502
|
+
|
1503
|
+
:param model_id: (required)
|
1504
|
+
:type model_id: str
|
1505
|
+
:param validate_alert_rule_query_req: (required)
|
1506
|
+
:type validate_alert_rule_query_req: ValidateAlertRuleQueryReq
|
1507
|
+
:param _request_timeout: timeout setting for this request. If one
|
1508
|
+
number provided, it will be total request
|
1509
|
+
timeout. It can also be a pair (tuple) of
|
1510
|
+
(connection, read) timeouts.
|
1511
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1512
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1513
|
+
request; this effectively ignores the
|
1514
|
+
authentication in the spec for a single request.
|
1515
|
+
:type _request_auth: dict, optional
|
1516
|
+
:param _content_type: force content-type for the request.
|
1517
|
+
:type _content_type: str, Optional
|
1518
|
+
:param _headers: set to override the headers for a single
|
1519
|
+
request; this effectively ignores the headers
|
1520
|
+
in the spec for a single request.
|
1521
|
+
:type _headers: dict, optional
|
1522
|
+
:param _host_index: set to override the host_index for a single
|
1523
|
+
request; this effectively ignores the host_index
|
1524
|
+
in the spec for a single request.
|
1525
|
+
:type _host_index: int, optional
|
1526
|
+
:return: Returns the result object.
|
1527
|
+
""" # noqa: E501
|
1528
|
+
|
1529
|
+
_param = self._post_alert_rule_query_validation_serialize(
|
1530
|
+
model_id=model_id,
|
1531
|
+
validate_alert_rule_query_req=validate_alert_rule_query_req,
|
1532
|
+
_request_auth=_request_auth,
|
1533
|
+
_content_type=_content_type,
|
1534
|
+
_headers=_headers,
|
1535
|
+
_host_index=_host_index
|
1536
|
+
)
|
1537
|
+
|
1538
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1539
|
+
'200': "AlertRuleSQLValidationResp",
|
1540
|
+
'500': "InternalServerError",
|
1541
|
+
'404': "NotFoundError",
|
1542
|
+
'400': "BadRequestError",
|
1543
|
+
'422': "HTTPValidationError",
|
1544
|
+
}
|
1545
|
+
response_data = self.api_client.call_api(
|
1546
|
+
*_param,
|
1547
|
+
_request_timeout=_request_timeout
|
1548
|
+
)
|
1549
|
+
return response_data.response
|
1550
|
+
|
1551
|
+
|
1552
|
+
def _post_alert_rule_query_validation_serialize(
|
1553
|
+
self,
|
1554
|
+
model_id,
|
1555
|
+
validate_alert_rule_query_req,
|
1556
|
+
_request_auth,
|
1557
|
+
_content_type,
|
1558
|
+
_headers,
|
1559
|
+
_host_index,
|
1560
|
+
) -> RequestSerialized:
|
1561
|
+
|
1562
|
+
_host = None
|
1563
|
+
|
1564
|
+
_collection_formats: Dict[str, str] = {
|
1565
|
+
}
|
1566
|
+
|
1567
|
+
_path_params: Dict[str, str] = {}
|
1568
|
+
_query_params: List[Tuple[str, str]] = []
|
1569
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
1570
|
+
_form_params: List[Tuple[str, str]] = []
|
1571
|
+
_files: Dict[
|
1572
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
1573
|
+
] = {}
|
1574
|
+
_body_params: Optional[bytes] = None
|
1575
|
+
|
1576
|
+
# process the path parameters
|
1577
|
+
if model_id is not None:
|
1578
|
+
_path_params['model_id'] = model_id
|
1579
|
+
# process the query parameters
|
1580
|
+
# process the header parameters
|
1581
|
+
# process the form parameters
|
1582
|
+
# process the body parameter
|
1583
|
+
if validate_alert_rule_query_req is not None:
|
1584
|
+
_body_params = validate_alert_rule_query_req
|
1585
|
+
|
1586
|
+
|
1587
|
+
# set the HTTP header `Accept`
|
1588
|
+
if 'Accept' not in _header_params:
|
1589
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
1590
|
+
[
|
1591
|
+
'application/json'
|
1592
|
+
]
|
1593
|
+
)
|
1594
|
+
|
1595
|
+
# set the HTTP header `Content-Type`
|
1596
|
+
if _content_type:
|
1597
|
+
_header_params['Content-Type'] = _content_type
|
1598
|
+
else:
|
1599
|
+
_default_content_type = (
|
1600
|
+
self.api_client.select_header_content_type(
|
1601
|
+
[
|
1602
|
+
'application/json'
|
1603
|
+
]
|
1604
|
+
)
|
1605
|
+
)
|
1606
|
+
if _default_content_type is not None:
|
1607
|
+
_header_params['Content-Type'] = _default_content_type
|
1608
|
+
|
1609
|
+
# authentication setting
|
1610
|
+
_auth_settings: List[str] = [
|
1611
|
+
'OAuth2AuthorizationCode'
|
1612
|
+
]
|
1613
|
+
|
1614
|
+
return self.api_client.param_serialize(
|
1615
|
+
method='POST',
|
1616
|
+
resource_path='/api/v1/models/{model_id}/alert_rule_query_validation',
|
1617
|
+
path_params=_path_params,
|
1618
|
+
query_params=_query_params,
|
1619
|
+
header_params=_header_params,
|
1620
|
+
body=_body_params,
|
1621
|
+
post_params=_form_params,
|
1622
|
+
files=_files,
|
1623
|
+
auth_settings=_auth_settings,
|
1624
|
+
collection_formats=_collection_formats,
|
1625
|
+
_host=_host,
|
1626
|
+
_request_auth=_request_auth
|
1627
|
+
)
|
1628
|
+
|
1629
|
+
|
1630
|
+
|
1631
|
+
|
1329
1632
|
@validate_call
|
1330
1633
|
def post_model_alert_rule(
|
1331
1634
|
self,
|
@@ -24,6 +24,7 @@ from scope_client.api_bindings.models.alert_check_job_spec import AlertCheckJobS
|
|
24
24
|
from scope_client.api_bindings.models.alert_rule import AlertRule
|
25
25
|
from scope_client.api_bindings.models.alert_rule_interval import AlertRuleInterval
|
26
26
|
from scope_client.api_bindings.models.alert_rule_notification_webhook import AlertRuleNotificationWebhook
|
27
|
+
from scope_client.api_bindings.models.alert_rule_sql_validation_resp import AlertRuleSQLValidationResp
|
27
28
|
from scope_client.api_bindings.models.alert_rule_sort import AlertRuleSort
|
28
29
|
from scope_client.api_bindings.models.alert_sort import AlertSort
|
29
30
|
from scope_client.api_bindings.models.alert_webhook_called import AlertWebhookCalled
|
@@ -280,6 +281,7 @@ from scope_client.api_bindings.models.user_credentials import UserCredentials
|
|
280
281
|
from scope_client.api_bindings.models.user_service_account_credentials import UserServiceAccountCredentials
|
281
282
|
from scope_client.api_bindings.models.user_sort import UserSort
|
282
283
|
from scope_client.api_bindings.models.user_type import UserType
|
284
|
+
from scope_client.api_bindings.models.validate_alert_rule_query_req import ValidateAlertRuleQueryReq
|
283
285
|
from scope_client.api_bindings.models.validation_error import ValidationError
|
284
286
|
from scope_client.api_bindings.models.validation_error_loc_inner import ValidationErrorLocInner
|
285
287
|
from scope_client.api_bindings.models.webhook import Webhook
|
@@ -0,0 +1,93 @@
|
|
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
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
22
|
+
from typing import Optional, Set
|
23
|
+
from typing_extensions import Self
|
24
|
+
|
25
|
+
class AlertRuleSQLValidationResp(BaseModel):
|
26
|
+
"""
|
27
|
+
AlertRuleSQLValidationResp
|
28
|
+
""" # noqa: E501
|
29
|
+
has_metric_timestamp_col: StrictBool = Field(description="The name of the metric returned by the alert rule query.")
|
30
|
+
has_metric_value_col: StrictBool = Field(description="The name of the metric returned by the alert rule query.")
|
31
|
+
has_time_templates: StrictBool = Field(description="The name of the metric returned by the alert rule query.")
|
32
|
+
has_interval_templates: StrictBool = Field(description="The name of the metric returned by the alert rule query.")
|
33
|
+
__properties: ClassVar[List[str]] = ["has_metric_timestamp_col", "has_metric_value_col", "has_time_templates", "has_interval_templates"]
|
34
|
+
|
35
|
+
model_config = ConfigDict(
|
36
|
+
populate_by_name=True,
|
37
|
+
validate_assignment=True,
|
38
|
+
protected_namespaces=(),
|
39
|
+
)
|
40
|
+
|
41
|
+
|
42
|
+
def to_str(self) -> str:
|
43
|
+
"""Returns the string representation of the model using alias"""
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
45
|
+
|
46
|
+
def to_json(self) -> str:
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
48
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
49
|
+
return json.dumps(self.to_dict())
|
50
|
+
|
51
|
+
@classmethod
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
53
|
+
"""Create an instance of AlertRuleSQLValidationResp from a JSON string"""
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
55
|
+
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
58
|
+
|
59
|
+
This has the following differences from calling pydantic's
|
60
|
+
`self.model_dump(by_alias=True)`:
|
61
|
+
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
63
|
+
were set at model initialization. Other fields with value `None`
|
64
|
+
are ignored.
|
65
|
+
"""
|
66
|
+
excluded_fields: Set[str] = set([
|
67
|
+
])
|
68
|
+
|
69
|
+
_dict = self.model_dump(
|
70
|
+
by_alias=True,
|
71
|
+
exclude=excluded_fields,
|
72
|
+
exclude_none=True,
|
73
|
+
)
|
74
|
+
return _dict
|
75
|
+
|
76
|
+
@classmethod
|
77
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
78
|
+
"""Create an instance of AlertRuleSQLValidationResp from a dict"""
|
79
|
+
if obj is None:
|
80
|
+
return None
|
81
|
+
|
82
|
+
if not isinstance(obj, dict):
|
83
|
+
return cls.model_validate(obj)
|
84
|
+
|
85
|
+
_obj = cls.model_validate({
|
86
|
+
"has_metric_timestamp_col": obj.get("has_metric_timestamp_col"),
|
87
|
+
"has_metric_value_col": obj.get("has_metric_value_col"),
|
88
|
+
"has_time_templates": obj.get("has_time_templates"),
|
89
|
+
"has_interval_templates": obj.get("has_interval_templates")
|
90
|
+
})
|
91
|
+
return _obj
|
92
|
+
|
93
|
+
|
@@ -0,0 +1,87 @@
|
|
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
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
22
|
+
from typing import Optional, Set
|
23
|
+
from typing_extensions import Self
|
24
|
+
|
25
|
+
class ValidateAlertRuleQueryReq(BaseModel):
|
26
|
+
"""
|
27
|
+
ValidateAlertRuleQueryReq
|
28
|
+
""" # noqa: E501
|
29
|
+
query: StrictStr = Field(description="The query of the alert rule.")
|
30
|
+
__properties: ClassVar[List[str]] = ["query"]
|
31
|
+
|
32
|
+
model_config = ConfigDict(
|
33
|
+
populate_by_name=True,
|
34
|
+
validate_assignment=True,
|
35
|
+
protected_namespaces=(),
|
36
|
+
)
|
37
|
+
|
38
|
+
|
39
|
+
def to_str(self) -> str:
|
40
|
+
"""Returns the string representation of the model using alias"""
|
41
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
42
|
+
|
43
|
+
def to_json(self) -> str:
|
44
|
+
"""Returns the JSON representation of the model using alias"""
|
45
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
46
|
+
return json.dumps(self.to_dict())
|
47
|
+
|
48
|
+
@classmethod
|
49
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
50
|
+
"""Create an instance of ValidateAlertRuleQueryReq from a JSON string"""
|
51
|
+
return cls.from_dict(json.loads(json_str))
|
52
|
+
|
53
|
+
def to_dict(self) -> Dict[str, Any]:
|
54
|
+
"""Return the dictionary representation of the model using alias.
|
55
|
+
|
56
|
+
This has the following differences from calling pydantic's
|
57
|
+
`self.model_dump(by_alias=True)`:
|
58
|
+
|
59
|
+
* `None` is only added to the output dict for nullable fields that
|
60
|
+
were set at model initialization. Other fields with value `None`
|
61
|
+
are ignored.
|
62
|
+
"""
|
63
|
+
excluded_fields: Set[str] = set([
|
64
|
+
])
|
65
|
+
|
66
|
+
_dict = self.model_dump(
|
67
|
+
by_alias=True,
|
68
|
+
exclude=excluded_fields,
|
69
|
+
exclude_none=True,
|
70
|
+
)
|
71
|
+
return _dict
|
72
|
+
|
73
|
+
@classmethod
|
74
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
75
|
+
"""Create an instance of ValidateAlertRuleQueryReq from a dict"""
|
76
|
+
if obj is None:
|
77
|
+
return None
|
78
|
+
|
79
|
+
if not isinstance(obj, dict):
|
80
|
+
return cls.model_validate(obj)
|
81
|
+
|
82
|
+
_obj = cls.model_validate({
|
83
|
+
"query": obj.get("query")
|
84
|
+
})
|
85
|
+
return _obj
|
86
|
+
|
87
|
+
|
@@ -1,12 +1,12 @@
|
|
1
1
|
scope_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
scope_client/api_bindings/__init__.py,sha256=
|
2
|
+
scope_client/api_bindings/__init__.py,sha256=AR_fvd0G_47KW3t6gCHp99owHZhYJsrBHYJtRhledWY,25589
|
3
3
|
scope_client/api_bindings/api_client.py,sha256=nkt88XDyPiuURu94lnI4MtOfMeYXd_jazGUde0T4xVU,27538
|
4
4
|
scope_client/api_bindings/api_response.py,sha256=eMxw1mpmJcoGZ3gs9z6jM4oYoZ10Gjk333s9sKxGv7s,652
|
5
5
|
scope_client/api_bindings/configuration.py,sha256=a0o2OhNYo7GdZscfNtFKW2kfgoln1mcWE-8E_UeiWv8,15338
|
6
6
|
scope_client/api_bindings/exceptions.py,sha256=yy0Uot-WkcM6-PbNo2KDnrKAUL_PFmeCTD2tvq_gFp4,5977
|
7
7
|
scope_client/api_bindings/rest.py,sha256=WjYLgwpOMypfMPuivIUYSaIJLd8YxqIIFx8BTA3RwXA,9428
|
8
8
|
scope_client/api_bindings/api/__init__.py,sha256=j2pVJcLDLQrhMZkLemyUh9_RKuYyjJyJ3rYB35pZmo4,1992
|
9
|
-
scope_client/api_bindings/api/alert_rules_v1_api.py,sha256=
|
9
|
+
scope_client/api_bindings/api/alert_rules_v1_api.py,sha256=dJdqDYUIWTXkHZL6BS4ubCcqwxK3lUJd2HFOWRNRE4s,77200
|
10
10
|
scope_client/api_bindings/api/alerts_v1_api.py,sha256=hAyljzNdtm3ruaN1C5qyTCZJF5u0LqmxPraZoACockk,41281
|
11
11
|
scope_client/api_bindings/api/authorization_v1_api.py,sha256=0hHddXMvsw87SV-VE87mTp1afVyb8AB2pcCIjie4emg,168384
|
12
12
|
scope_client/api_bindings/api/connector_schemas_v1_api.py,sha256=-lkx0uSc0hw4lzdlfiRcZVI-d2dlsq4CbtJ1sdyiu2U,21812
|
@@ -32,7 +32,7 @@ scope_client/api_bindings/api/upsolve_v1_api.py,sha256=Vdep9x-_lIJq_kOwtsGqYqkss
|
|
32
32
|
scope_client/api_bindings/api/users_v1_api.py,sha256=3DpuXoHuWZvN8hU409AuyltBBwfK1PEBTeF5kKnlaek,114510
|
33
33
|
scope_client/api_bindings/api/webhooks_v1_api.py,sha256=86tRi7pgwICshf8WVyYA1WrJggThpnsTaON9Mx8R-0M,71286
|
34
34
|
scope_client/api_bindings/api/workspaces_v1_api.py,sha256=OjMc-pJe2JAGgv5ZGTD8_TkQxw82vz2e381-5m37vJ4,58653
|
35
|
-
scope_client/api_bindings/models/__init__.py,sha256=
|
35
|
+
scope_client/api_bindings/models/__init__.py,sha256=NzN5zS0bKT2QzKESGXOBLDIIKtaLutTmf3katGMty30,23002
|
36
36
|
scope_client/api_bindings/models/aggregation_metric_type.py,sha256=USKpDqhX4TQ4lqIoHOp3q70mydsf1u_zc1EKus9QhYo,783
|
37
37
|
scope_client/api_bindings/models/aggregation_spec.py,sha256=gWFTgLqxNdiIw4iXwbNqKAnAwDpbcgeoFfQ_7VxtKOQ,4109
|
38
38
|
scope_client/api_bindings/models/aggregation_spec_schema.py,sha256=MHGlB9eF8NfOasOHiqj1ZzYiBaIl8y8J2SmQysoSWVU,4624
|
@@ -44,6 +44,7 @@ scope_client/api_bindings/models/alert_rule.py,sha256=siy2Gih0UC47JIruTqt7ffL_HP
|
|
44
44
|
scope_client/api_bindings/models/alert_rule_interval.py,sha256=Q5c8FHek5L_JQqRamlV-vUxSxJeymCPNPJySSsMfkXs,2776
|
45
45
|
scope_client/api_bindings/models/alert_rule_notification_webhook.py,sha256=Oi6c_34jdVqT_WU76wrs8kla3-kNdD7rVEZDouSHaAc,2669
|
46
46
|
scope_client/api_bindings/models/alert_rule_sort.py,sha256=ewtr9F3cttc4VpoCZcgOLd18zQUanhV18D0D0RLbmaQ,761
|
47
|
+
scope_client/api_bindings/models/alert_rule_sql_validation_resp.py,sha256=hCnF05ih5-qjaO6nYjNjUGAX9wBgAzlJQXe1IPrpA6E,3324
|
47
48
|
scope_client/api_bindings/models/alert_sort.py,sha256=4su0uTugb5QPxuLc25VTJDe9rrVK1S2glB_uki-pJYY,759
|
48
49
|
scope_client/api_bindings/models/alert_webhook_called.py,sha256=FnTm6lEDN9r08sSTYq49THxSAwcGpU-y4-iG5nK0LBs,3250
|
49
50
|
scope_client/api_bindings/models/available_dataset.py,sha256=Pj6blIss0fgWE8WYupg1uvd8nJdSPaNlA7cwGia7BZc,6339
|
@@ -299,6 +300,7 @@ scope_client/api_bindings/models/user_credentials.py,sha256=EfUMAguJoZBFxUY81mPW
|
|
299
300
|
scope_client/api_bindings/models/user_service_account_credentials.py,sha256=wiuOaWIE9FmEdERkx94jdM41B-OXDeeRrEF71ZRtwqA,5704
|
300
301
|
scope_client/api_bindings/models/user_sort.py,sha256=I7WwH9B9G46681oGjcG-Oa-cHASpTDhqVcXBKfNPuZs,796
|
301
302
|
scope_client/api_bindings/models/user_type.py,sha256=mdMxrQ317Q_Td13CRUcbLVLTN02sjQb_d-5aX4LWRRw,786
|
303
|
+
scope_client/api_bindings/models/validate_alert_rule_query_req.py,sha256=yIeLjNXOLBFJQUYHr9knyuGa7hMZqzYF06GR4yKqs-o,2584
|
302
304
|
scope_client/api_bindings/models/validation_error.py,sha256=zxWsSF4di49xg_XpfsxAwfSVYn3vM4o7RUy2IY5-GGo,3112
|
303
305
|
scope_client/api_bindings/models/validation_error_loc_inner.py,sha256=HxkBA9FcJbXz201j-MgNcDAnOc_BIWlcnFEcZ04-JOw,4890
|
304
306
|
scope_client/api_bindings/models/webhook.py,sha256=7lWcdxF2nqT9TcRQQXOy0wd5AIImrFYjRYacstd-XYE,4194
|
@@ -313,7 +315,7 @@ scope_client/auth/device_authorizer.py,sha256=bJMIZRjkwQwoSWTLEp7OoXM2MytO3ADSD9
|
|
313
315
|
scope_client/auth/discovery.py,sha256=hR0MglzRWHdwyi72If5hTnjO50fDJhquP_DD7OzjIQQ,1188
|
314
316
|
scope_client/auth/oauth_api_config.py,sha256=wcEslusOFKr0oTzW0Ku2MhM1mvc-nm4BEJU8LHo1uXA,1347
|
315
317
|
scope_client/auth/session.py,sha256=wCriib5ajfm1e1WTL_QXVCJmEOrGwQg_0v91e5qrC6g,2649
|
316
|
-
scope_client-1.4.
|
317
|
-
scope_client-1.4.
|
318
|
-
scope_client-1.4.
|
319
|
-
scope_client-1.4.
|
318
|
+
scope_client-1.4.1090.dist-info/METADATA,sha256=ifyM6xDQTMNp2p9hYZAedXh3d-up6KAUmcoknNliMrw,1777
|
319
|
+
scope_client-1.4.1090.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
320
|
+
scope_client-1.4.1090.dist-info/top_level.txt,sha256=x6MngS09hi-TUDoUGb3SLzmnf8_cf8IVAVNPSqtTzAY,13
|
321
|
+
scope_client-1.4.1090.dist-info/RECORD,,
|
File without changes
|
File without changes
|