scope-client 1.4.1070__py3-none-any.whl → 1.4.1071__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/models/__init__.py +2 -0
- scope_client/api_bindings/models/alert.py +7 -1
- scope_client/api_bindings/models/alert_rule.py +7 -1
- scope_client/api_bindings/models/alert_rule_interval.py +90 -0
- scope_client/api_bindings/models/interval_unit.py +39 -0
- scope_client/api_bindings/models/patch_alert_rule.py +12 -1
- scope_client/api_bindings/models/post_alert.py +7 -1
- scope_client/api_bindings/models/post_alert_rule.py +7 -1
- scope_client/api_bindings/models/post_metrics_query.py +12 -1
- {scope_client-1.4.1070.dist-info → scope_client-1.4.1071.dist-info}/METADATA +1 -1
- {scope_client-1.4.1070.dist-info → scope_client-1.4.1071.dist-info}/RECORD +14 -12
- {scope_client-1.4.1070.dist-info → scope_client-1.4.1071.dist-info}/WHEEL +0 -0
- {scope_client-1.4.1070.dist-info → scope_client-1.4.1071.dist-info}/top_level.txt +0 -0
@@ -64,6 +64,7 @@ from scope_client.api_bindings.models.alert import Alert
|
|
64
64
|
from scope_client.api_bindings.models.alert_bound import AlertBound
|
65
65
|
from scope_client.api_bindings.models.alert_check_job_spec import AlertCheckJobSpec
|
66
66
|
from scope_client.api_bindings.models.alert_rule import AlertRule
|
67
|
+
from scope_client.api_bindings.models.alert_rule_interval import AlertRuleInterval
|
67
68
|
from scope_client.api_bindings.models.alert_rule_notification_webhook import AlertRuleNotificationWebhook
|
68
69
|
from scope_client.api_bindings.models.alert_rule_sort import AlertRuleSort
|
69
70
|
from scope_client.api_bindings.models.alert_sort import AlertSort
|
@@ -141,6 +142,7 @@ from scope_client.api_bindings.models.infinite_pagination import InfinitePaginat
|
|
141
142
|
from scope_client.api_bindings.models.infinite_resource_list_alert import InfiniteResourceListAlert
|
142
143
|
from scope_client.api_bindings.models.infinite_resource_list_job import InfiniteResourceListJob
|
143
144
|
from scope_client.api_bindings.models.internal_server_error import InternalServerError
|
145
|
+
from scope_client.api_bindings.models.interval_unit import IntervalUnit
|
144
146
|
from scope_client.api_bindings.models.invite_new_user import InviteNewUser
|
145
147
|
from scope_client.api_bindings.models.items import Items
|
146
148
|
from scope_client.api_bindings.models.items1 import Items1
|
@@ -22,6 +22,7 @@ from scope_client.api_bindings.models.alert import Alert
|
|
22
22
|
from scope_client.api_bindings.models.alert_bound import AlertBound
|
23
23
|
from scope_client.api_bindings.models.alert_check_job_spec import AlertCheckJobSpec
|
24
24
|
from scope_client.api_bindings.models.alert_rule import AlertRule
|
25
|
+
from scope_client.api_bindings.models.alert_rule_interval import AlertRuleInterval
|
25
26
|
from scope_client.api_bindings.models.alert_rule_notification_webhook import AlertRuleNotificationWebhook
|
26
27
|
from scope_client.api_bindings.models.alert_rule_sort import AlertRuleSort
|
27
28
|
from scope_client.api_bindings.models.alert_sort import AlertSort
|
@@ -99,6 +100,7 @@ from scope_client.api_bindings.models.infinite_pagination import InfinitePaginat
|
|
99
100
|
from scope_client.api_bindings.models.infinite_resource_list_alert import InfiniteResourceListAlert
|
100
101
|
from scope_client.api_bindings.models.infinite_resource_list_job import InfiniteResourceListJob
|
101
102
|
from scope_client.api_bindings.models.internal_server_error import InternalServerError
|
103
|
+
from scope_client.api_bindings.models.interval_unit import IntervalUnit
|
102
104
|
from scope_client.api_bindings.models.invite_new_user import InviteNewUser
|
103
105
|
from scope_client.api_bindings.models.items import Items
|
104
106
|
from scope_client.api_bindings.models.items1 import Items1
|
@@ -21,6 +21,7 @@ from datetime import datetime
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
23
23
|
from scope_client.api_bindings.models.alert_bound import AlertBound
|
24
|
+
from scope_client.api_bindings.models.alert_rule_interval import AlertRuleInterval
|
24
25
|
from typing import Optional, Set
|
25
26
|
from typing_extensions import Self
|
26
27
|
|
@@ -33,6 +34,7 @@ class Alert(BaseModel):
|
|
33
34
|
value: Union[StrictFloat, StrictInt] = Field(description="The value of the metric that triggered the alert.")
|
34
35
|
threshold: Union[StrictFloat, StrictInt] = Field(description="The threshold that triggered the alert.")
|
35
36
|
bound: AlertBound = Field(description="The bound of the alert.")
|
37
|
+
interval: AlertRuleInterval = Field(description="The interval of the alert rule, commonly '1 day', '1 hour', etc.")
|
36
38
|
dimensions: Optional[Dict[str, Any]]
|
37
39
|
alert_rule_id: StrictStr = Field(description="The alert rule id of the alert.")
|
38
40
|
job_id: Optional[StrictStr] = None
|
@@ -43,7 +45,7 @@ class Alert(BaseModel):
|
|
43
45
|
alert_rule_name: StrictStr = Field(description="The name of the alert rule.")
|
44
46
|
alert_rule_metric_name: StrictStr = Field(description="The name of the metric returned by the alert rule query.")
|
45
47
|
is_duplicate_of: Optional[StrictStr] = None
|
46
|
-
__properties: ClassVar[List[str]] = ["description", "timestamp", "value", "threshold", "bound", "dimensions", "alert_rule_id", "job_id", "created_at", "updated_at", "id", "model_id", "alert_rule_name", "alert_rule_metric_name", "is_duplicate_of"]
|
48
|
+
__properties: ClassVar[List[str]] = ["description", "timestamp", "value", "threshold", "bound", "interval", "dimensions", "alert_rule_id", "job_id", "created_at", "updated_at", "id", "model_id", "alert_rule_name", "alert_rule_metric_name", "is_duplicate_of"]
|
47
49
|
|
48
50
|
model_config = ConfigDict(
|
49
51
|
populate_by_name=True,
|
@@ -84,6 +86,9 @@ class Alert(BaseModel):
|
|
84
86
|
exclude=excluded_fields,
|
85
87
|
exclude_none=True,
|
86
88
|
)
|
89
|
+
# override the default output from pydantic by calling `to_dict()` of interval
|
90
|
+
if self.interval:
|
91
|
+
_dict['interval'] = self.interval.to_dict()
|
87
92
|
# set to None if description (nullable) is None
|
88
93
|
# and model_fields_set contains the field
|
89
94
|
if self.description is None and "description" in self.model_fields_set:
|
@@ -121,6 +126,7 @@ class Alert(BaseModel):
|
|
121
126
|
"value": obj.get("value"),
|
122
127
|
"threshold": obj.get("threshold"),
|
123
128
|
"bound": obj.get("bound"),
|
129
|
+
"interval": AlertRuleInterval.from_dict(obj["interval"]) if obj.get("interval") is not None else None,
|
124
130
|
"dimensions": obj.get("dimensions"),
|
125
131
|
"alert_rule_id": obj.get("alert_rule_id"),
|
126
132
|
"job_id": obj.get("job_id"),
|
@@ -21,6 +21,7 @@ from datetime import datetime
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
23
23
|
from scope_client.api_bindings.models.alert_bound import AlertBound
|
24
|
+
from scope_client.api_bindings.models.alert_rule_interval import AlertRuleInterval
|
24
25
|
from scope_client.api_bindings.models.alert_rule_notification_webhook import AlertRuleNotificationWebhook
|
25
26
|
from scope_client.api_bindings.models.user import User
|
26
27
|
from typing import Optional, Set
|
@@ -40,9 +41,10 @@ class AlertRule(BaseModel):
|
|
40
41
|
bound: AlertBound = Field(description="The bound of the alert rule.")
|
41
42
|
query: StrictStr = Field(description="The query of the alert rule.")
|
42
43
|
metric_name: StrictStr = Field(description="The name of the metric returned by the alert rule query.")
|
44
|
+
interval: AlertRuleInterval = Field(description="The interval of the alert rule, commonly '1 day', '1 hour', etc.")
|
43
45
|
last_updated_by_user: Optional[User] = None
|
44
46
|
notification_webhooks: List[AlertRuleNotificationWebhook] = Field(description="Notification webhooks configured for the alert rule.")
|
45
|
-
__properties: ClassVar[List[str]] = ["created_at", "updated_at", "id", "model_id", "name", "description", "threshold", "bound", "query", "metric_name", "last_updated_by_user", "notification_webhooks"]
|
47
|
+
__properties: ClassVar[List[str]] = ["created_at", "updated_at", "id", "model_id", "name", "description", "threshold", "bound", "query", "metric_name", "interval", "last_updated_by_user", "notification_webhooks"]
|
46
48
|
|
47
49
|
model_config = ConfigDict(
|
48
50
|
populate_by_name=True,
|
@@ -83,6 +85,9 @@ class AlertRule(BaseModel):
|
|
83
85
|
exclude=excluded_fields,
|
84
86
|
exclude_none=True,
|
85
87
|
)
|
88
|
+
# override the default output from pydantic by calling `to_dict()` of interval
|
89
|
+
if self.interval:
|
90
|
+
_dict['interval'] = self.interval.to_dict()
|
86
91
|
# override the default output from pydantic by calling `to_dict()` of last_updated_by_user
|
87
92
|
if self.last_updated_by_user:
|
88
93
|
_dict['last_updated_by_user'] = self.last_updated_by_user.to_dict()
|
@@ -125,6 +130,7 @@ class AlertRule(BaseModel):
|
|
125
130
|
"bound": obj.get("bound"),
|
126
131
|
"query": obj.get("query"),
|
127
132
|
"metric_name": obj.get("metric_name"),
|
133
|
+
"interval": AlertRuleInterval.from_dict(obj["interval"]) if obj.get("interval") is not None else None,
|
128
134
|
"last_updated_by_user": User.from_dict(obj["last_updated_by_user"]) if obj.get("last_updated_by_user") is not None else None,
|
129
135
|
"notification_webhooks": [AlertRuleNotificationWebhook.from_dict(_item) for _item in obj["notification_webhooks"]] if obj.get("notification_webhooks") is not None else None
|
130
136
|
})
|
@@ -0,0 +1,90 @@
|
|
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, StrictInt
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
22
|
+
from scope_client.api_bindings.models.interval_unit import IntervalUnit
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
25
|
+
|
26
|
+
class AlertRuleInterval(BaseModel):
|
27
|
+
"""
|
28
|
+
AlertRuleInterval
|
29
|
+
""" # noqa: E501
|
30
|
+
unit: IntervalUnit = Field(description="Unit of time interval. Example: 'minutes'.")
|
31
|
+
count: StrictInt = Field(description="Number of units in the interval. Example: '5'.")
|
32
|
+
__properties: ClassVar[List[str]] = ["unit", "count"]
|
33
|
+
|
34
|
+
model_config = ConfigDict(
|
35
|
+
populate_by_name=True,
|
36
|
+
validate_assignment=True,
|
37
|
+
protected_namespaces=(),
|
38
|
+
)
|
39
|
+
|
40
|
+
|
41
|
+
def to_str(self) -> str:
|
42
|
+
"""Returns the string representation of the model using alias"""
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
44
|
+
|
45
|
+
def to_json(self) -> str:
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
48
|
+
return json.dumps(self.to_dict())
|
49
|
+
|
50
|
+
@classmethod
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
52
|
+
"""Create an instance of AlertRuleInterval from a JSON string"""
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
54
|
+
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
57
|
+
|
58
|
+
This has the following differences from calling pydantic's
|
59
|
+
`self.model_dump(by_alias=True)`:
|
60
|
+
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
62
|
+
were set at model initialization. Other fields with value `None`
|
63
|
+
are ignored.
|
64
|
+
"""
|
65
|
+
excluded_fields: Set[str] = set([
|
66
|
+
])
|
67
|
+
|
68
|
+
_dict = self.model_dump(
|
69
|
+
by_alias=True,
|
70
|
+
exclude=excluded_fields,
|
71
|
+
exclude_none=True,
|
72
|
+
)
|
73
|
+
return _dict
|
74
|
+
|
75
|
+
@classmethod
|
76
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
77
|
+
"""Create an instance of AlertRuleInterval from a dict"""
|
78
|
+
if obj is None:
|
79
|
+
return None
|
80
|
+
|
81
|
+
if not isinstance(obj, dict):
|
82
|
+
return cls.model_validate(obj)
|
83
|
+
|
84
|
+
_obj = cls.model_validate({
|
85
|
+
"unit": obj.get("unit"),
|
86
|
+
"count": obj.get("count")
|
87
|
+
})
|
88
|
+
return _obj
|
89
|
+
|
90
|
+
|
@@ -0,0 +1,39 @@
|
|
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 json
|
17
|
+
from enum import Enum
|
18
|
+
from typing_extensions import Self
|
19
|
+
|
20
|
+
|
21
|
+
class IntervalUnit(str, Enum):
|
22
|
+
"""
|
23
|
+
IntervalUnit
|
24
|
+
"""
|
25
|
+
|
26
|
+
"""
|
27
|
+
allowed enum values
|
28
|
+
"""
|
29
|
+
SECONDS = 'seconds'
|
30
|
+
MINUTES = 'minutes'
|
31
|
+
HOURS = 'hours'
|
32
|
+
DAYS = 'days'
|
33
|
+
|
34
|
+
@classmethod
|
35
|
+
def from_json(cls, json_str: str) -> Self:
|
36
|
+
"""Create an instance of IntervalUnit from a JSON string"""
|
37
|
+
return cls(json.loads(json_str))
|
38
|
+
|
39
|
+
|
@@ -20,6 +20,7 @@ import json
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
22
22
|
from scope_client.api_bindings.models.alert_bound import AlertBound
|
23
|
+
from scope_client.api_bindings.models.alert_rule_interval import AlertRuleInterval
|
23
24
|
from typing import Optional, Set
|
24
25
|
from typing_extensions import Self
|
25
26
|
|
@@ -33,8 +34,9 @@ class PatchAlertRule(BaseModel):
|
|
33
34
|
bound: Optional[AlertBound] = None
|
34
35
|
query: Optional[StrictStr] = None
|
35
36
|
metric_name: Optional[StrictStr] = None
|
37
|
+
interval: Optional[AlertRuleInterval] = None
|
36
38
|
notification_webhook_ids: Optional[List[StrictStr]] = None
|
37
|
-
__properties: ClassVar[List[str]] = ["name", "description", "threshold", "bound", "query", "metric_name", "notification_webhook_ids"]
|
39
|
+
__properties: ClassVar[List[str]] = ["name", "description", "threshold", "bound", "query", "metric_name", "interval", "notification_webhook_ids"]
|
38
40
|
|
39
41
|
model_config = ConfigDict(
|
40
42
|
populate_by_name=True,
|
@@ -75,6 +77,9 @@ class PatchAlertRule(BaseModel):
|
|
75
77
|
exclude=excluded_fields,
|
76
78
|
exclude_none=True,
|
77
79
|
)
|
80
|
+
# override the default output from pydantic by calling `to_dict()` of interval
|
81
|
+
if self.interval:
|
82
|
+
_dict['interval'] = self.interval.to_dict()
|
78
83
|
# set to None if name (nullable) is None
|
79
84
|
# and model_fields_set contains the field
|
80
85
|
if self.name is None and "name" in self.model_fields_set:
|
@@ -105,6 +110,11 @@ class PatchAlertRule(BaseModel):
|
|
105
110
|
if self.metric_name is None and "metric_name" in self.model_fields_set:
|
106
111
|
_dict['metric_name'] = None
|
107
112
|
|
113
|
+
# set to None if interval (nullable) is None
|
114
|
+
# and model_fields_set contains the field
|
115
|
+
if self.interval is None and "interval" in self.model_fields_set:
|
116
|
+
_dict['interval'] = None
|
117
|
+
|
108
118
|
# set to None if notification_webhook_ids (nullable) is None
|
109
119
|
# and model_fields_set contains the field
|
110
120
|
if self.notification_webhook_ids is None and "notification_webhook_ids" in self.model_fields_set:
|
@@ -128,6 +138,7 @@ class PatchAlertRule(BaseModel):
|
|
128
138
|
"bound": obj.get("bound"),
|
129
139
|
"query": obj.get("query"),
|
130
140
|
"metric_name": obj.get("metric_name"),
|
141
|
+
"interval": AlertRuleInterval.from_dict(obj["interval"]) if obj.get("interval") is not None else None,
|
131
142
|
"notification_webhook_ids": obj.get("notification_webhook_ids")
|
132
143
|
})
|
133
144
|
return _obj
|
@@ -21,6 +21,7 @@ from datetime import datetime
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
23
23
|
from scope_client.api_bindings.models.alert_bound import AlertBound
|
24
|
+
from scope_client.api_bindings.models.alert_rule_interval import AlertRuleInterval
|
24
25
|
from typing import Optional, Set
|
25
26
|
from typing_extensions import Self
|
26
27
|
|
@@ -33,10 +34,11 @@ class PostAlert(BaseModel):
|
|
33
34
|
value: Union[StrictFloat, StrictInt] = Field(description="The value of the metric that triggered the alert.")
|
34
35
|
threshold: Union[StrictFloat, StrictInt] = Field(description="The threshold that triggered the alert.")
|
35
36
|
bound: AlertBound = Field(description="The bound of the alert.")
|
37
|
+
interval: AlertRuleInterval = Field(description="The interval of the alert rule, commonly '1 day', '1 hour', etc.")
|
36
38
|
dimensions: Optional[Dict[str, Any]]
|
37
39
|
alert_rule_id: StrictStr = Field(description="The alert rule id of the alert.")
|
38
40
|
job_id: Optional[StrictStr] = None
|
39
|
-
__properties: ClassVar[List[str]] = ["description", "timestamp", "value", "threshold", "bound", "dimensions", "alert_rule_id", "job_id"]
|
41
|
+
__properties: ClassVar[List[str]] = ["description", "timestamp", "value", "threshold", "bound", "interval", "dimensions", "alert_rule_id", "job_id"]
|
40
42
|
|
41
43
|
model_config = ConfigDict(
|
42
44
|
populate_by_name=True,
|
@@ -77,6 +79,9 @@ class PostAlert(BaseModel):
|
|
77
79
|
exclude=excluded_fields,
|
78
80
|
exclude_none=True,
|
79
81
|
)
|
82
|
+
# override the default output from pydantic by calling `to_dict()` of interval
|
83
|
+
if self.interval:
|
84
|
+
_dict['interval'] = self.interval.to_dict()
|
80
85
|
# set to None if description (nullable) is None
|
81
86
|
# and model_fields_set contains the field
|
82
87
|
if self.description is None and "description" in self.model_fields_set:
|
@@ -109,6 +114,7 @@ class PostAlert(BaseModel):
|
|
109
114
|
"value": obj.get("value"),
|
110
115
|
"threshold": obj.get("threshold"),
|
111
116
|
"bound": obj.get("bound"),
|
117
|
+
"interval": AlertRuleInterval.from_dict(obj["interval"]) if obj.get("interval") is not None else None,
|
112
118
|
"dimensions": obj.get("dimensions"),
|
113
119
|
"alert_rule_id": obj.get("alert_rule_id"),
|
114
120
|
"job_id": obj.get("job_id")
|
@@ -20,6 +20,7 @@ import json
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
22
22
|
from scope_client.api_bindings.models.alert_bound import AlertBound
|
23
|
+
from scope_client.api_bindings.models.alert_rule_interval import AlertRuleInterval
|
23
24
|
from typing import Optional, Set
|
24
25
|
from typing_extensions import Self
|
25
26
|
|
@@ -33,8 +34,9 @@ class PostAlertRule(BaseModel):
|
|
33
34
|
bound: AlertBound = Field(description="The bound of the alert rule.")
|
34
35
|
query: StrictStr = Field(description="The query of the alert rule.")
|
35
36
|
metric_name: StrictStr = Field(description="The name of the metric returned by the alert rule query.")
|
37
|
+
interval: AlertRuleInterval = Field(description="The interval of the alert rule, commonly '1 day', '1 hour', etc.")
|
36
38
|
notification_webhook_ids: Optional[List[StrictStr]] = Field(default=None, description="The notification webhook IDs where the alert rule will send alert notification.")
|
37
|
-
__properties: ClassVar[List[str]] = ["name", "description", "threshold", "bound", "query", "metric_name", "notification_webhook_ids"]
|
39
|
+
__properties: ClassVar[List[str]] = ["name", "description", "threshold", "bound", "query", "metric_name", "interval", "notification_webhook_ids"]
|
38
40
|
|
39
41
|
model_config = ConfigDict(
|
40
42
|
populate_by_name=True,
|
@@ -75,6 +77,9 @@ class PostAlertRule(BaseModel):
|
|
75
77
|
exclude=excluded_fields,
|
76
78
|
exclude_none=True,
|
77
79
|
)
|
80
|
+
# override the default output from pydantic by calling `to_dict()` of interval
|
81
|
+
if self.interval:
|
82
|
+
_dict['interval'] = self.interval.to_dict()
|
78
83
|
# set to None if description (nullable) is None
|
79
84
|
# and model_fields_set contains the field
|
80
85
|
if self.description is None and "description" in self.model_fields_set:
|
@@ -98,6 +103,7 @@ class PostAlertRule(BaseModel):
|
|
98
103
|
"bound": obj.get("bound"),
|
99
104
|
"query": obj.get("query"),
|
100
105
|
"metric_name": obj.get("metric_name"),
|
106
|
+
"interval": AlertRuleInterval.from_dict(obj["interval"]) if obj.get("interval") is not None else None,
|
101
107
|
"notification_webhook_ids": obj.get("notification_webhook_ids")
|
102
108
|
})
|
103
109
|
return _obj
|
@@ -19,6 +19,7 @@ import json
|
|
19
19
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
+
from scope_client.api_bindings.models.alert_rule_interval import AlertRuleInterval
|
22
23
|
from scope_client.api_bindings.models.post_metrics_query_time_range import PostMetricsQueryTimeRange
|
23
24
|
from scope_client.api_bindings.models.result_filter import ResultFilter
|
24
25
|
from typing import Optional, Set
|
@@ -30,9 +31,10 @@ class PostMetricsQuery(BaseModel):
|
|
30
31
|
""" # noqa: E501
|
31
32
|
query: StrictStr = Field(description="Query for retrieving the metrics.")
|
32
33
|
time_range: PostMetricsQueryTimeRange = Field(description="Time range to filter the metrics by.")
|
34
|
+
interval: Optional[AlertRuleInterval] = None
|
33
35
|
limit: Optional[StrictInt] = Field(default=50, description="Limit the number of metrics returned. Defaults to 50.")
|
34
36
|
result_filter: Optional[ResultFilter] = None
|
35
|
-
__properties: ClassVar[List[str]] = ["query", "time_range", "limit", "result_filter"]
|
37
|
+
__properties: ClassVar[List[str]] = ["query", "time_range", "interval", "limit", "result_filter"]
|
36
38
|
|
37
39
|
model_config = ConfigDict(
|
38
40
|
populate_by_name=True,
|
@@ -76,9 +78,17 @@ class PostMetricsQuery(BaseModel):
|
|
76
78
|
# override the default output from pydantic by calling `to_dict()` of time_range
|
77
79
|
if self.time_range:
|
78
80
|
_dict['time_range'] = self.time_range.to_dict()
|
81
|
+
# override the default output from pydantic by calling `to_dict()` of interval
|
82
|
+
if self.interval:
|
83
|
+
_dict['interval'] = self.interval.to_dict()
|
79
84
|
# override the default output from pydantic by calling `to_dict()` of result_filter
|
80
85
|
if self.result_filter:
|
81
86
|
_dict['result_filter'] = self.result_filter.to_dict()
|
87
|
+
# set to None if interval (nullable) is None
|
88
|
+
# and model_fields_set contains the field
|
89
|
+
if self.interval is None and "interval" in self.model_fields_set:
|
90
|
+
_dict['interval'] = None
|
91
|
+
|
82
92
|
# set to None if result_filter (nullable) is None
|
83
93
|
# and model_fields_set contains the field
|
84
94
|
if self.result_filter is None and "result_filter" in self.model_fields_set:
|
@@ -98,6 +108,7 @@ class PostMetricsQuery(BaseModel):
|
|
98
108
|
_obj = cls.model_validate({
|
99
109
|
"query": obj.get("query"),
|
100
110
|
"time_range": PostMetricsQueryTimeRange.from_dict(obj["time_range"]) if obj.get("time_range") is not None else None,
|
111
|
+
"interval": AlertRuleInterval.from_dict(obj["interval"]) if obj.get("interval") is not None else None,
|
101
112
|
"limit": obj.get("limit") if obj.get("limit") is not None else 50,
|
102
113
|
"result_filter": ResultFilter.from_dict(obj["result_filter"]) if obj.get("result_filter") is not None else None
|
103
114
|
})
|
@@ -1,5 +1,5 @@
|
|
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=8oLR-gOmoSAPUCCjSa85qy-ljqMTBNhYXiexNtvQMzc,25385
|
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
|
@@ -32,15 +32,16 @@ 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=JnkES4cYmumzm43uqdmBPeQmQ3nq5X62TwJBc-KtSZA,22798
|
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
|
39
39
|
scope_client/api_bindings/models/aggregation_spec_schema_init_args_inner.py,sha256=r_dYE8Ew3wrmDfJFwK7btFxiyI_y2HjCs9BZEhRrM6E,7536
|
40
|
-
scope_client/api_bindings/models/alert.py,sha256=
|
40
|
+
scope_client/api_bindings/models/alert.py,sha256=DoXqU_G1fORJni7_iT5O5mx8pG8Vg9b7f1FTg77xzP4,5966
|
41
41
|
scope_client/api_bindings/models/alert_bound.py,sha256=iobunYuV7vKLg6EryqI3MftCkYrmeJtRC7ATONCfztU,768
|
42
42
|
scope_client/api_bindings/models/alert_check_job_spec.py,sha256=dJnsLFbfvdM9AYUWAubMoOQ79dU4FhFtHHyy3Ux1WtY,3595
|
43
|
-
scope_client/api_bindings/models/alert_rule.py,sha256=
|
43
|
+
scope_client/api_bindings/models/alert_rule.py,sha256=siy2Gih0UC47JIruTqt7ffL_HPqi-CaAfd0Dr1HmGSQ,6226
|
44
|
+
scope_client/api_bindings/models/alert_rule_interval.py,sha256=Q5c8FHek5L_JQqRamlV-vUxSxJeymCPNPJySSsMfkXs,2776
|
44
45
|
scope_client/api_bindings/models/alert_rule_notification_webhook.py,sha256=Oi6c_34jdVqT_WU76wrs8kla3-kNdD7rVEZDouSHaAc,2669
|
45
46
|
scope_client/api_bindings/models/alert_rule_sort.py,sha256=ewtr9F3cttc4VpoCZcgOLd18zQUanhV18D0D0RLbmaQ,761
|
46
47
|
scope_client/api_bindings/models/alert_sort.py,sha256=4su0uTugb5QPxuLc25VTJDe9rrVK1S2glB_uki-pJYY,759
|
@@ -118,6 +119,7 @@ scope_client/api_bindings/models/infinite_pagination.py,sha256=v4US1ii-Jn-mN-t-S
|
|
118
119
|
scope_client/api_bindings/models/infinite_resource_list_alert.py,sha256=wX-_vpWkD2CnIl1qH-oQtYAW5dQ26brSuV_CksW4Yjg,3514
|
119
120
|
scope_client/api_bindings/models/infinite_resource_list_job.py,sha256=sBR_s6AS-NMbInnotz3bCszsmx_imNT8pnec9FR0oRw,3498
|
120
121
|
scope_client/api_bindings/models/internal_server_error.py,sha256=CSFjhuEhPdT25KHc9KEfcCYOLnGs2_sP0shqTl_dmm8,2613
|
122
|
+
scope_client/api_bindings/models/interval_unit.py,sha256=JLnP1dXdLyPlenmV8vAQWxCqFRjGzi3fGyrai7ZLFYY,796
|
121
123
|
scope_client/api_bindings/models/invite_new_user.py,sha256=hYoChkvCzFazxBbanMOfJYjQDp2a0dciixg-A70goPc,3574
|
122
124
|
scope_client/api_bindings/models/items.py,sha256=Pf6JlvMqLuWQDmYghT4tAkR8HgpLSop49V0V2zsDo_U,5845
|
123
125
|
scope_client/api_bindings/models/items1.py,sha256=86_zaxay9-HC3SYC30lJPLh0P7aJdVYq57ffsdwqu0Q,5534
|
@@ -168,7 +170,7 @@ scope_client/api_bindings/models/object_type.py,sha256=L58VjaX1mD5MRlxmABO6R4_rB
|
|
168
170
|
scope_client/api_bindings/models/object_value.py,sha256=4KpiwJjt00Xp10s38VHdld8HfTFpX5-1r00APnfkAuI,5887
|
169
171
|
scope_client/api_bindings/models/organization.py,sha256=BQJHXIGcrmcGQrxD4JhIEBlaaazysZ5nYdPZM9W1N_o,2991
|
170
172
|
scope_client/api_bindings/models/pagination.py,sha256=XWpYUWgFJIYmtJ3bMOqGlu6ganeK4wUxpZ8mCPC1d1Q,3118
|
171
|
-
scope_client/api_bindings/models/patch_alert_rule.py,sha256=
|
173
|
+
scope_client/api_bindings/models/patch_alert_rule.py,sha256=mZiSEWmwzJuZyK9_V8wxpK0Ar8xDK9aA40xcIztXdNY,5486
|
172
174
|
scope_client/api_bindings/models/patch_connector_spec.py,sha256=EzW-KkOwk0B0hnr5fzsfLcH6ZF5c2sFBoVA9er8o_yk,3754
|
173
175
|
scope_client/api_bindings/models/patch_data_plane.py,sha256=ZvRlyD4aZlNThEeaZ1MMNPpUXyw6ZypDTPP4Y6Bz2_Q,3772
|
174
176
|
scope_client/api_bindings/models/patch_data_plane_capabilities.py,sha256=MVLSPbKUO7kDAJpR6HIrso7rJYofeXjGMsq66OtU7Gk,2833
|
@@ -191,8 +193,8 @@ scope_client/api_bindings/models/permission_response_item.py,sha256=7D0mG1etQeYI
|
|
191
193
|
scope_client/api_bindings/models/permissions_request.py,sha256=dbh_2kJdTzuZzZ8UjQAdfxnDtOXwFeDIzvdflOaU_3A,3311
|
192
194
|
scope_client/api_bindings/models/permissions_response.py,sha256=NJxrhABuGXAJ03o-QQohf6xSH44QSDYDVZjbyFEWDvY,3082
|
193
195
|
scope_client/api_bindings/models/pii_config.py,sha256=vjsbgtwi__zmbfCc38FCj3aKbcIZJKJUMhiTJi6qgY4,3620
|
194
|
-
scope_client/api_bindings/models/post_alert.py,sha256=
|
195
|
-
scope_client/api_bindings/models/post_alert_rule.py,sha256
|
196
|
+
scope_client/api_bindings/models/post_alert.py,sha256=dEeRpRf122RTK3S7MOZUFYItG9f6SjsHZNng8O9WzpE,4729
|
197
|
+
scope_client/api_bindings/models/post_alert_rule.py,sha256=--3wo2OxqsstKQSje_8IaWobO6Htz7JFVUth2oTqcJk,4346
|
196
198
|
scope_client/api_bindings/models/post_alerts.py,sha256=6Jd3p9Pi04BK9tq8DR4o8TZ0e8I1hfRQUV7gJ5wANEE,3065
|
197
199
|
scope_client/api_bindings/models/post_connector_spec.py,sha256=tCtEBCLSXXLse7x-kD3OWrkCpD0_TuHx2LNDEc8VysU,3917
|
198
200
|
scope_client/api_bindings/models/post_data_plane.py,sha256=Y7fobPHVqYRuXM4f69jBKVYjGDG9O-UujG0UAVv4V0Y,3220
|
@@ -209,7 +211,7 @@ scope_client/api_bindings/models/post_job_batch.py,sha256=F-iF4EuSuFENVNnaT42A3V
|
|
209
211
|
scope_client/api_bindings/models/post_job_kind.py,sha256=lBG5zzx--Fiwg--cgt923O7r91lK_7dTkYnlOjqmXXY,1090
|
210
212
|
scope_client/api_bindings/models/post_job_spec.py,sha256=yEb1gZy8Y1UX7hY__DcsOTRSB2r7HJE1bdnIuIRC_gU,8627
|
211
213
|
scope_client/api_bindings/models/post_link_task_request.py,sha256=3YwcBRU45tOr6IoFpp9qYlFO3jFsNrOoq2poWDuX_9c,3248
|
212
|
-
scope_client/api_bindings/models/post_metrics_query.py,sha256=
|
214
|
+
scope_client/api_bindings/models/post_metrics_query.py,sha256=QVMtRisjc0N7pRF3cfFcOkTRzVADA4ix8zsFInCeqW8,4635
|
213
215
|
scope_client/api_bindings/models/post_metrics_query_result_filter.py,sha256=g1RxGTaBvqiFxRpADR-UZufw-KrZz-7al1PAyZMaJqg,3235
|
214
216
|
scope_client/api_bindings/models/post_metrics_query_result_filter_and_group.py,sha256=g4GDNqfjpNT6J-y9JiATrvfY2fc7G3WXr5A2x5tPm_g,3413
|
215
217
|
scope_client/api_bindings/models/post_metrics_query_result_filter_and_group_and_inner.py,sha256=oqncOTU3n3pg1CrbmrARODW173Aj3UqxtsAnDeVsG-Q,6878
|
@@ -311,7 +313,7 @@ scope_client/auth/device_authorizer.py,sha256=bJMIZRjkwQwoSWTLEp7OoXM2MytO3ADSD9
|
|
311
313
|
scope_client/auth/discovery.py,sha256=hR0MglzRWHdwyi72If5hTnjO50fDJhquP_DD7OzjIQQ,1188
|
312
314
|
scope_client/auth/oauth_api_config.py,sha256=wcEslusOFKr0oTzW0Ku2MhM1mvc-nm4BEJU8LHo1uXA,1347
|
313
315
|
scope_client/auth/session.py,sha256=wCriib5ajfm1e1WTL_QXVCJmEOrGwQg_0v91e5qrC6g,2649
|
314
|
-
scope_client-1.4.
|
315
|
-
scope_client-1.4.
|
316
|
-
scope_client-1.4.
|
317
|
-
scope_client-1.4.
|
316
|
+
scope_client-1.4.1071.dist-info/METADATA,sha256=PXXwl73TU43PwE1MiY5QUzW3c2cFPnPgIMT-bdjRiaY,1777
|
317
|
+
scope_client-1.4.1071.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
318
|
+
scope_client-1.4.1071.dist-info/top_level.txt,sha256=x6MngS09hi-TUDoUGb3SLzmnf8_cf8IVAVNPSqtTzAY,13
|
319
|
+
scope_client-1.4.1071.dist-info/RECORD,,
|
File without changes
|
File without changes
|