Skip to content

Commit 1ece5ae

Browse files
Add owner_group_ids to heartbeat create/update models
Adds the owner_group_ids field to NewHeartbeatDataAttributes and UpdateHeartbeatDataAttributes so team-scoped API keys can create and update team-owned heartbeats through the SDK. The public OpenAPI spec already exposes this field on the heartbeat create/update schemas; the generated models had not been regenerated to include it. Generated with [Linear](https://linear.app/rootly/issue/IR-5978/rootly-python-newupdate-heartbeat-schema-missing-owner-group-ids#agent-session-ecdd5403) Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
1 parent 4baa10f commit 1ece5ae

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

rootly_sdk/models/new_heartbeat_data_attributes.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class NewHeartbeatDataAttributes:
3232
description (None | str | Unset): The description of the heartbeat
3333
alert_description (None | str | Unset): Description of alerts triggered when heartbeat expires.
3434
alert_urgency_id (None | str | Unset): Urgency of alerts triggered when heartbeat expires.
35+
owner_group_ids (list[str] | Unset): List of team IDs that own this heartbeat
3536
enabled (bool | Unset): Whether to trigger alerts when heartbeat is expired.
3637
"""
3738

@@ -44,6 +45,7 @@ class NewHeartbeatDataAttributes:
4445
description: None | str | Unset = UNSET
4546
alert_description: None | str | Unset = UNSET
4647
alert_urgency_id: None | str | Unset = UNSET
48+
owner_group_ids: list[str] | Unset = UNSET
4749
enabled: bool | Unset = UNSET
4850

4951
def to_dict(self) -> dict[str, Any]:
@@ -77,6 +79,10 @@ def to_dict(self) -> dict[str, Any]:
7779
else:
7880
alert_urgency_id = self.alert_urgency_id
7981

82+
owner_group_ids: list[str] | Unset = UNSET
83+
if not isinstance(self.owner_group_ids, Unset):
84+
owner_group_ids = self.owner_group_ids
85+
8086
enabled = self.enabled
8187

8288
field_dict: dict[str, Any] = {}
@@ -97,6 +103,8 @@ def to_dict(self) -> dict[str, Any]:
97103
field_dict["alert_description"] = alert_description
98104
if alert_urgency_id is not UNSET:
99105
field_dict["alert_urgency_id"] = alert_urgency_id
106+
if owner_group_ids is not UNSET:
107+
field_dict["owner_group_ids"] = owner_group_ids
100108
if enabled is not UNSET:
101109
field_dict["enabled"] = enabled
102110

@@ -146,6 +154,8 @@ def _parse_alert_urgency_id(data: object) -> None | str | Unset:
146154

147155
alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET))
148156

157+
owner_group_ids = cast(list[str], d.pop("owner_group_ids", UNSET))
158+
149159
enabled = d.pop("enabled", UNSET)
150160

151161
new_heartbeat_data_attributes = cls(
@@ -158,6 +168,7 @@ def _parse_alert_urgency_id(data: object) -> None | str | Unset:
158168
description=description,
159169
alert_description=alert_description,
160170
alert_urgency_id=alert_urgency_id,
171+
owner_group_ids=owner_group_ids,
161172
enabled=enabled,
162173
)
163174

rootly_sdk/models/update_heartbeat_data_attributes.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class UpdateHeartbeatDataAttributes:
3232
notification_target_id (str | Unset):
3333
notification_target_type (UpdateHeartbeatDataAttributesNotificationTargetType | Unset): The type of the
3434
notification target. Please contact support if you encounter issues using `Functionality` as a target type.
35+
owner_group_ids (list[str] | Unset): List of team IDs that own this heartbeat
3536
enabled (bool | Unset): Whether to trigger alerts when heartbeat is expired.
3637
"""
3738

@@ -44,6 +45,7 @@ class UpdateHeartbeatDataAttributes:
4445
interval_unit: UpdateHeartbeatDataAttributesIntervalUnit | Unset = UNSET
4546
notification_target_id: str | Unset = UNSET
4647
notification_target_type: UpdateHeartbeatDataAttributesNotificationTargetType | Unset = UNSET
48+
owner_group_ids: list[str] | Unset = UNSET
4749
enabled: bool | Unset = UNSET
4850

4951
def to_dict(self) -> dict[str, Any]:
@@ -81,6 +83,10 @@ def to_dict(self) -> dict[str, Any]:
8183
if not isinstance(self.notification_target_type, Unset):
8284
notification_target_type = self.notification_target_type
8385

86+
owner_group_ids: list[str] | Unset = UNSET
87+
if not isinstance(self.owner_group_ids, Unset):
88+
owner_group_ids = self.owner_group_ids
89+
8490
enabled = self.enabled
8591

8692
field_dict: dict[str, Any] = {}
@@ -104,6 +110,8 @@ def to_dict(self) -> dict[str, Any]:
104110
field_dict["notification_target_id"] = notification_target_id
105111
if notification_target_type is not UNSET:
106112
field_dict["notification_target_type"] = notification_target_type
113+
if owner_group_ids is not UNSET:
114+
field_dict["owner_group_ids"] = owner_group_ids
107115
if enabled is not UNSET:
108116
field_dict["enabled"] = enabled
109117

@@ -163,6 +171,8 @@ def _parse_alert_urgency_id(data: object) -> None | str | Unset:
163171
_notification_target_type
164172
)
165173

174+
owner_group_ids = cast(list[str], d.pop("owner_group_ids", UNSET))
175+
166176
enabled = d.pop("enabled", UNSET)
167177

168178
update_heartbeat_data_attributes = cls(
@@ -175,6 +185,7 @@ def _parse_alert_urgency_id(data: object) -> None | str | Unset:
175185
interval_unit=interval_unit,
176186
notification_target_id=notification_target_id,
177187
notification_target_type=notification_target_type,
188+
owner_group_ids=owner_group_ids,
178189
enabled=enabled,
179190
)
180191

0 commit comments

Comments
 (0)