Skip to content
Merged
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
2 changes: 2 additions & 0 deletions src/devhelm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
NotificationPolicyDto,
PublishIncidentStatus,
ReorderComponentsRequest,
ReorderPageLayoutRequest,
ResolveIncidentRequest,
ResourceGroupDto,
ResourceGroupHealthStatus,
Expand Down Expand Up @@ -204,6 +205,7 @@
"AddCustomDomainRequest",
"AdminAddSubscriberRequest",
"ReorderComponentsRequest",
"ReorderPageLayoutRequest",
"CreateMonitorRequest",
"UpdateMonitorRequest",
"CreateManualIncidentRequest",
Expand Down
6 changes: 1 addition & 5 deletions src/devhelm/resources/incidents.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
IncidentDto,
ResolveIncidentRequest,
)
from devhelm._http import api_delete, api_get, api_post, path_param
from devhelm._http import api_get, api_post, path_param
from devhelm._pagination import Page, fetch_all_pages, fetch_page
from devhelm._validation import RequestBody, parse_single, validate_request

Expand Down Expand Up @@ -57,7 +57,3 @@ def resolve(
api_post(self._client, f"/api/v1/incidents/{path_param(id)}/resolve", body),
f"POST /api/v1/incidents/{id}/resolve",
)

def delete(self, id: int | str) -> None:
"""Delete an incident."""
api_delete(self._client, f"/api/v1/incidents/{path_param(id)}")
14 changes: 14 additions & 0 deletions src/devhelm/resources/status_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
CreateStatusPageIncidentUpdateRequest,
CreateStatusPageRequest,
ReorderComponentsRequest,
ReorderPageLayoutRequest,
StatusPageComponentDto,
StatusPageComponentGroupDto,
StatusPageCustomDomainDto,
Expand Down Expand Up @@ -392,3 +393,16 @@ def update(
def delete(self, id: int | str) -> None:
"""Delete a status page."""
api_delete(self._client, _page_path(id))

def reorder_layout(
self, id: int | str, body: RequestBody[ReorderPageLayoutRequest]
) -> None:
"""Batch-reorder the page layout: top-level sections (groups +
ungrouped components) and, optionally, within-group component ordering.

Returns 204 No Content on success.
"""
body = validate_request(
ReorderPageLayoutRequest, body, "statusPages.reorderLayout"
)
api_put(self._client, f"{_page_path(id)}/layout/reorder", body)
2 changes: 2 additions & 0 deletions src/devhelm/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
PublishStatusPageIncidentRequest,
RecordType,
ReorderComponentsRequest,
ReorderPageLayoutRequest,
ResolutionReason,
ResolveIncidentRequest,
ResourceGroupDto,
Expand Down Expand Up @@ -250,6 +251,7 @@
"NotificationPolicyDto",
"PublishStatusPageIncidentRequest",
"ReorderComponentsRequest",
"ReorderPageLayoutRequest",
"ResolveIncidentRequest",
"ResourceGroupDto",
"ResourceGroupMemberDto",
Expand Down
9 changes: 6 additions & 3 deletions tests/run_sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
Devhelm,
DevhelmError,
ReorderComponentsRequest,
ReorderPageLayoutRequest,
ResolveIncidentRequest,
UpdateAlertChannelRequest,
UpdateEnvironmentRequest,
Expand Down Expand Up @@ -137,9 +138,6 @@ def run(client: Devhelm, resource: str, action: str, rest: list[str]) -> Any: #
else None
)
return client.incidents.resolve(rest[0], body)
if op == "incidents.delete":
client.incidents.delete(rest[0])
return None

# -- Alert Channels --
if op == "alert-channels.list":
Expand Down Expand Up @@ -311,6 +309,11 @@ def run(client: Devhelm, resource: str, action: str, rest: list[str]) -> Any: #
if op == "status-pages.delete":
client.status_pages.delete(rest[0])
return None
if op == "status-pages.reorder-layout":
client.status_pages.reorder_layout(
rest[0], _parse(ReorderPageLayoutRequest, rest[1])
)
return None

# -- Status Page Components --
if op == "status-pages.components.list":
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading