From 1acd6c7b66bf3a9c06d86f96f0e0a2e2d9b75f11 Mon Sep 17 00:00:00 2001 From: activitysmith-bot Date: Wed, 3 Jun 2026 06:52:37 +0000 Subject: [PATCH] chore: regenerate SDK --- .../docs/LiveActivityAction.md | 2 +- .../docs/PushNotificationAction.md | 2 +- .../docs/PushNotificationRequest.md | 2 +- .../models/live_activity_action.py | 13 +++---------- .../models/push_notification_action.py | 13 +++---------- .../models/push_notification_request.py | 2 +- .../test/test_live_activity_action.py | 18 ------------------ .../test/test_push_notification_action.py | 18 ------------------ 8 files changed, 10 insertions(+), 60 deletions(-) diff --git a/activitysmith_openapi/docs/LiveActivityAction.md b/activitysmith_openapi/docs/LiveActivityAction.md index 324c623..70600a0 100644 --- a/activitysmith_openapi/docs/LiveActivityAction.md +++ b/activitysmith_openapi/docs/LiveActivityAction.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **title** | **str** | Button title displayed in the Live Activity UI. | **type** | [**LiveActivityActionType**](LiveActivityActionType.md) | | -**url** | **str** | Action URL. For open_url, use an HTTPS or shortcuts:// URL. For webhook, use an HTTPS URL called by the ActivitySmith backend. | +**url** | **str** | Action URL. For open_url, use an HTTPS URL or a shortcuts:// URL that runs an Apple Shortcut. For webhook, use an HTTPS URL called by the ActivitySmith backend. | **method** | [**LiveActivityWebhookMethod**](LiveActivityWebhookMethod.md) | Webhook HTTP method. Used only when type=webhook. | [optional] [default to LiveActivityWebhookMethod.POST] **body** | **Dict[str, object]** | Optional webhook payload body. Used only when type=webhook. | [optional] diff --git a/activitysmith_openapi/docs/PushNotificationAction.md b/activitysmith_openapi/docs/PushNotificationAction.md index 1bebd5c..2596d0f 100644 --- a/activitysmith_openapi/docs/PushNotificationAction.md +++ b/activitysmith_openapi/docs/PushNotificationAction.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **title** | **str** | Button title displayed in iOS expanded notification UI. | **type** | [**PushNotificationActionType**](PushNotificationActionType.md) | | -**url** | **str** | Action URL. For open_url, use an HTTPS or shortcuts:// URL. For webhook, use an HTTPS URL called by the ActivitySmith backend. | +**url** | **str** | Action URL. For open_url, use an HTTPS URL or a shortcuts:// URL that runs an Apple Shortcut. For webhook, use an HTTPS URL called by the ActivitySmith backend. | **method** | [**PushNotificationWebhookMethod**](PushNotificationWebhookMethod.md) | Webhook HTTP method. Used only when type=webhook. | [optional] [default to PushNotificationWebhookMethod.POST] **body** | **Dict[str, object]** | Optional webhook payload body. Used only when type=webhook. | [optional] diff --git a/activitysmith_openapi/docs/PushNotificationRequest.md b/activitysmith_openapi/docs/PushNotificationRequest.md index 5cde2eb..f76231f 100644 --- a/activitysmith_openapi/docs/PushNotificationRequest.md +++ b/activitysmith_openapi/docs/PushNotificationRequest.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **message** | **str** | | [optional] **subtitle** | **str** | | [optional] **media** | **str** | Optional HTTPS URL for an image, audio file, or video that users can preview or play when they expand the notification. If `redirection` is omitted, tapping the notification opens this URL. Cannot be combined with `actions`. | [optional] -**redirection** | **str** | Optional HTTPS or shortcuts:// URL opened when user taps the notification body. Overrides the default tap target from `media` when both are provided. | [optional] +**redirection** | **str** | Optional HTTPS URL or shortcuts:// URL opened when the user taps the notification body. Use shortcuts:// to run an Apple Shortcut. Overrides the default tap target from `media` when both are provided. | [optional] **actions** | [**List[PushNotificationAction]**](PushNotificationAction.md) | Optional interactive actions shown when users expand the notification. Cannot be combined with `media`. | [optional] **payload** | **Dict[str, object]** | | [optional] **badge** | **int** | | [optional] diff --git a/activitysmith_openapi/models/live_activity_action.py b/activitysmith_openapi/models/live_activity_action.py index 544bf0a..c620edd 100644 --- a/activitysmith_openapi/models/live_activity_action.py +++ b/activitysmith_openapi/models/live_activity_action.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, model_validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from activitysmith_openapi.models.live_activity_action_type import LiveActivityActionType from activitysmith_openapi.models.live_activity_webhook_method import LiveActivityWebhookMethod @@ -30,7 +30,7 @@ class LiveActivityAction(BaseModel): """ # noqa: E501 title: StrictStr = Field(description="Button title displayed in the Live Activity UI.") type: LiveActivityActionType - url: StrictStr = Field(description="Action URL. For open_url, use an HTTPS or shortcuts:// URL. For webhook, use an HTTPS URL called by the ActivitySmith backend.") + url: StrictStr = Field(description="Action URL. For open_url, use an HTTPS URL or a shortcuts:// URL that runs an Apple Shortcut. For webhook, use an HTTPS URL called by the ActivitySmith backend.") method: Optional[LiveActivityWebhookMethod] = Field(default=LiveActivityWebhookMethod.POST, description="Webhook HTTP method. Used only when type=webhook.") body: Optional[Dict[str, Any]] = Field(default=None, description="Optional webhook payload body. Used only when type=webhook.") additional_properties: Dict[str, Any] = {} @@ -42,14 +42,6 @@ class LiveActivityAction(BaseModel): protected_namespaces=(), ) - @model_validator(mode="after") - def validate_url_for_type(self) -> Self: - if self.type == LiveActivityActionType.OPEN_URL and not (self.url.startswith("https://") or self.url.startswith("shortcuts://")): - raise ValueError("open_url action url must use https or shortcuts") - if self.type == LiveActivityActionType.WEBHOOK and not self.url.startswith("https://"): - raise ValueError("webhook action url must use https") - return self - def to_str(self) -> str: """Returns the string representation of the model using alias""" @@ -110,3 +102,4 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return _obj + diff --git a/activitysmith_openapi/models/push_notification_action.py b/activitysmith_openapi/models/push_notification_action.py index 8822862..8631568 100644 --- a/activitysmith_openapi/models/push_notification_action.py +++ b/activitysmith_openapi/models/push_notification_action.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, model_validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from activitysmith_openapi.models.push_notification_action_type import PushNotificationActionType from activitysmith_openapi.models.push_notification_webhook_method import PushNotificationWebhookMethod @@ -30,7 +30,7 @@ class PushNotificationAction(BaseModel): """ # noqa: E501 title: StrictStr = Field(description="Button title displayed in iOS expanded notification UI.") type: PushNotificationActionType - url: StrictStr = Field(description="Action URL. For open_url, use an HTTPS or shortcuts:// URL. For webhook, use an HTTPS URL called by the ActivitySmith backend.") + url: StrictStr = Field(description="Action URL. For open_url, use an HTTPS URL or a shortcuts:// URL that runs an Apple Shortcut. For webhook, use an HTTPS URL called by the ActivitySmith backend.") method: Optional[PushNotificationWebhookMethod] = Field(default=PushNotificationWebhookMethod.POST, description="Webhook HTTP method. Used only when type=webhook.") body: Optional[Dict[str, Any]] = Field(default=None, description="Optional webhook payload body. Used only when type=webhook.") additional_properties: Dict[str, Any] = {} @@ -42,14 +42,6 @@ class PushNotificationAction(BaseModel): protected_namespaces=(), ) - @model_validator(mode="after") - def validate_url_for_type(self) -> Self: - if self.type == PushNotificationActionType.OPEN_URL and not (self.url.startswith("https://") or self.url.startswith("shortcuts://")): - raise ValueError("open_url action url must use https or shortcuts") - if self.type == PushNotificationActionType.WEBHOOK and not self.url.startswith("https://"): - raise ValueError("webhook action url must use https") - return self - def to_str(self) -> str: """Returns the string representation of the model using alias""" @@ -110,3 +102,4 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return _obj + diff --git a/activitysmith_openapi/models/push_notification_request.py b/activitysmith_openapi/models/push_notification_request.py index a056f4d..f5d7235 100644 --- a/activitysmith_openapi/models/push_notification_request.py +++ b/activitysmith_openapi/models/push_notification_request.py @@ -33,7 +33,7 @@ class PushNotificationRequest(BaseModel): message: Optional[StrictStr] = None subtitle: Optional[StrictStr] = None media: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Optional HTTPS URL for an image, audio file, or video that users can preview or play when they expand the notification. If `redirection` is omitted, tapping the notification opens this URL. Cannot be combined with `actions`.") - redirection: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Optional HTTPS or shortcuts:// URL opened when user taps the notification body. Overrides the default tap target from `media` when both are provided.") + redirection: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Optional HTTPS URL or shortcuts:// URL opened when the user taps the notification body. Use shortcuts:// to run an Apple Shortcut. Overrides the default tap target from `media` when both are provided.") actions: Optional[Annotated[List[PushNotificationAction], Field(max_length=4)]] = Field(default=None, description="Optional interactive actions shown when users expand the notification. Cannot be combined with `media`.") payload: Optional[Dict[str, Any]] = None badge: Optional[StrictInt] = None diff --git a/activitysmith_openapi/test/test_live_activity_action.py b/activitysmith_openapi/test/test_live_activity_action.py index e88a849..ec696ec 100644 --- a/activitysmith_openapi/test/test_live_activity_action.py +++ b/activitysmith_openapi/test/test_live_activity_action.py @@ -15,7 +15,6 @@ import unittest from activitysmith_openapi.models.live_activity_action import LiveActivityAction -from activitysmith_openapi.models.live_activity_action_type import LiveActivityActionType class TestLiveActivityAction(unittest.TestCase): """LiveActivityAction unit test stubs""" @@ -55,22 +54,5 @@ def testLiveActivityAction(self): # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) - def test_open_url_allows_shortcuts_url(self): - action = LiveActivityAction( - title="Chat", - type=LiveActivityActionType.OPEN_URL, - url="shortcuts://run-shortcut?name=JARVIS", - ) - - self.assertEqual("shortcuts://run-shortcut?name=JARVIS", action.url) - - def test_webhook_rejects_shortcuts_url(self): - with self.assertRaises(ValueError): - LiveActivityAction( - title="Chat", - type=LiveActivityActionType.WEBHOOK, - url="shortcuts://run-shortcut?name=JARVIS", - ) - if __name__ == '__main__': unittest.main() diff --git a/activitysmith_openapi/test/test_push_notification_action.py b/activitysmith_openapi/test/test_push_notification_action.py index e670103..88bdba2 100644 --- a/activitysmith_openapi/test/test_push_notification_action.py +++ b/activitysmith_openapi/test/test_push_notification_action.py @@ -15,7 +15,6 @@ import unittest from activitysmith_openapi.models.push_notification_action import PushNotificationAction -from activitysmith_openapi.models.push_notification_action_type import PushNotificationActionType class TestPushNotificationAction(unittest.TestCase): """PushNotificationAction unit test stubs""" @@ -55,22 +54,5 @@ def testPushNotificationAction(self): # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) - def test_open_url_allows_shortcuts_url(self): - action = PushNotificationAction( - title="Chat", - type=PushNotificationActionType.OPEN_URL, - url="shortcuts://run-shortcut?name=JARVIS", - ) - - self.assertEqual("shortcuts://run-shortcut?name=JARVIS", action.url) - - def test_webhook_rejects_shortcuts_url(self): - with self.assertRaises(ValueError): - PushNotificationAction( - title="Chat", - type=PushNotificationActionType.WEBHOOK, - url="shortcuts://run-shortcut?name=JARVIS", - ) - if __name__ == '__main__': unittest.main()