Skip to content

Generator: Update SDK /services/observability #1225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import pprint
from typing import Any, ClassVar, Dict, List, Optional, Set

from pydantic import BaseModel, ConfigDict, Field
from pydantic import BaseModel, ConfigDict, Field, StrictBool
from typing_extensions import Annotated, Self


Expand All @@ -43,6 +43,9 @@ class CreateAlertConfigReceiverPayloadEmailConfigsInner(BaseModel):
description="The sender address. `Additional Validators:` * must be a syntactically valid email address",
alias="from",
)
send_resolved: Optional[StrictBool] = Field(
default=False, description="Whether to notify about resolved alerts.", alias="sendResolved"
)
smarthost: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field(
default=None,
description="The SMTP host through which emails are sent. `Additional Validators:` * should only include the characters: a-zA-Z0-9_./@&?:-",
Expand All @@ -51,7 +54,15 @@ class CreateAlertConfigReceiverPayloadEmailConfigsInner(BaseModel):
default=None,
description="The email address to send notifications to. `Additional Validators:` * must be a syntactically valid email address",
)
__properties: ClassVar[List[str]] = ["authIdentity", "authPassword", "authUsername", "from", "smarthost", "to"]
__properties: ClassVar[List[str]] = [
"authIdentity",
"authPassword",
"authUsername",
"from",
"sendResolved",
"smarthost",
"to",
]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -107,6 +118,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"authPassword": obj.get("authPassword"),
"authUsername": obj.get("authUsername"),
"from": obj.get("from"),
"sendResolved": obj.get("sendResolved") if obj.get("sendResolved") is not None else False,
"smarthost": obj.get("smarthost"),
"to": obj.get("to"),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import pprint
from typing import Any, ClassVar, Dict, List, Optional, Set

from pydantic import BaseModel, ConfigDict, Field
from pydantic import BaseModel, ConfigDict, Field, StrictBool
from typing_extensions import Annotated, Self


Expand All @@ -37,10 +37,16 @@ class CreateAlertConfigReceiverPayloadOpsgenieConfigsInner(BaseModel):
description="The host to send OpsGenie API requests to. `Additional Validators:` * must be a syntactically valid url address",
alias="apiUrl",
)
priority: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=2)]] = Field(
default=None, description="Priority level of alert. Possible values are P1, P2, P3, P4, and P5."
)
send_resolved: Optional[StrictBool] = Field(
default=True, description="Whether to notify about resolved alerts.", alias="sendResolved"
)
tags: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=400)]] = Field(
default=None, description="Comma separated list of tags attached to the notifications."
)
__properties: ClassVar[List[str]] = ["apiKey", "apiUrl", "tags"]
__properties: ClassVar[List[str]] = ["apiKey", "apiUrl", "priority", "sendResolved", "tags"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -90,5 +96,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)

_obj = cls.model_validate({"apiKey": obj.get("apiKey"), "apiUrl": obj.get("apiUrl"), "tags": obj.get("tags")})
_obj = cls.model_validate(
{
"apiKey": obj.get("apiKey"),
"apiUrl": obj.get("apiUrl"),
"priority": obj.get("priority"),
"sendResolved": obj.get("sendResolved") if obj.get("sendResolved") is not None else True,
"tags": obj.get("tags"),
}
)
return _obj
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@ class CreateAlertConfigReceiverPayloadWebHookConfigsInner(BaseModel):
description="Microsoft Teams webhooks require special handling. If you set this property to true, it is treated as such",
alias="msTeams",
)
send_resolved: Optional[StrictBool] = Field(
default=True, description="Whether to notify about resolved alerts.", alias="sendResolved"
)
url: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=500)]] = Field(
default=None,
description="The endpoint to send HTTP POST requests to. `Additional Validators:` * must be a syntactically valid url address",
)
__properties: ClassVar[List[str]] = ["msTeams", "url"]
__properties: ClassVar[List[str]] = ["msTeams", "sendResolved", "url"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -87,6 +90,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
return cls.model_validate(obj)

_obj = cls.model_validate(
{"msTeams": obj.get("msTeams") if obj.get("msTeams") is not None else False, "url": obj.get("url")}
{
"msTeams": obj.get("msTeams") if obj.get("msTeams") is not None else False,
"sendResolved": obj.get("sendResolved") if obj.get("sendResolved") is not None else True,
"url": obj.get("url"),
}
)
return _obj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import pprint
from typing import Any, ClassVar, Dict, List, Optional, Set

from pydantic import BaseModel, ConfigDict, Field
from pydantic import BaseModel, ConfigDict, Field, StrictBool
from typing_extensions import Annotated, Self

from stackit.observability.models.create_alert_config_route_payload_routes_inner import (
Expand All @@ -31,6 +31,11 @@ class CreateAlertConfigRoutePayload(BaseModel):
The root node of the routing tree.
"""

var_continue: Optional[StrictBool] = Field(
default=False,
description="Whether an alert should continue matching subsequent sibling nodes.",
alias="continue",
)
group_by: Optional[List[Annotated[str, Field(min_length=1, strict=True, max_length=200)]]] = Field(
default=None,
description="The labels by which incoming alerts are grouped together. For example, multiple alerts coming in for cluster=A and alertname=LatencyHigh would be batched into a single group. To aggregate by all possible labels use the special value '...' as the sole label name, for example: group_by: ['...']. This effectively disables aggregation entirely, passing through all alerts as-is. This is unlikely to be what you want, unless you have a very low alert volume or your upstream notification system performs its own grouping.",
Expand Down Expand Up @@ -71,6 +76,7 @@ class CreateAlertConfigRoutePayload(BaseModel):
default=None, description="Zero or more child routes."
)
__properties: ClassVar[List[str]] = [
"continue",
"groupBy",
"groupInterval",
"groupWait",
Expand Down Expand Up @@ -139,6 +145,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:

_obj = cls.model_validate(
{
"continue": obj.get("continue") if obj.get("continue") is not None else False,
"groupBy": obj.get("groupBy"),
"groupInterval": obj.get("groupInterval") if obj.get("groupInterval") is not None else "5m",
"groupWait": obj.get("groupWait") if obj.get("groupWait") is not None else "30s",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import pprint
from typing import Any, ClassVar, Dict, List, Optional, Set

from pydantic import BaseModel, ConfigDict, Field
from pydantic import BaseModel, ConfigDict, Field, StrictBool
from typing_extensions import Annotated, Self


Expand All @@ -27,6 +27,7 @@ class CreateAlertConfigRoutePayloadRoutesInner(BaseModel):
As in one level above
"""

var_continue: Optional[StrictBool] = Field(default=False, description="As in one level above", alias="continue")
group_by: Optional[List[Annotated[str, Field(min_length=1, strict=True, max_length=200)]]] = Field(
default=None, alias="groupBy"
)
Expand All @@ -38,6 +39,9 @@ class CreateAlertConfigRoutePayloadRoutesInner(BaseModel):
)
match: Optional[Dict[str, Any]] = Field(default=None, description="As in one level above")
match_re: Optional[Dict[str, Any]] = Field(default=None, description="As in one level above", alias="matchRe")
matchers: Optional[List[Annotated[str, Field(min_length=1, strict=True, max_length=200)]]] = Field(
default=None, description="As in one level above"
)
receiver: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=100)]] = Field(
default=None, description="As in one level above"
)
Expand All @@ -46,11 +50,13 @@ class CreateAlertConfigRoutePayloadRoutesInner(BaseModel):
)
routes: Optional[List[Dict[str, Any]]] = Field(default=None, description="Another child routes")
__properties: ClassVar[List[str]] = [
"continue",
"groupBy",
"groupInterval",
"groupWait",
"match",
"matchRe",
"matchers",
"receiver",
"repeatInterval",
"routes",
Expand Down Expand Up @@ -106,11 +112,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:

_obj = cls.model_validate(
{
"continue": obj.get("continue") if obj.get("continue") is not None else False,
"groupBy": obj.get("groupBy"),
"groupInterval": obj.get("groupInterval"),
"groupWait": obj.get("groupWait"),
"match": obj.get("match"),
"matchRe": obj.get("matchRe"),
"matchers": obj.get("matchers"),
"receiver": obj.get("receiver"),
"repeatInterval": obj.get("repeatInterval"),
"routes": obj.get("routes"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ class Route(BaseModel):
match_re: Optional[Dict[str, Annotated[str, Field(min_length=1, strict=True, max_length=200)]]] = Field(
default=None, alias="matchRe"
)
matchers: Optional[
Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=200)]], Field(max_length=5)]
] = None
receiver: Annotated[str, Field(min_length=1, strict=True, max_length=200)]
repeat_interval: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=8)]] = Field(
default="4h", alias="repeatInterval"
Expand All @@ -55,6 +58,7 @@ class Route(BaseModel):
"groupWait",
"match",
"matchRe",
"matchers",
"receiver",
"repeatInterval",
"routes",
Expand Down Expand Up @@ -123,6 +127,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"groupWait": obj.get("groupWait") if obj.get("groupWait") is not None else "30s",
"match": obj.get("match"),
"matchRe": obj.get("matchRe"),
"matchers": obj.get("matchers"),
"receiver": obj.get("receiver"),
"repeatInterval": obj.get("repeatInterval") if obj.get("repeatInterval") is not None else "4h",
"routes": (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import pprint
from typing import Any, ClassVar, Dict, List, Optional, Set

from pydantic import BaseModel, ConfigDict, Field
from pydantic import BaseModel, ConfigDict, Field, StrictBool
from typing_extensions import Annotated, Self

from stackit.observability.models.create_alert_config_route_payload_routes_inner import (
Expand All @@ -31,6 +31,11 @@ class UpdateAlertConfigRoutePayload(BaseModel):
The root node of the routing tree.
"""

var_continue: Optional[StrictBool] = Field(
default=False,
description="Whether an alert should continue matching subsequent sibling nodes.",
alias="continue",
)
group_by: Optional[List[Annotated[str, Field(min_length=1, strict=True, max_length=200)]]] = Field(
default=None,
description="The labels by which incoming alerts are grouped together. For example, multiple alerts coming in for cluster=A and alertname=LatencyHigh would be batched into a single group. To aggregate by all possible labels use the special value '...' as the sole label name, for example: group_by: ['...']. This effectively disables aggregation entirely, passing through all alerts as-is. This is unlikely to be what you want, unless you have a very low alert volume or your upstream notification system performs its own grouping.",
Expand Down Expand Up @@ -71,6 +76,7 @@ class UpdateAlertConfigRoutePayload(BaseModel):
default=None, description="Zero or more child routes."
)
__properties: ClassVar[List[str]] = [
"continue",
"groupBy",
"groupInterval",
"groupWait",
Expand Down Expand Up @@ -139,6 +145,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:

_obj = cls.model_validate(
{
"continue": obj.get("continue") if obj.get("continue") is not None else False,
"groupBy": obj.get("groupBy"),
"groupInterval": obj.get("groupInterval") if obj.get("groupInterval") is not None else "5m",
"groupWait": obj.get("groupWait") if obj.get("groupWait") is not None else "30s",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import pprint
from typing import Any, ClassVar, Dict, List, Optional, Set

from pydantic import BaseModel, ConfigDict, Field
from pydantic import BaseModel, ConfigDict, Field, StrictBool
from typing_extensions import Annotated, Self

from stackit.observability.models.create_alert_config_route_payload_routes_inner import (
Expand All @@ -31,6 +31,11 @@ class UpdateAlertConfigsPayloadRoute(BaseModel):
The root node of the routing tree.
"""

var_continue: Optional[StrictBool] = Field(
default=False,
description="Whether an alert should continue matching subsequent sibling nodes.",
alias="continue",
)
group_by: Optional[List[Annotated[str, Field(min_length=1, strict=True, max_length=200)]]] = Field(
default=None,
description="The labels by which incoming alerts are grouped together. For example, multiple alerts coming in for cluster=A and alertname=LatencyHigh would be batched into a single group. To aggregate by all possible labels use the special value '...' as the sole label name, for example: group_by: ['...']. This effectively disables aggregation entirely, passing through all alerts as-is. This is unlikely to be what you want, unless you have a very low alert volume or your upstream notification system performs its own grouping.",
Expand Down Expand Up @@ -71,6 +76,7 @@ class UpdateAlertConfigsPayloadRoute(BaseModel):
default=None, description="Zero or more child routes."
)
__properties: ClassVar[List[str]] = [
"continue",
"groupBy",
"groupInterval",
"groupWait",
Expand Down Expand Up @@ -139,6 +145,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:

_obj = cls.model_validate(
{
"continue": obj.get("continue") if obj.get("continue") is not None else False,
"groupBy": obj.get("groupBy"),
"groupInterval": obj.get("groupInterval") if obj.get("groupInterval") is not None else "5m",
"groupWait": obj.get("groupWait") if obj.get("groupWait") is not None else "30s",
Expand Down
Loading