From 5a7ac3cbc13fcd61820c0540fef117de9c4eb694 Mon Sep 17 00:00:00 2001 From: activitysmith-bot Date: Sun, 20 Sep 2026 05:20:25 +0000 Subject: [PATCH 1/2] chore: regenerate SDK --- activitysmith_openapi/__init__.py | 1 + .../api/app_icon_badges_api.py | 6 +- .../api/live_activities_api.py | 30 ++-- activitysmith_openapi/api/metrics_api.py | 6 +- .../docs/AppIconBadgesApi.md | 12 +- activitysmith_openapi/docs/ContentStateEnd.md | 10 +- .../docs/ContentStateStart.md | 10 +- .../docs/ContentStateUpdate.md | 10 +- .../docs/LiveActivitiesApi.md | 50 +++--- .../docs/LiveActivityAction.md | 2 +- .../docs/LiveActivityEndRequest.md | 2 +- .../docs/LiveActivityStartRequest.md | 2 +- .../docs/LiveActivityStreamDeleteRequest.md | 2 +- .../docs/LiveActivityStreamRequest.md | 2 +- .../docs/LiveActivityUpdateRequest.md | 2 +- .../docs/LiveActivityValue.md | 29 ++++ activitysmith_openapi/docs/MetricsApi.md | 10 +- .../docs/PushNotificationsApi.md | 10 +- activitysmith_openapi/docs/RateLimitError.md | 1 + .../docs/SendPushNotification429Response.md | 1 + .../docs/StreamContentState.md | 10 +- activitysmith_openapi/models/__init__.py | 1 + .../models/content_state_end.py | 20 ++- .../models/content_state_start.py | 20 ++- .../models/content_state_update.py | 20 ++- .../models/live_activity_action.py | 9 +- .../models/live_activity_end_request.py | 2 +- .../models/live_activity_start_request.py | 2 +- .../live_activity_stream_delete_request.py | 2 +- .../models/live_activity_stream_request.py | 2 +- .../models/live_activity_update_request.py | 2 +- .../models/live_activity_value.py | 143 ++++++++++++++++++ .../models/push_notification_action.py | 7 +- .../models/rate_limit_error.py | 18 ++- .../models/stream_content_state.py | 20 ++- activitysmith_openapi/openapi-source.json | 4 +- .../test/test_content_state_end.py | 2 +- .../test/test_content_state_start.py | 2 +- .../test/test_content_state_update.py | 2 +- .../test/test_live_activity_end_request.py | 4 +- .../test/test_live_activity_start_request.py | 4 +- ...est_live_activity_stream_delete_request.py | 2 +- .../test/test_live_activity_stream_request.py | 4 +- .../test/test_live_activity_update_request.py | 4 +- .../test/test_live_activity_value.py | 50 ++++++ .../test/test_rate_limit_error.py | 1 + ...test_send_push_notification429_response.py | 1 + .../test/test_stream_content_state.py | 2 +- 48 files changed, 412 insertions(+), 146 deletions(-) create mode 100644 activitysmith_openapi/docs/LiveActivityValue.md create mode 100644 activitysmith_openapi/models/live_activity_value.py create mode 100644 activitysmith_openapi/test/test_live_activity_value.py diff --git a/activitysmith_openapi/__init__.py b/activitysmith_openapi/__init__.py index f564b29..b094dd5 100644 --- a/activitysmith_openapi/__init__.py +++ b/activitysmith_openapi/__init__.py @@ -62,6 +62,7 @@ from activitysmith_openapi.models.live_activity_stream_request import LiveActivityStreamRequest from activitysmith_openapi.models.live_activity_update_request import LiveActivityUpdateRequest from activitysmith_openapi.models.live_activity_update_response import LiveActivityUpdateResponse +from activitysmith_openapi.models.live_activity_value import LiveActivityValue from activitysmith_openapi.models.live_activity_webhook_method import LiveActivityWebhookMethod from activitysmith_openapi.models.metadata_value import MetadataValue from activitysmith_openapi.models.metric_error import MetricError diff --git a/activitysmith_openapi/api/app_icon_badges_api.py b/activitysmith_openapi/api/app_icon_badges_api.py index e832526..812dc28 100644 --- a/activitysmith_openapi/api/app_icon_badges_api.py +++ b/activitysmith_openapi/api/app_icon_badges_api.py @@ -95,8 +95,8 @@ def update_app_icon_badge_count( '400': "BadRequestError", '403': "ForbiddenError", '422': "UpdateAppIconBadgeCount422Response", - '502': "AppIconBadgeCountUpdateError", '429': "RateLimitError", + '502': "AppIconBadgeCountUpdateError", } response_data = self.api_client.call_api( *_param, @@ -167,8 +167,8 @@ def update_app_icon_badge_count_with_http_info( '400': "BadRequestError", '403': "ForbiddenError", '422': "UpdateAppIconBadgeCount422Response", - '502': "AppIconBadgeCountUpdateError", '429': "RateLimitError", + '502': "AppIconBadgeCountUpdateError", } response_data = self.api_client.call_api( *_param, @@ -239,8 +239,8 @@ def update_app_icon_badge_count_without_preload_content( '400': "BadRequestError", '403': "ForbiddenError", '422': "UpdateAppIconBadgeCount422Response", - '502': "AppIconBadgeCountUpdateError", '429': "RateLimitError", + '502': "AppIconBadgeCountUpdateError", } response_data = self.api_client.call_api( *_param, diff --git a/activitysmith_openapi/api/live_activities_api.py b/activitysmith_openapi/api/live_activities_api.py index d891d6e..05991eb 100644 --- a/activitysmith_openapi/api/live_activities_api.py +++ b/activitysmith_openapi/api/live_activities_api.py @@ -67,7 +67,7 @@ def end_live_activity( ) -> LiveActivityEndResponse: """End a Live Activity (legacy manual lifecycle) - Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. + Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, timer, and value activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. :param live_activity_end_request: (required) :type live_activity_end_request: LiveActivityEndRequest @@ -136,7 +136,7 @@ def end_live_activity_with_http_info( ) -> ApiResponse[LiveActivityEndResponse]: """End a Live Activity (legacy manual lifecycle) - Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. + Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, timer, and value activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. :param live_activity_end_request: (required) :type live_activity_end_request: LiveActivityEndRequest @@ -205,7 +205,7 @@ def end_live_activity_without_preload_content( ) -> RESTResponseType: """End a Live Activity (legacy manual lifecycle) - Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. + Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, timer, and value activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. :param live_activity_end_request: (required) :type live_activity_end_request: LiveActivityEndRequest @@ -346,7 +346,7 @@ def end_live_activity_stream( ) -> LiveActivityStreamDeleteResponse: """End a stream - Use this endpoint when the process you are tracking is finished and you no longer want the Live Activity on your devices. ActivitySmith ends the current Live Activity for this stream and dismisses it from devices. If you need direct lifecycle control, use /live-activity/start, /live-activity/update, and /live-activity/end instead. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. + Use this endpoint when the process you are tracking is finished and you no longer want the Live Activity on your devices. ActivitySmith ends the current Live Activity for this stream and dismisses it from devices. If you need direct lifecycle control, use /live-activity/start, /live-activity/update, and /live-activity/end instead. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. :param stream_key: Stable identifier for one ongoing thing. Allowed characters: letters, numbers, underscores, and hyphens. (required) :type stream_key: str @@ -420,7 +420,7 @@ def end_live_activity_stream_with_http_info( ) -> ApiResponse[LiveActivityStreamDeleteResponse]: """End a stream - Use this endpoint when the process you are tracking is finished and you no longer want the Live Activity on your devices. ActivitySmith ends the current Live Activity for this stream and dismisses it from devices. If you need direct lifecycle control, use /live-activity/start, /live-activity/update, and /live-activity/end instead. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. + Use this endpoint when the process you are tracking is finished and you no longer want the Live Activity on your devices. ActivitySmith ends the current Live Activity for this stream and dismisses it from devices. If you need direct lifecycle control, use /live-activity/start, /live-activity/update, and /live-activity/end instead. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. :param stream_key: Stable identifier for one ongoing thing. Allowed characters: letters, numbers, underscores, and hyphens. (required) :type stream_key: str @@ -494,7 +494,7 @@ def end_live_activity_stream_without_preload_content( ) -> RESTResponseType: """End a stream - Use this endpoint when the process you are tracking is finished and you no longer want the Live Activity on your devices. ActivitySmith ends the current Live Activity for this stream and dismisses it from devices. If you need direct lifecycle control, use /live-activity/start, /live-activity/update, and /live-activity/end instead. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. + Use this endpoint when the process you are tracking is finished and you no longer want the Live Activity on your devices. ActivitySmith ends the current Live Activity for this stream and dismisses it from devices. If you need direct lifecycle control, use /live-activity/start, /live-activity/update, and /live-activity/end instead. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. :param stream_key: Stable identifier for one ongoing thing. Allowed characters: letters, numbers, underscores, and hyphens. (required) :type stream_key: str @@ -642,7 +642,7 @@ def reconcile_live_activity_stream( ) -> LiveActivityStreamPutResponse: """Start a new Live Activity or update an existing one - Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them. + Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them. :param stream_key: Stable identifier for one ongoing thing. Allowed characters: letters, numbers, underscores, and hyphens. (required) :type stream_key: str @@ -717,7 +717,7 @@ def reconcile_live_activity_stream_with_http_info( ) -> ApiResponse[LiveActivityStreamPutResponse]: """Start a new Live Activity or update an existing one - Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them. + Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them. :param stream_key: Stable identifier for one ongoing thing. Allowed characters: letters, numbers, underscores, and hyphens. (required) :type stream_key: str @@ -792,7 +792,7 @@ def reconcile_live_activity_stream_without_preload_content( ) -> RESTResponseType: """Start a new Live Activity or update an existing one - Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them. + Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them. :param stream_key: Stable identifier for one ongoing thing. Allowed characters: letters, numbers, underscores, and hyphens. (required) :type stream_key: str @@ -940,7 +940,7 @@ def start_live_activity( ) -> LiveActivityStartResponse: """Start a Live Activity (legacy manual lifecycle) - Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. Optional tags to organize and filter notification history. + Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, alert, timer, and value activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. :param live_activity_start_request: (required) :type live_activity_start_request: LiveActivityStartRequest @@ -1011,7 +1011,7 @@ def start_live_activity_with_http_info( ) -> ApiResponse[LiveActivityStartResponse]: """Start a Live Activity (legacy manual lifecycle) - Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. Optional tags to organize and filter notification history. + Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, alert, timer, and value activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. :param live_activity_start_request: (required) :type live_activity_start_request: LiveActivityStartRequest @@ -1082,7 +1082,7 @@ def start_live_activity_without_preload_content( ) -> RESTResponseType: """Start a Live Activity (legacy manual lifecycle) - Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. Optional tags to organize and filter notification history. + Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, alert, timer, and value activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. :param live_activity_start_request: (required) :type live_activity_start_request: LiveActivityStartRequest @@ -1224,7 +1224,7 @@ def update_live_activity( ) -> LiveActivityUpdateResponse: """Update a Live Activity (legacy manual lifecycle) - Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. For timer activities, send duration_seconds only when you want to reset the timer window; omit it to keep the current timer running. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. + Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, alert, timer, and value activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. For timer activities, send duration_seconds only when you want to reset the timer window; omit it to keep the current timer running. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. :param live_activity_update_request: (required) :type live_activity_update_request: LiveActivityUpdateRequest @@ -1293,7 +1293,7 @@ def update_live_activity_with_http_info( ) -> ApiResponse[LiveActivityUpdateResponse]: """Update a Live Activity (legacy manual lifecycle) - Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. For timer activities, send duration_seconds only when you want to reset the timer window; omit it to keep the current timer running. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. + Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, alert, timer, and value activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. For timer activities, send duration_seconds only when you want to reset the timer window; omit it to keep the current timer running. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. :param live_activity_update_request: (required) :type live_activity_update_request: LiveActivityUpdateRequest @@ -1362,7 +1362,7 @@ def update_live_activity_without_preload_content( ) -> RESTResponseType: """Update a Live Activity (legacy manual lifecycle) - Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. For timer activities, send duration_seconds only when you want to reset the timer window; omit it to keep the current timer running. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. + Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, alert, timer, and value activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. For timer activities, send duration_seconds only when you want to reset the timer window; omit it to keep the current timer running. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. :param live_activity_update_request: (required) :type live_activity_update_request: LiveActivityUpdateRequest diff --git a/activitysmith_openapi/api/metrics_api.py b/activitysmith_openapi/api/metrics_api.py index 171733e..74926a6 100644 --- a/activitysmith_openapi/api/metrics_api.py +++ b/activitysmith_openapi/api/metrics_api.py @@ -59,7 +59,7 @@ def update_metric_value( ) -> MetricValueUpdateResponse: """Update a widget metric value - Updates the latest value for a metric displayed in ActivitySmith widgets. Create the metric in the web app first, then update its value using the key. + Updates the latest value for a metric displayed in ActivitySmith widgets. Create the metric in the web app first, then update its value using the key. Metric updates have an independent 300-requests-per-minute account allowance. They do not consume the Push Notification, badge, or Live Activity allowances. :param key: Metric key configured in the web app. Lowercase letters, numbers, dots, underscores, and dashes are allowed. (required) :type key: str @@ -133,7 +133,7 @@ def update_metric_value_with_http_info( ) -> ApiResponse[MetricValueUpdateResponse]: """Update a widget metric value - Updates the latest value for a metric displayed in ActivitySmith widgets. Create the metric in the web app first, then update its value using the key. + Updates the latest value for a metric displayed in ActivitySmith widgets. Create the metric in the web app first, then update its value using the key. Metric updates have an independent 300-requests-per-minute account allowance. They do not consume the Push Notification, badge, or Live Activity allowances. :param key: Metric key configured in the web app. Lowercase letters, numbers, dots, underscores, and dashes are allowed. (required) :type key: str @@ -207,7 +207,7 @@ def update_metric_value_without_preload_content( ) -> RESTResponseType: """Update a widget metric value - Updates the latest value for a metric displayed in ActivitySmith widgets. Create the metric in the web app first, then update its value using the key. + Updates the latest value for a metric displayed in ActivitySmith widgets. Create the metric in the web app first, then update its value using the key. Metric updates have an independent 300-requests-per-minute account allowance. They do not consume the Push Notification, badge, or Live Activity allowances. :param key: Metric key configured in the web app. Lowercase letters, numbers, dots, underscores, and dashes are allowed. (required) :type key: str diff --git a/activitysmith_openapi/docs/AppIconBadgesApi.md b/activitysmith_openapi/docs/AppIconBadgesApi.md index 76505cf..2f63367 100644 --- a/activitysmith_openapi/docs/AppIconBadgesApi.md +++ b/activitysmith_openapi/docs/AppIconBadgesApi.md @@ -82,12 +82,12 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | App Icon Badge Count updated | - | -**400** | Bad request | - | -**403** | Forbidden | - | -**422** | No matching devices found, or a targeted device needs to reconnect | - | -**502** | App Icon Badge Count could not be updated | - | -**429** | Rate limit exceeded | - | +**200** | App Icon Badge Count updated | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
| +**400** | Bad request | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
| +**403** | Forbidden | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
| +**422** | No matching devices found, or a targeted device needs to reconnect | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
| +**429** | Rate limit exceeded | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
* Retry-After - Seconds to wait before retrying after a request-rate 429. Live Activity capacity errors are separate and require freeing device capacity; they do not provide a timed retry guarantee.
| +**502** | App Icon Badge Count could not be updated | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
| [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/activitysmith_openapi/docs/ContentStateEnd.md b/activitysmith_openapi/docs/ContentStateEnd.md index fb9b546..b7fb346 100644 --- a/activitysmith_openapi/docs/ContentStateEnd.md +++ b/activitysmith_openapi/docs/ContentStateEnd.md @@ -1,6 +1,6 @@ # ContentStateEnd -End payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For alert include message. For timer, omit duration_seconds to preserve and freeze the latest timer state. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, and segmented_progress. Type is optional when ending an existing activity. You can send an updated number_of_steps here if the workflow changed after start. +End payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For value include a string or number in value; strings preserve currency, units, and other formatting. For alert include message. For timer, omit duration_seconds to preserve and freeze the latest timer state. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, segmented_progress, and value. Type is optional when ending an existing activity. You can send an updated number_of_steps here if the workflow changed after start. ## Properties @@ -11,17 +11,17 @@ Name | Type | Description | Notes **number_of_steps** | **int** | Total number of steps. Use for type=segmented_progress. Optional on end, and safe to change if the final workflow used more or fewer steps than originally planned. | [optional] **current_step** | **int** | Current completed step count. Use for type=segmented_progress. Must be less than or equal to number_of_steps when number_of_steps is provided. | [optional] **percentage** | **float** | Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided. | [optional] -**value** | **float** | Current progress value. Use with upper_limit for type=progress. | [optional] +**value** | [**LiveActivityValue**](LiveActivityValue.md) | For type=value, the required prominent readout (string or finite number); strings preserve exact formatting. For type=progress, a numeric progress value used with upper_limit. | [optional] **upper_limit** | **float** | Maximum progress value. Use with value for type=progress. | [optional] **duration_seconds** | **float** | Timer duration in seconds. For type=timer, omit duration_seconds on end to preserve and freeze the latest timer state. | [optional] **counts_down** | **bool** | Use with type=timer. When true or omitted, the timer counts down from duration_seconds. Set false for an elapsed timer; omit duration_seconds for an open-ended elapsed timer. | [optional] [default to True] **is_running** | **bool** | Use with type=timer. Defaults to true. Set false to pause/freeze via API; set true on a paused timer to resume. | [optional] [default to True] **metrics** | [**List[ActivityMetric]**](ActivityMetric.md) | Use for type=metrics or type=stats. | [optional] **message** | **str** | Alert message. Use for type=alert. | [optional] -**icon** | [**LiveActivityAlertIcon**](LiveActivityAlertIcon.md) | Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer. | [optional] -**badge** | [**LiveActivityAlertBadge**](LiveActivityAlertBadge.md) | Optional badge. Supported by alert, progress, and segmented_progress. | [optional] +**icon** | [**LiveActivityAlertIcon**](LiveActivityAlertIcon.md) | Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, timer, and value. | [optional] +**badge** | [**LiveActivityAlertBadge**](LiveActivityAlertBadge.md) | Optional badge. Supported by alert, progress, segmented_progress, and value. | [optional] **type** | **str** | Optional. When omitted, the API uses the existing Live Activity type. | [optional] -**color** | **str** | Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included. | [optional] +**color** | **str** | Optional. Accent color for progress, segmented_progress, metrics, timer, and value Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included. | [optional] **step_color** | **str** | Optional. Overrides color for the current step. Only applies to type=segmented_progress. | [optional] **step_colors** | **List[str]** | Optional. Colors for completed steps. When used with segmented_progress, the array length should match current_step. | [optional] **auto_dismiss_minutes** | **int** | Optional. Minutes before the ended Live Activity is dismissed. Default 3. Set 0 for immediate dismissal. iOS will dismiss ended Live Activities after ~4 hours max. | [optional] [default to 3] diff --git a/activitysmith_openapi/docs/ContentStateStart.md b/activitysmith_openapi/docs/ContentStateStart.md index ea89f62..2a8422f 100644 --- a/activitysmith_openapi/docs/ContentStateStart.md +++ b/activitysmith_openapi/docs/ContentStateStart.md @@ -1,6 +1,6 @@ # ContentStateStart -Start payload requires title and type. For segmented_progress include number_of_steps and current_step. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For alert include message. For timer include duration_seconds for countdowns, or set counts_down false without duration_seconds for an open-ended elapsed timer. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, and segmented_progress. For segmented_progress, number_of_steps is not locked and can be changed in later update or end calls. +Start payload requires title and type. For segmented_progress include number_of_steps and current_step. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For value include a string or number in value; strings preserve currency, units, and other formatting. For alert include message. For timer include duration_seconds for countdowns, or set counts_down false without duration_seconds for an open-ended elapsed timer. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, segmented_progress, and value. For segmented_progress, number_of_steps is not locked and can be changed in later update or end calls. ## Properties @@ -11,17 +11,17 @@ Name | Type | Description | Notes **number_of_steps** | **int** | Total number of steps. Use for type=segmented_progress. This value can be increased or decreased later when updating or ending the same activity. | [optional] **current_step** | **int** | Current completed step count. Use for type=segmented_progress. Set 0 when the activity has started but no segment is complete yet. Must be less than or equal to number_of_steps. | [optional] **percentage** | **float** | Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided. | [optional] -**value** | **float** | Current progress value. Use with upper_limit for type=progress. | [optional] +**value** | [**LiveActivityValue**](LiveActivityValue.md) | For type=value, the required prominent readout (string or finite number); strings preserve exact formatting. For type=progress, a numeric progress value used with upper_limit. | [optional] **upper_limit** | **float** | Maximum progress value. Use with value for type=progress. | [optional] **duration_seconds** | **float** | Timer duration in seconds. For type=timer countdowns, required on start when counts_down is true or omitted. | [optional] **counts_down** | **bool** | Use with type=timer. When true or omitted, the timer counts down from duration_seconds. Set false for an elapsed timer; omit duration_seconds for an open-ended elapsed timer. | [optional] [default to True] **is_running** | **bool** | Use with type=timer. Defaults to true. Set false to pause/freeze via API; set true on a paused timer to resume. | [optional] [default to True] **metrics** | [**List[ActivityMetric]**](ActivityMetric.md) | Use for type=metrics or type=stats. | [optional] **message** | **str** | Required for type=alert. | [optional] -**icon** | [**LiveActivityAlertIcon**](LiveActivityAlertIcon.md) | Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer. | [optional] -**badge** | [**LiveActivityAlertBadge**](LiveActivityAlertBadge.md) | Optional badge. Supported by alert, progress, and segmented_progress. | [optional] +**icon** | [**LiveActivityAlertIcon**](LiveActivityAlertIcon.md) | Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, timer, and value. | [optional] +**badge** | [**LiveActivityAlertBadge**](LiveActivityAlertBadge.md) | Optional badge. Supported by alert, progress, segmented_progress, and value. | [optional] **type** | **str** | | -**color** | **str** | Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included. | [optional] +**color** | **str** | Optional. Accent color for progress, segmented_progress, metrics, timer, and value Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included. | [optional] **step_color** | **str** | Optional. Overrides color for the current step. Only applies to type=segmented_progress. | [optional] **step_colors** | **List[str]** | Optional. Colors for completed steps. When used with segmented_progress, the array length should match current_step. | [optional] diff --git a/activitysmith_openapi/docs/ContentStateUpdate.md b/activitysmith_openapi/docs/ContentStateUpdate.md index 3f872cc..2eafb72 100644 --- a/activitysmith_openapi/docs/ContentStateUpdate.md +++ b/activitysmith_openapi/docs/ContentStateUpdate.md @@ -1,6 +1,6 @@ # ContentStateUpdate -Update payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For alert include message. For timer, omit duration_seconds to preserve the current timer window or send duration_seconds to reset the timer from the update request time. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, and segmented_progress. Type is optional when updating an existing activity. You can increase or decrease number_of_steps during updates. +Update payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For value include a string or number in value; strings preserve currency, units, and other formatting. For alert include message. For timer, omit duration_seconds to preserve the current timer window or send duration_seconds to reset the timer from the update request time. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, segmented_progress, and value. Type is optional when updating an existing activity. You can increase or decrease number_of_steps during updates. ## Properties @@ -11,17 +11,17 @@ Name | Type | Description | Notes **number_of_steps** | **int** | Total number of steps. Use for type=segmented_progress. Optional on update, and safe to change if the workflow gains or loses steps. | [optional] **current_step** | **int** | Current completed step count. Use for type=segmented_progress. Set 0 when no segment is complete yet. Must be less than or equal to number_of_steps when number_of_steps is provided. | [optional] **percentage** | **float** | Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided. | [optional] -**value** | **float** | Current progress value. Use with upper_limit for type=progress. | [optional] +**value** | [**LiveActivityValue**](LiveActivityValue.md) | For type=value, the required prominent readout (string or finite number); strings preserve exact formatting. For type=progress, a numeric progress value used with upper_limit. | [optional] **upper_limit** | **float** | Maximum progress value. Use with value for type=progress. | [optional] **duration_seconds** | **float** | Timer duration in seconds. For type=timer, sending duration_seconds resets the timer window from the update request time; omit it to preserve the existing timer window. | [optional] **counts_down** | **bool** | Use with type=timer. When true or omitted, the timer counts down from duration_seconds. Set false for an elapsed timer; omit duration_seconds for an open-ended elapsed timer. | [optional] [default to True] **is_running** | **bool** | Use with type=timer. Defaults to true. Set false to pause/freeze via API; set true on a paused timer to resume. | [optional] [default to True] **metrics** | [**List[ActivityMetric]**](ActivityMetric.md) | Use for type=metrics or type=stats. | [optional] **message** | **str** | Alert message. Use for type=alert. | [optional] -**icon** | [**LiveActivityAlertIcon**](LiveActivityAlertIcon.md) | Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer. | [optional] -**badge** | [**LiveActivityAlertBadge**](LiveActivityAlertBadge.md) | Optional badge. Supported by alert, progress, and segmented_progress. | [optional] +**icon** | [**LiveActivityAlertIcon**](LiveActivityAlertIcon.md) | Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, timer, and value. | [optional] +**badge** | [**LiveActivityAlertBadge**](LiveActivityAlertBadge.md) | Optional badge. Supported by alert, progress, segmented_progress, and value. | [optional] **type** | **str** | Optional. When omitted, the API uses the existing Live Activity type. | [optional] -**color** | **str** | Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included. | [optional] +**color** | **str** | Optional. Accent color for progress, segmented_progress, metrics, timer, and value Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included. | [optional] **step_color** | **str** | Optional. Overrides color for the current step. Only applies to type=segmented_progress. | [optional] **step_colors** | **List[str]** | Optional. Colors for completed steps. When used with segmented_progress, the array length should match current_step. | [optional] diff --git a/activitysmith_openapi/docs/LiveActivitiesApi.md b/activitysmith_openapi/docs/LiveActivitiesApi.md index ff46837..29e401a 100644 --- a/activitysmith_openapi/docs/LiveActivitiesApi.md +++ b/activitysmith_openapi/docs/LiveActivitiesApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description End a Live Activity (legacy manual lifecycle) -Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. +Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, timer, and value activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. ### Example @@ -86,9 +86,9 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Live Activity ended | - | -**403** | Forbidden (activity not owned by this API key account) | - | -**429** | Rate limit exceeded | - | +**200** | Live Activity ended | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
| +**403** | Forbidden (activity not owned by this API key account) | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
| +**429** | Rate limit exceeded | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
* Retry-After - Seconds to wait before retrying after a request-rate 429. Live Activity capacity errors are separate and require freeing device capacity; they do not provide a timed retry guarantee.
| [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -97,7 +97,7 @@ Name | Type | Description | Notes End a stream -Use this endpoint when the process you are tracking is finished and you no longer want the Live Activity on your devices. ActivitySmith ends the current Live Activity for this stream and dismisses it from devices. If you need direct lifecycle control, use /live-activity/start, /live-activity/update, and /live-activity/end instead. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. +Use this endpoint when the process you are tracking is finished and you no longer want the Live Activity on your devices. ActivitySmith ends the current Live Activity for this stream and dismisses it from devices. If you need direct lifecycle control, use /live-activity/start, /live-activity/update, and /live-activity/end instead. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. ### Example @@ -169,10 +169,10 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Managed stream ended | - | -**400** | Bad request (invalid stream_key or action) | - | -**404** | Managed stream not found | - | -**429** | Rate limit exceeded | - | +**200** | Managed stream ended | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
| +**400** | Bad request (invalid stream_key or action) | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
| +**404** | Managed stream not found | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
| +**429** | Rate limit exceeded | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
* Retry-After - Seconds to wait before retrying after a request-rate 429. Live Activity capacity errors are separate and require freeing device capacity; they do not provide a timed retry guarantee.
| [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -181,7 +181,7 @@ Name | Type | Description | Notes Start a new Live Activity or update an existing one -Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them. +Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them. ### Example @@ -253,11 +253,11 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Stream reconciled | - | -**400** | Bad request (invalid stream_key, payload, action, or channel targeting input) | - | -**403** | Forbidden (API key scope or channel assignment violation) | - | -**404** | No recipients found for effective channel target | - | -**429** | Rate limit exceeded | - | +**200** | Stream reconciled | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
| +**400** | Bad request (invalid stream_key, payload, action, or channel targeting input) | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
| +**403** | Forbidden (API key scope or channel assignment violation) | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
| +**404** | No recipients found for effective channel target | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
| +**429** | Rate limit exceeded | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
* Retry-After - Seconds to wait before retrying after a request-rate 429. Live Activity capacity errors are separate and require freeing device capacity; they do not provide a timed retry guarantee.
| [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -266,7 +266,7 @@ Name | Type | Description | Notes Start a Live Activity (legacy manual lifecycle) -Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. Optional tags to organize and filter notification history. +Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, alert, timer, and value activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. ### Example @@ -336,11 +336,11 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Live Activity started | - | -**400** | Bad request (invalid payload or channel targeting input) | - | -**403** | Forbidden (API key scope or channel assignment violation) | - | -**404** | No recipients found for effective channel target | - | -**429** | Rate limit exceeded | - | +**200** | Live Activity started | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
| +**400** | Bad request (invalid payload or channel targeting input) | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
| +**403** | Forbidden (API key scope or channel assignment violation) | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
| +**404** | No recipients found for effective channel target | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
| +**429** | Rate limit exceeded | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
* Retry-After - Seconds to wait before retrying after a request-rate 429. Live Activity capacity errors are separate and require freeing device capacity; they do not provide a timed retry guarantee.
| [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -349,7 +349,7 @@ Name | Type | Description | Notes Update a Live Activity (legacy manual lifecycle) -Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. For timer activities, send duration_seconds only when you want to reset the timer window; omit it to keep the current timer running. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. +Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, alert, timer, and value activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. For timer activities, send duration_seconds only when you want to reset the timer window; omit it to keep the current timer running. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. ### Example @@ -419,9 +419,9 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Live Activity updated (or queued) | - | -**403** | Forbidden (activity not owned by this API key account) | - | -**429** | Rate limit exceeded | - | +**200** | Live Activity updated (or queued) | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
| +**403** | Forbidden (activity not owned by this API key account) | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
| +**429** | Rate limit exceeded | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
* Retry-After - Seconds to wait before retrying after a request-rate 429. Live Activity capacity errors are separate and require freeing device capacity; they do not provide a timed retry guarantee.
| [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/activitysmith_openapi/docs/LiveActivityAction.md b/activitysmith_openapi/docs/LiveActivityAction.md index b586ae2..9421e5f 100644 --- a/activitysmith_openapi/docs/LiveActivityAction.md +++ b/activitysmith_openapi/docs/LiveActivityAction.md @@ -1,6 +1,6 @@ # LiveActivityAction -Optional action button shown in the Live Activity UI. Use action for the primary button, or secondary_action for a secondary button on alert, progress, and segmented_progress Live Activities. +Optional action button shown in the Live Activity UI. Use action for the primary button, or secondary_action for a secondary button on alert, progress, segmented_progress, and value Live Activities. ## Properties diff --git a/activitysmith_openapi/docs/LiveActivityEndRequest.md b/activitysmith_openapi/docs/LiveActivityEndRequest.md index c723061..60c6518 100644 --- a/activitysmith_openapi/docs/LiveActivityEndRequest.md +++ b/activitysmith_openapi/docs/LiveActivityEndRequest.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **tags** | **List[str]** | Tags for notification history. Omit to keep existing Tags, supply an array to replace them, or send an empty array to clear them. | [optional] **content_state** | [**ContentStateEnd**](ContentStateEnd.md) | | **action** | [**LiveActivityAction**](LiveActivityAction.md) | | [optional] -**secondary_action** | [**LiveActivityAction**](LiveActivityAction.md) | Optional secondary action button. Supported for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action. | [optional] +**secondary_action** | [**LiveActivityAction**](LiveActivityAction.md) | Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action. | [optional] ## Example diff --git a/activitysmith_openapi/docs/LiveActivityStartRequest.md b/activitysmith_openapi/docs/LiveActivityStartRequest.md index f8b8e7d..a7261b8 100644 --- a/activitysmith_openapi/docs/LiveActivityStartRequest.md +++ b/activitysmith_openapi/docs/LiveActivityStartRequest.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **metadata** | [**Dict[str, MetadataValue]**](MetadataValue.md) | Additional information shown in notification and Live Activity details in ActivitySmith. Not displayed in the Push Notification or Live Activity on the device. Values must be strings, finite numbers, or booleans. At most 50 entries and 16 KB of serialized UTF-8 JSON. Omit on updates to preserve existing Metadata; send {} to clear it. | [optional] **content_state** | [**ContentStateStart**](ContentStateStart.md) | | **action** | [**LiveActivityAction**](LiveActivityAction.md) | | [optional] -**secondary_action** | [**LiveActivityAction**](LiveActivityAction.md) | Optional secondary action button. Supported for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action. | [optional] +**secondary_action** | [**LiveActivityAction**](LiveActivityAction.md) | Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action. | [optional] **alert** | [**AlertPayload**](AlertPayload.md) | | [optional] **target** | [**ChannelTarget**](ChannelTarget.md) | | [optional] **tags** | **List[str]** | Optional tags to organize and filter notification history. | [optional] diff --git a/activitysmith_openapi/docs/LiveActivityStreamDeleteRequest.md b/activitysmith_openapi/docs/LiveActivityStreamDeleteRequest.md index d1d068a..f38468f 100644 --- a/activitysmith_openapi/docs/LiveActivityStreamDeleteRequest.md +++ b/activitysmith_openapi/docs/LiveActivityStreamDeleteRequest.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **tags** | **List[str]** | Optional tags to organize and filter notification history. | [optional] **content_state** | [**StreamContentState**](StreamContentState.md) | | [optional] **action** | [**LiveActivityAction**](LiveActivityAction.md) | | [optional] -**secondary_action** | [**LiveActivityAction**](LiveActivityAction.md) | Optional secondary action button. Supported for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action. | [optional] +**secondary_action** | [**LiveActivityAction**](LiveActivityAction.md) | Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action. | [optional] **alert** | [**AlertPayload**](AlertPayload.md) | | [optional] ## Example diff --git a/activitysmith_openapi/docs/LiveActivityStreamRequest.md b/activitysmith_openapi/docs/LiveActivityStreamRequest.md index 2df7c2a..08c5287 100644 --- a/activitysmith_openapi/docs/LiveActivityStreamRequest.md +++ b/activitysmith_openapi/docs/LiveActivityStreamRequest.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **metadata** | [**Dict[str, MetadataValue]**](MetadataValue.md) | Additional information shown in notification and Live Activity details in ActivitySmith. Not displayed in the Push Notification or Live Activity on the device. Values must be strings, finite numbers, or booleans. At most 50 entries and 16 KB of serialized UTF-8 JSON. Omit on updates to preserve existing Metadata; send {} to clear it. | [optional] **content_state** | [**StreamContentState**](StreamContentState.md) | | **action** | [**LiveActivityAction**](LiveActivityAction.md) | | [optional] -**secondary_action** | [**LiveActivityAction**](LiveActivityAction.md) | Optional secondary action button. Supported for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action. | [optional] +**secondary_action** | [**LiveActivityAction**](LiveActivityAction.md) | Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action. | [optional] **alert** | [**AlertPayload**](AlertPayload.md) | | [optional] **channels** | **List[str]** | Channel slugs. When omitted, API key scope determines recipients. | [optional] **target** | [**ChannelTarget**](ChannelTarget.md) | | [optional] diff --git a/activitysmith_openapi/docs/LiveActivityUpdateRequest.md b/activitysmith_openapi/docs/LiveActivityUpdateRequest.md index e579170..da9cb5a 100644 --- a/activitysmith_openapi/docs/LiveActivityUpdateRequest.md +++ b/activitysmith_openapi/docs/LiveActivityUpdateRequest.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **tags** | **List[str]** | Tags for notification history. Omit to keep existing Tags, supply an array to replace them, or send an empty array to clear them. | [optional] **content_state** | [**ContentStateUpdate**](ContentStateUpdate.md) | | **action** | [**LiveActivityAction**](LiveActivityAction.md) | | [optional] -**secondary_action** | [**LiveActivityAction**](LiveActivityAction.md) | Optional secondary action button. Supported for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action. | [optional] +**secondary_action** | [**LiveActivityAction**](LiveActivityAction.md) | Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action. | [optional] ## Example diff --git a/activitysmith_openapi/docs/LiveActivityValue.md b/activitysmith_openapi/docs/LiveActivityValue.md new file mode 100644 index 0000000..c8eec80 --- /dev/null +++ b/activitysmith_openapi/docs/LiveActivityValue.md @@ -0,0 +1,29 @@ +# LiveActivityValue + +A formatted string or finite numeric Live Activity value. String formatting is preserved. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from activitysmith_openapi.models.live_activity_value import LiveActivityValue + +# TODO update the JSON string below +json = "{}" +# create an instance of LiveActivityValue from a JSON string +live_activity_value_instance = LiveActivityValue.from_json(json) +# print the JSON string representation of the object +print(LiveActivityValue.to_json()) + +# convert the object into a dict +live_activity_value_dict = live_activity_value_instance.to_dict() +# create an instance of LiveActivityValue from a dict +live_activity_value_from_dict = LiveActivityValue.from_dict(live_activity_value_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/activitysmith_openapi/docs/MetricsApi.md b/activitysmith_openapi/docs/MetricsApi.md index 3a31509..08d9aa6 100644 --- a/activitysmith_openapi/docs/MetricsApi.md +++ b/activitysmith_openapi/docs/MetricsApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description Update a widget metric value -Updates the latest value for a metric displayed in ActivitySmith widgets. Create the metric in the web app first, then update its value using the key. +Updates the latest value for a metric displayed in ActivitySmith widgets. Create the metric in the web app first, then update its value using the key. Metric updates have an independent 300-requests-per-minute account allowance. They do not consume the Push Notification, badge, or Live Activity allowances. ### Example @@ -84,10 +84,10 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Metric value updated | - | -**400** | Bad request (invalid key or value) | - | -**404** | Metric not found | - | -**429** | Rate limit exceeded | - | +**200** | Metric value updated | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
| +**400** | Bad request (invalid key or value) | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
| +**404** | Metric not found | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
| +**429** | Rate limit exceeded | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
* Retry-After - Seconds to wait before retrying after a request-rate 429. Live Activity capacity errors are separate and require freeing device capacity; they do not provide a timed retry guarantee.
| [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/activitysmith_openapi/docs/PushNotificationsApi.md b/activitysmith_openapi/docs/PushNotificationsApi.md index 42f4cab..5dab075 100644 --- a/activitysmith_openapi/docs/PushNotificationsApi.md +++ b/activitysmith_openapi/docs/PushNotificationsApi.md @@ -82,11 +82,11 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Push notification sent | - | -**400** | Bad request (invalid payload or channel targeting input) | - | -**403** | Forbidden (API key scope or channel assignment violation) | - | -**404** | No recipients found for effective channel target | - | -**429** | Rate limit exceeded | - | +**200** | Push notification sent | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
| +**400** | Bad request (invalid payload or channel targeting input) | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
| +**403** | Forbidden (API key scope or channel assignment violation) | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
| +**404** | No recipients found for effective channel target | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
| +**429** | Rate limit exceeded | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300.
* Retry-After - Seconds to wait before retrying after a request-rate 429. Live Activity capacity errors are separate and require freeing device capacity; they do not provide a timed retry guarantee.
| [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/activitysmith_openapi/docs/RateLimitError.md b/activitysmith_openapi/docs/RateLimitError.md index 0b8575d..bb5948d 100644 --- a/activitysmith_openapi/docs/RateLimitError.md +++ b/activitysmith_openapi/docs/RateLimitError.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**code** | **str** | | [optional] **error** | **str** | | **message** | **str** | | diff --git a/activitysmith_openapi/docs/SendPushNotification429Response.md b/activitysmith_openapi/docs/SendPushNotification429Response.md index b4847aa..de51695 100644 --- a/activitysmith_openapi/docs/SendPushNotification429Response.md +++ b/activitysmith_openapi/docs/SendPushNotification429Response.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**code** | **str** | | [optional] **error** | **str** | | **message** | **str** | | **limit** | **int** | | diff --git a/activitysmith_openapi/docs/StreamContentState.md b/activitysmith_openapi/docs/StreamContentState.md index 85ff664..60730c6 100644 --- a/activitysmith_openapi/docs/StreamContentState.md +++ b/activitysmith_openapi/docs/StreamContentState.md @@ -1,6 +1,6 @@ # StreamContentState -Current state for a managed Live Activity stream. Include type on the first PUT, and whenever the stream may need to start a fresh activity. Supports segmented_progress, progress, metrics, stats, alert, and timer types. For timer, send duration_seconds to start or reset a bounded timer; omit duration_seconds on later updates to preserve the existing timer window. +Current state for a managed Live Activity stream. Include type on the first PUT, and whenever the stream may need to start a fresh activity. Supports segmented_progress, progress, metrics, stats, alert, timer, and value types. For timer, send duration_seconds to start or reset a bounded timer; omit duration_seconds on later updates to preserve the existing timer window. ## Properties @@ -11,19 +11,19 @@ Name | Type | Description | Notes **number_of_steps** | **int** | Use for segmented_progress. | [optional] **current_step** | **int** | Use for segmented_progress. Set 0 when no segment is complete yet. Must be less than or equal to number_of_steps when number_of_steps is provided. | [optional] **percentage** | **float** | Use for progress. Takes precedence over value/upper_limit if both are provided. | [optional] -**value** | **float** | Current progress value. Use with upper_limit for progress. | [optional] +**value** | [**LiveActivityValue**](LiveActivityValue.md) | For type=value, the required prominent readout (string or finite number); strings preserve exact formatting. For progress, a numeric progress value used with upper_limit. | [optional] **upper_limit** | **float** | Maximum progress value. Use with value for progress. | [optional] **duration_seconds** | **float** | Timer duration in seconds. For type=timer, send duration_seconds to start or reset the timer window; omit it on later stream updates to preserve the existing timer window. | [optional] **counts_down** | **bool** | Use with type=timer. When true or omitted, the timer counts down from duration_seconds. Set false for an elapsed timer; omit duration_seconds for an open-ended elapsed timer. | [optional] [default to True] **is_running** | **bool** | Use with type=timer. Defaults to true. Set false to pause/freeze via API; set true on a paused timer to resume. | [optional] [default to True] **type** | **str** | Required on the first PUT or whenever the stream cannot infer the current activity type. | [optional] -**color** | **str** | Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included. | [optional] +**color** | **str** | Optional. Accent color for progress, segmented_progress, metrics, timer, and value Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included. | [optional] **step_color** | **str** | Optional. Overrides color for the current step. Only applies to segmented_progress. | [optional] **step_colors** | **List[str]** | Optional. Colors for completed steps. When used with segmented_progress, the array length should match current_step. | [optional] **metrics** | [**List[ActivityMetric]**](ActivityMetric.md) | Use for metrics and stats activities. | [optional] **message** | **str** | Required for type=alert. | [optional] -**icon** | [**LiveActivityAlertIcon**](LiveActivityAlertIcon.md) | Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer. | [optional] -**badge** | [**LiveActivityAlertBadge**](LiveActivityAlertBadge.md) | Optional badge. Supported by alert, progress, and segmented_progress. | [optional] +**icon** | [**LiveActivityAlertIcon**](LiveActivityAlertIcon.md) | Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, timer, and value. | [optional] +**badge** | [**LiveActivityAlertBadge**](LiveActivityAlertBadge.md) | Optional badge. Supported by alert, progress, segmented_progress, and value. | [optional] **auto_dismiss_seconds** | **int** | Optional. Seconds before the ended Live Activity is dismissed. | [optional] **auto_dismiss_minutes** | **int** | Optional. Minutes before the ended Live Activity is dismissed. | [optional] diff --git a/activitysmith_openapi/models/__init__.py b/activitysmith_openapi/models/__init__.py index 0f8f506..fd0ed6e 100644 --- a/activitysmith_openapi/models/__init__.py +++ b/activitysmith_openapi/models/__init__.py @@ -42,6 +42,7 @@ from activitysmith_openapi.models.live_activity_stream_request import LiveActivityStreamRequest from activitysmith_openapi.models.live_activity_update_request import LiveActivityUpdateRequest from activitysmith_openapi.models.live_activity_update_response import LiveActivityUpdateResponse +from activitysmith_openapi.models.live_activity_value import LiveActivityValue from activitysmith_openapi.models.live_activity_webhook_method import LiveActivityWebhookMethod from activitysmith_openapi.models.metadata_value import MetadataValue from activitysmith_openapi.models.metric_error import MetricError diff --git a/activitysmith_openapi/models/content_state_end.py b/activitysmith_openapi/models/content_state_end.py index 6c5cc3a..428a8e4 100644 --- a/activitysmith_openapi/models/content_state_end.py +++ b/activitysmith_openapi/models/content_state_end.py @@ -23,29 +23,30 @@ from activitysmith_openapi.models.activity_metric import ActivityMetric from activitysmith_openapi.models.live_activity_alert_badge import LiveActivityAlertBadge from activitysmith_openapi.models.live_activity_alert_icon import LiveActivityAlertIcon +from activitysmith_openapi.models.live_activity_value import LiveActivityValue from typing import Optional, Set from typing_extensions import Self class ContentStateEnd(BaseModel): """ - End payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For alert include message. For timer, omit duration_seconds to preserve and freeze the latest timer state. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, and segmented_progress. Type is optional when ending an existing activity. You can send an updated number_of_steps here if the workflow changed after start. + End payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For value include a string or number in value; strings preserve currency, units, and other formatting. For alert include message. For timer, omit duration_seconds to preserve and freeze the latest timer state. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, segmented_progress, and value. Type is optional when ending an existing activity. You can send an updated number_of_steps here if the workflow changed after start. """ # noqa: E501 title: StrictStr subtitle: Optional[StrictStr] = None number_of_steps: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Total number of steps. Use for type=segmented_progress. Optional on end, and safe to change if the final workflow used more or fewer steps than originally planned.") current_step: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Current completed step count. Use for type=segmented_progress. Must be less than or equal to number_of_steps when number_of_steps is provided.") percentage: Optional[Union[Annotated[float, Field(le=100, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)]]] = Field(default=None, description="Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided.") - value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Current progress value. Use with upper_limit for type=progress.") + value: Optional[LiveActivityValue] = Field(default=None, description="For type=value, the required prominent readout (string or finite number); strings preserve exact formatting. For type=progress, a numeric progress value used with upper_limit.") upper_limit: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Maximum progress value. Use with value for type=progress.") duration_seconds: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Timer duration in seconds. For type=timer, omit duration_seconds on end to preserve and freeze the latest timer state.") counts_down: Optional[StrictBool] = Field(default=True, description="Use with type=timer. When true or omitted, the timer counts down from duration_seconds. Set false for an elapsed timer; omit duration_seconds for an open-ended elapsed timer.") is_running: Optional[StrictBool] = Field(default=True, description="Use with type=timer. Defaults to true. Set false to pause/freeze via API; set true on a paused timer to resume.") metrics: Optional[Annotated[List[ActivityMetric], Field(min_length=1, max_length=8)]] = Field(default=None, description="Use for type=metrics or type=stats.") message: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="Alert message. Use for type=alert.") - icon: Optional[LiveActivityAlertIcon] = Field(default=None, description="Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer.") - badge: Optional[LiveActivityAlertBadge] = Field(default=None, description="Optional badge. Supported by alert, progress, and segmented_progress.") + icon: Optional[LiveActivityAlertIcon] = Field(default=None, description="Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, timer, and value.") + badge: Optional[LiveActivityAlertBadge] = Field(default=None, description="Optional badge. Supported by alert, progress, segmented_progress, and value.") type: Optional[StrictStr] = Field(default=None, description="Optional. When omitted, the API uses the existing Live Activity type.") - color: Optional[StrictStr] = Field(default=None, description="Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included.") + color: Optional[StrictStr] = Field(default=None, description="Optional. Accent color for progress, segmented_progress, metrics, timer, and value Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included.") step_color: Optional[StrictStr] = Field(default=None, description="Optional. Overrides color for the current step. Only applies to type=segmented_progress.") step_colors: Optional[List[StrictStr]] = Field(default=None, description="Optional. Colors for completed steps. When used with segmented_progress, the array length should match current_step.") auto_dismiss_minutes: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=3, description="Optional. Minutes before the ended Live Activity is dismissed. Default 3. Set 0 for immediate dismissal. iOS will dismiss ended Live Activities after ~4 hours max.") @@ -57,8 +58,8 @@ def type_validate_enum(cls, value): if value is None: return value - if value not in set(['segmented_progress', 'progress', 'metrics', 'stats', 'alert', 'timer']): - raise ValueError("must be one of enum values ('segmented_progress', 'progress', 'metrics', 'stats', 'alert', 'timer')") + if value not in set(['segmented_progress', 'progress', 'metrics', 'stats', 'alert', 'timer', 'value']): + raise ValueError("must be one of enum values ('segmented_progress', 'progress', 'metrics', 'stats', 'alert', 'timer', 'value')") return value @field_validator('color') @@ -131,6 +132,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of value + if self.value: + _dict['value'] = self.value.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in metrics (list) _items = [] if self.metrics: @@ -161,7 +165,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "number_of_steps": obj.get("number_of_steps"), "current_step": obj.get("current_step"), "percentage": obj.get("percentage"), - "value": obj.get("value"), + "value": LiveActivityValue.from_dict(obj["value"]) if obj.get("value") is not None else None, "upper_limit": obj.get("upper_limit"), "duration_seconds": obj.get("duration_seconds"), "counts_down": obj.get("counts_down") if obj.get("counts_down") is not None else True, diff --git a/activitysmith_openapi/models/content_state_start.py b/activitysmith_openapi/models/content_state_start.py index 42cade6..568b5b3 100644 --- a/activitysmith_openapi/models/content_state_start.py +++ b/activitysmith_openapi/models/content_state_start.py @@ -23,29 +23,30 @@ from activitysmith_openapi.models.activity_metric import ActivityMetric from activitysmith_openapi.models.live_activity_alert_badge import LiveActivityAlertBadge from activitysmith_openapi.models.live_activity_alert_icon import LiveActivityAlertIcon +from activitysmith_openapi.models.live_activity_value import LiveActivityValue from typing import Optional, Set from typing_extensions import Self class ContentStateStart(BaseModel): """ - Start payload requires title and type. For segmented_progress include number_of_steps and current_step. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For alert include message. For timer include duration_seconds for countdowns, or set counts_down false without duration_seconds for an open-ended elapsed timer. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, and segmented_progress. For segmented_progress, number_of_steps is not locked and can be changed in later update or end calls. + Start payload requires title and type. For segmented_progress include number_of_steps and current_step. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For value include a string or number in value; strings preserve currency, units, and other formatting. For alert include message. For timer include duration_seconds for countdowns, or set counts_down false without duration_seconds for an open-ended elapsed timer. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, segmented_progress, and value. For segmented_progress, number_of_steps is not locked and can be changed in later update or end calls. """ # noqa: E501 title: StrictStr subtitle: Optional[StrictStr] = None number_of_steps: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Total number of steps. Use for type=segmented_progress. This value can be increased or decreased later when updating or ending the same activity.") current_step: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Current completed step count. Use for type=segmented_progress. Set 0 when the activity has started but no segment is complete yet. Must be less than or equal to number_of_steps.") percentage: Optional[Union[Annotated[float, Field(le=100, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)]]] = Field(default=None, description="Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided.") - value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Current progress value. Use with upper_limit for type=progress.") + value: Optional[LiveActivityValue] = Field(default=None, description="For type=value, the required prominent readout (string or finite number); strings preserve exact formatting. For type=progress, a numeric progress value used with upper_limit.") upper_limit: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Maximum progress value. Use with value for type=progress.") duration_seconds: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Timer duration in seconds. For type=timer countdowns, required on start when counts_down is true or omitted.") counts_down: Optional[StrictBool] = Field(default=True, description="Use with type=timer. When true or omitted, the timer counts down from duration_seconds. Set false for an elapsed timer; omit duration_seconds for an open-ended elapsed timer.") is_running: Optional[StrictBool] = Field(default=True, description="Use with type=timer. Defaults to true. Set false to pause/freeze via API; set true on a paused timer to resume.") metrics: Optional[Annotated[List[ActivityMetric], Field(min_length=1, max_length=8)]] = Field(default=None, description="Use for type=metrics or type=stats.") message: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="Required for type=alert.") - icon: Optional[LiveActivityAlertIcon] = Field(default=None, description="Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer.") - badge: Optional[LiveActivityAlertBadge] = Field(default=None, description="Optional badge. Supported by alert, progress, and segmented_progress.") + icon: Optional[LiveActivityAlertIcon] = Field(default=None, description="Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, timer, and value.") + badge: Optional[LiveActivityAlertBadge] = Field(default=None, description="Optional badge. Supported by alert, progress, segmented_progress, and value.") type: StrictStr - color: Optional[StrictStr] = Field(default=None, description="Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included.") + color: Optional[StrictStr] = Field(default=None, description="Optional. Accent color for progress, segmented_progress, metrics, timer, and value Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included.") step_color: Optional[StrictStr] = Field(default=None, description="Optional. Overrides color for the current step. Only applies to type=segmented_progress.") step_colors: Optional[List[StrictStr]] = Field(default=None, description="Optional. Colors for completed steps. When used with segmented_progress, the array length should match current_step.") __properties: ClassVar[List[str]] = ["title", "subtitle", "number_of_steps", "current_step", "percentage", "value", "upper_limit", "duration_seconds", "counts_down", "is_running", "metrics", "message", "icon", "badge", "type", "color", "step_color", "step_colors"] @@ -53,8 +54,8 @@ class ContentStateStart(BaseModel): @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in set(['segmented_progress', 'progress', 'metrics', 'stats', 'alert', 'timer']): - raise ValueError("must be one of enum values ('segmented_progress', 'progress', 'metrics', 'stats', 'alert', 'timer')") + if value not in set(['segmented_progress', 'progress', 'metrics', 'stats', 'alert', 'timer', 'value']): + raise ValueError("must be one of enum values ('segmented_progress', 'progress', 'metrics', 'stats', 'alert', 'timer', 'value')") return value @field_validator('color') @@ -127,6 +128,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of value + if self.value: + _dict['value'] = self.value.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in metrics (list) _items = [] if self.metrics: @@ -157,7 +161,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "number_of_steps": obj.get("number_of_steps"), "current_step": obj.get("current_step"), "percentage": obj.get("percentage"), - "value": obj.get("value"), + "value": LiveActivityValue.from_dict(obj["value"]) if obj.get("value") is not None else None, "upper_limit": obj.get("upper_limit"), "duration_seconds": obj.get("duration_seconds"), "counts_down": obj.get("counts_down") if obj.get("counts_down") is not None else True, diff --git a/activitysmith_openapi/models/content_state_update.py b/activitysmith_openapi/models/content_state_update.py index 52b4780..2b5ea94 100644 --- a/activitysmith_openapi/models/content_state_update.py +++ b/activitysmith_openapi/models/content_state_update.py @@ -23,29 +23,30 @@ from activitysmith_openapi.models.activity_metric import ActivityMetric from activitysmith_openapi.models.live_activity_alert_badge import LiveActivityAlertBadge from activitysmith_openapi.models.live_activity_alert_icon import LiveActivityAlertIcon +from activitysmith_openapi.models.live_activity_value import LiveActivityValue from typing import Optional, Set from typing_extensions import Self class ContentStateUpdate(BaseModel): """ - Update payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For alert include message. For timer, omit duration_seconds to preserve the current timer window or send duration_seconds to reset the timer from the update request time. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, and segmented_progress. Type is optional when updating an existing activity. You can increase or decrease number_of_steps during updates. + Update payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For value include a string or number in value; strings preserve currency, units, and other formatting. For alert include message. For timer, omit duration_seconds to preserve the current timer window or send duration_seconds to reset the timer from the update request time. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, segmented_progress, and value. Type is optional when updating an existing activity. You can increase or decrease number_of_steps during updates. """ # noqa: E501 title: StrictStr subtitle: Optional[StrictStr] = None number_of_steps: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Total number of steps. Use for type=segmented_progress. Optional on update, and safe to change if the workflow gains or loses steps.") current_step: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Current completed step count. Use for type=segmented_progress. Set 0 when no segment is complete yet. Must be less than or equal to number_of_steps when number_of_steps is provided.") percentage: Optional[Union[Annotated[float, Field(le=100, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)]]] = Field(default=None, description="Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided.") - value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Current progress value. Use with upper_limit for type=progress.") + value: Optional[LiveActivityValue] = Field(default=None, description="For type=value, the required prominent readout (string or finite number); strings preserve exact formatting. For type=progress, a numeric progress value used with upper_limit.") upper_limit: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Maximum progress value. Use with value for type=progress.") duration_seconds: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Timer duration in seconds. For type=timer, sending duration_seconds resets the timer window from the update request time; omit it to preserve the existing timer window.") counts_down: Optional[StrictBool] = Field(default=True, description="Use with type=timer. When true or omitted, the timer counts down from duration_seconds. Set false for an elapsed timer; omit duration_seconds for an open-ended elapsed timer.") is_running: Optional[StrictBool] = Field(default=True, description="Use with type=timer. Defaults to true. Set false to pause/freeze via API; set true on a paused timer to resume.") metrics: Optional[Annotated[List[ActivityMetric], Field(min_length=1, max_length=8)]] = Field(default=None, description="Use for type=metrics or type=stats.") message: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="Alert message. Use for type=alert.") - icon: Optional[LiveActivityAlertIcon] = Field(default=None, description="Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer.") - badge: Optional[LiveActivityAlertBadge] = Field(default=None, description="Optional badge. Supported by alert, progress, and segmented_progress.") + icon: Optional[LiveActivityAlertIcon] = Field(default=None, description="Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, timer, and value.") + badge: Optional[LiveActivityAlertBadge] = Field(default=None, description="Optional badge. Supported by alert, progress, segmented_progress, and value.") type: Optional[StrictStr] = Field(default=None, description="Optional. When omitted, the API uses the existing Live Activity type.") - color: Optional[StrictStr] = Field(default=None, description="Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included.") + color: Optional[StrictStr] = Field(default=None, description="Optional. Accent color for progress, segmented_progress, metrics, timer, and value Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included.") step_color: Optional[StrictStr] = Field(default=None, description="Optional. Overrides color for the current step. Only applies to type=segmented_progress.") step_colors: Optional[List[StrictStr]] = Field(default=None, description="Optional. Colors for completed steps. When used with segmented_progress, the array length should match current_step.") __properties: ClassVar[List[str]] = ["title", "subtitle", "number_of_steps", "current_step", "percentage", "value", "upper_limit", "duration_seconds", "counts_down", "is_running", "metrics", "message", "icon", "badge", "type", "color", "step_color", "step_colors"] @@ -56,8 +57,8 @@ def type_validate_enum(cls, value): if value is None: return value - if value not in set(['segmented_progress', 'progress', 'metrics', 'stats', 'alert', 'timer']): - raise ValueError("must be one of enum values ('segmented_progress', 'progress', 'metrics', 'stats', 'alert', 'timer')") + if value not in set(['segmented_progress', 'progress', 'metrics', 'stats', 'alert', 'timer', 'value']): + raise ValueError("must be one of enum values ('segmented_progress', 'progress', 'metrics', 'stats', 'alert', 'timer', 'value')") return value @field_validator('color') @@ -130,6 +131,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of value + if self.value: + _dict['value'] = self.value.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in metrics (list) _items = [] if self.metrics: @@ -160,7 +164,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "number_of_steps": obj.get("number_of_steps"), "current_step": obj.get("current_step"), "percentage": obj.get("percentage"), - "value": obj.get("value"), + "value": LiveActivityValue.from_dict(obj["value"]) if obj.get("value") is not None else None, "upper_limit": obj.get("upper_limit"), "duration_seconds": obj.get("duration_seconds"), "counts_down": obj.get("counts_down") if obj.get("counts_down") is not None else True, diff --git a/activitysmith_openapi/models/live_activity_action.py b/activitysmith_openapi/models/live_activity_action.py index 5c8cdbe..eeac0cb 100644 --- a/activitysmith_openapi/models/live_activity_action.py +++ b/activitysmith_openapi/models/live_activity_action.py @@ -26,7 +26,7 @@ class LiveActivityAction(BaseModel): """ - Optional action button shown in the Live Activity UI. Use action for the primary button, or secondary_action for a secondary button on alert, progress, and segmented_progress Live Activities. + Optional action button shown in the Live Activity UI. Use action for the primary button, or secondary_action for a secondary button on alert, progress, segmented_progress, and value Live Activities. """ # noqa: E501 title: StrictStr = Field(description="Button title displayed in the Live Activity UI.") type: LiveActivityActionType @@ -34,7 +34,7 @@ class LiveActivityAction(BaseModel): 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] = {} - __properties: ClassVar[List[str]] = [] + __properties: ClassVar[List[str]] = ["title", "type", "url", "method", "body"] model_config = ConfigDict( populate_by_name=True, @@ -94,6 +94,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "title": obj.get("title"), + "type": obj.get("type"), + "url": obj.get("url"), + "method": obj.get("method") if obj.get("method") is not None else LiveActivityWebhookMethod.POST, + "body": obj.get("body") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/activitysmith_openapi/models/live_activity_end_request.py b/activitysmith_openapi/models/live_activity_end_request.py index 4b9d75c..0a2721b 100644 --- a/activitysmith_openapi/models/live_activity_end_request.py +++ b/activitysmith_openapi/models/live_activity_end_request.py @@ -35,7 +35,7 @@ class LiveActivityEndRequest(BaseModel): tags: Optional[Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=64)]], Field(max_length=20)]] = Field(default=None, description="Tags for notification history. Omit to keep existing Tags, supply an array to replace them, or send an empty array to clear them.") content_state: ContentStateEnd action: Optional[LiveActivityAction] = None - secondary_action: Optional[LiveActivityAction] = Field(default=None, description="Optional secondary action button. Supported for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.") + secondary_action: Optional[LiveActivityAction] = Field(default=None, description="Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.") __properties: ClassVar[List[str]] = ["metadata", "activity_id", "tags", "content_state", "action", "secondary_action"] model_config = ConfigDict( diff --git a/activitysmith_openapi/models/live_activity_start_request.py b/activitysmith_openapi/models/live_activity_start_request.py index 1197184..5c8b78a 100644 --- a/activitysmith_openapi/models/live_activity_start_request.py +++ b/activitysmith_openapi/models/live_activity_start_request.py @@ -35,7 +35,7 @@ class LiveActivityStartRequest(BaseModel): metadata: Optional[Dict[str, MetadataValue]] = Field(default=None, description="Additional information shown in notification and Live Activity details in ActivitySmith. Not displayed in the Push Notification or Live Activity on the device. Values must be strings, finite numbers, or booleans. At most 50 entries and 16 KB of serialized UTF-8 JSON. Omit on updates to preserve existing Metadata; send {} to clear it.") content_state: ContentStateStart action: Optional[LiveActivityAction] = None - secondary_action: Optional[LiveActivityAction] = Field(default=None, description="Optional secondary action button. Supported for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.") + secondary_action: Optional[LiveActivityAction] = Field(default=None, description="Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.") alert: Optional[AlertPayload] = None target: Optional[ChannelTarget] = None tags: Optional[List[Annotated[str, Field(min_length=1, strict=True, max_length=64)]]] = Field(default=None, description="Optional tags to organize and filter notification history.") diff --git a/activitysmith_openapi/models/live_activity_stream_delete_request.py b/activitysmith_openapi/models/live_activity_stream_delete_request.py index b47c57b..10cbe52 100644 --- a/activitysmith_openapi/models/live_activity_stream_delete_request.py +++ b/activitysmith_openapi/models/live_activity_stream_delete_request.py @@ -35,7 +35,7 @@ class LiveActivityStreamDeleteRequest(BaseModel): tags: Optional[List[Annotated[str, Field(min_length=1, strict=True, max_length=64)]]] = Field(default=None, description="Optional tags to organize and filter notification history.") content_state: Optional[StreamContentState] = None action: Optional[LiveActivityAction] = None - secondary_action: Optional[LiveActivityAction] = Field(default=None, description="Optional secondary action button. Supported for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.") + secondary_action: Optional[LiveActivityAction] = Field(default=None, description="Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.") alert: Optional[AlertPayload] = None __properties: ClassVar[List[str]] = ["metadata", "tags", "content_state", "action", "secondary_action", "alert"] diff --git a/activitysmith_openapi/models/live_activity_stream_request.py b/activitysmith_openapi/models/live_activity_stream_request.py index 3b39cad..aa0c32b 100644 --- a/activitysmith_openapi/models/live_activity_stream_request.py +++ b/activitysmith_openapi/models/live_activity_stream_request.py @@ -35,7 +35,7 @@ class LiveActivityStreamRequest(BaseModel): metadata: Optional[Dict[str, MetadataValue]] = Field(default=None, description="Additional information shown in notification and Live Activity details in ActivitySmith. Not displayed in the Push Notification or Live Activity on the device. Values must be strings, finite numbers, or booleans. At most 50 entries and 16 KB of serialized UTF-8 JSON. Omit on updates to preserve existing Metadata; send {} to clear it.") content_state: StreamContentState action: Optional[LiveActivityAction] = None - secondary_action: Optional[LiveActivityAction] = Field(default=None, description="Optional secondary action button. Supported for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.") + secondary_action: Optional[LiveActivityAction] = Field(default=None, description="Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.") alert: Optional[AlertPayload] = None channels: Optional[Annotated[List[StrictStr], Field(min_length=1)]] = Field(default=None, description="Channel slugs. When omitted, API key scope determines recipients.") target: Optional[ChannelTarget] = None diff --git a/activitysmith_openapi/models/live_activity_update_request.py b/activitysmith_openapi/models/live_activity_update_request.py index 4c342b9..42472fa 100644 --- a/activitysmith_openapi/models/live_activity_update_request.py +++ b/activitysmith_openapi/models/live_activity_update_request.py @@ -35,7 +35,7 @@ class LiveActivityUpdateRequest(BaseModel): tags: Optional[Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=64)]], Field(max_length=20)]] = Field(default=None, description="Tags for notification history. Omit to keep existing Tags, supply an array to replace them, or send an empty array to clear them.") content_state: ContentStateUpdate action: Optional[LiveActivityAction] = None - secondary_action: Optional[LiveActivityAction] = Field(default=None, description="Optional secondary action button. Supported for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.") + secondary_action: Optional[LiveActivityAction] = Field(default=None, description="Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.") __properties: ClassVar[List[str]] = ["metadata", "activity_id", "tags", "content_state", "action", "secondary_action"] model_config = ConfigDict( diff --git a/activitysmith_openapi/models/live_activity_value.py b/activitysmith_openapi/models/live_activity_value.py new file mode 100644 index 0000000..02e64d8 --- /dev/null +++ b/activitysmith_openapi/models/live_activity_value.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + ActivitySmith API + + Send push notifications and Live Activities to your own devices via a single API key. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional, Union +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +LIVEACTIVITYVALUE_ONE_OF_SCHEMAS = ["float", "str"] + +class LiveActivityValue(BaseModel): + """ + A formatted string or finite numeric Live Activity value. String formatting is preserved. + """ + # data type: str + oneof_schema_1_validator: Optional[StrictStr] = None + # data type: float + oneof_schema_2_validator: Optional[Union[StrictFloat, StrictInt]] = None + actual_instance: Optional[Union[float, str]] = None + one_of_schemas: Set[str] = { "float", "str" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = LiveActivityValue.model_construct() + error_messages = [] + match = 0 + # validate data type: str + try: + instance.oneof_schema_1_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: float + try: + instance.oneof_schema_2_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in LiveActivityValue with oneOf schemas: float, str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in LiveActivityValue with oneOf schemas: float, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into str + try: + # validation + instance.oneof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_1_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into float + try: + # validation + instance.oneof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_2_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into LiveActivityValue with oneOf schemas: float, str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into LiveActivityValue with oneOf schemas: float, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], float, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/activitysmith_openapi/models/push_notification_action.py b/activitysmith_openapi/models/push_notification_action.py index 5af3e5b..d735e65 100644 --- a/activitysmith_openapi/models/push_notification_action.py +++ b/activitysmith_openapi/models/push_notification_action.py @@ -34,7 +34,7 @@ class PushNotificationAction(BaseModel): 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] = {} - __properties: ClassVar[List[str]] = [] + __properties: ClassVar[List[str]] = ["title", "type", "url", "method", "body"] model_config = ConfigDict( populate_by_name=True, @@ -94,6 +94,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "title": obj.get("title"), + "type": obj.get("type"), + "url": obj.get("url"), + "method": obj.get("method") if obj.get("method") is not None else PushNotificationWebhookMethod.POST, + "body": obj.get("body") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/activitysmith_openapi/models/rate_limit_error.py b/activitysmith_openapi/models/rate_limit_error.py index 5881109..d4095b9 100644 --- a/activitysmith_openapi/models/rate_limit_error.py +++ b/activitysmith_openapi/models/rate_limit_error.py @@ -17,8 +17,8 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -26,9 +26,20 @@ class RateLimitError(BaseModel): """ RateLimitError """ # noqa: E501 + code: Optional[StrictStr] = None error: StrictStr message: StrictStr - __properties: ClassVar[List[str]] = ["error", "message"] + __properties: ClassVar[List[str]] = ["code", "error", "message"] + + @field_validator('code') + def code_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['rate_limited']): + raise ValueError("must be one of enum values ('rate_limited')") + return value model_config = ConfigDict( populate_by_name=True, @@ -81,6 +92,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "code": obj.get("code"), "error": obj.get("error"), "message": obj.get("message") }) diff --git a/activitysmith_openapi/models/stream_content_state.py b/activitysmith_openapi/models/stream_content_state.py index d8114b2..e1e903a 100644 --- a/activitysmith_openapi/models/stream_content_state.py +++ b/activitysmith_openapi/models/stream_content_state.py @@ -23,31 +23,32 @@ from activitysmith_openapi.models.activity_metric import ActivityMetric from activitysmith_openapi.models.live_activity_alert_badge import LiveActivityAlertBadge from activitysmith_openapi.models.live_activity_alert_icon import LiveActivityAlertIcon +from activitysmith_openapi.models.live_activity_value import LiveActivityValue from typing import Optional, Set from typing_extensions import Self class StreamContentState(BaseModel): """ - Current state for a managed Live Activity stream. Include type on the first PUT, and whenever the stream may need to start a fresh activity. Supports segmented_progress, progress, metrics, stats, alert, and timer types. For timer, send duration_seconds to start or reset a bounded timer; omit duration_seconds on later updates to preserve the existing timer window. + Current state for a managed Live Activity stream. Include type on the first PUT, and whenever the stream may need to start a fresh activity. Supports segmented_progress, progress, metrics, stats, alert, timer, and value types. For timer, send duration_seconds to start or reset a bounded timer; omit duration_seconds on later updates to preserve the existing timer window. """ # noqa: E501 title: StrictStr subtitle: Optional[StrictStr] = None number_of_steps: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Use for segmented_progress.") current_step: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Use for segmented_progress. Set 0 when no segment is complete yet. Must be less than or equal to number_of_steps when number_of_steps is provided.") percentage: Optional[Union[Annotated[float, Field(le=100, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)]]] = Field(default=None, description="Use for progress. Takes precedence over value/upper_limit if both are provided.") - value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Current progress value. Use with upper_limit for progress.") + value: Optional[LiveActivityValue] = Field(default=None, description="For type=value, the required prominent readout (string or finite number); strings preserve exact formatting. For progress, a numeric progress value used with upper_limit.") upper_limit: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Maximum progress value. Use with value for progress.") duration_seconds: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Timer duration in seconds. For type=timer, send duration_seconds to start or reset the timer window; omit it on later stream updates to preserve the existing timer window.") counts_down: Optional[StrictBool] = Field(default=True, description="Use with type=timer. When true or omitted, the timer counts down from duration_seconds. Set false for an elapsed timer; omit duration_seconds for an open-ended elapsed timer.") is_running: Optional[StrictBool] = Field(default=True, description="Use with type=timer. Defaults to true. Set false to pause/freeze via API; set true on a paused timer to resume.") type: Optional[StrictStr] = Field(default=None, description="Required on the first PUT or whenever the stream cannot infer the current activity type.") - color: Optional[StrictStr] = Field(default=None, description="Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included.") + color: Optional[StrictStr] = Field(default=None, description="Optional. Accent color for progress, segmented_progress, metrics, timer, and value Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included.") step_color: Optional[StrictStr] = Field(default=None, description="Optional. Overrides color for the current step. Only applies to segmented_progress.") step_colors: Optional[List[StrictStr]] = Field(default=None, description="Optional. Colors for completed steps. When used with segmented_progress, the array length should match current_step.") metrics: Optional[Annotated[List[ActivityMetric], Field(min_length=1, max_length=8)]] = Field(default=None, description="Use for metrics and stats activities.") message: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="Required for type=alert.") - icon: Optional[LiveActivityAlertIcon] = Field(default=None, description="Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer.") - badge: Optional[LiveActivityAlertBadge] = Field(default=None, description="Optional badge. Supported by alert, progress, and segmented_progress.") + icon: Optional[LiveActivityAlertIcon] = Field(default=None, description="Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, timer, and value.") + badge: Optional[LiveActivityAlertBadge] = Field(default=None, description="Optional badge. Supported by alert, progress, segmented_progress, and value.") auto_dismiss_seconds: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Optional. Seconds before the ended Live Activity is dismissed.") auto_dismiss_minutes: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Optional. Minutes before the ended Live Activity is dismissed.") __properties: ClassVar[List[str]] = ["title", "subtitle", "number_of_steps", "current_step", "percentage", "value", "upper_limit", "duration_seconds", "counts_down", "is_running", "type", "color", "step_color", "step_colors", "metrics", "message", "icon", "badge", "auto_dismiss_seconds", "auto_dismiss_minutes"] @@ -58,8 +59,8 @@ def type_validate_enum(cls, value): if value is None: return value - if value not in set(['segmented_progress', 'progress', 'metrics', 'stats', 'alert', 'timer']): - raise ValueError("must be one of enum values ('segmented_progress', 'progress', 'metrics', 'stats', 'alert', 'timer')") + if value not in set(['segmented_progress', 'progress', 'metrics', 'stats', 'alert', 'timer', 'value']): + raise ValueError("must be one of enum values ('segmented_progress', 'progress', 'metrics', 'stats', 'alert', 'timer', 'value')") return value @field_validator('color') @@ -132,6 +133,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of value + if self.value: + _dict['value'] = self.value.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in metrics (list) _items = [] if self.metrics: @@ -162,7 +166,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "number_of_steps": obj.get("number_of_steps"), "current_step": obj.get("current_step"), "percentage": obj.get("percentage"), - "value": obj.get("value"), + "value": LiveActivityValue.from_dict(obj["value"]) if obj.get("value") is not None else None, "upper_limit": obj.get("upper_limit"), "duration_seconds": obj.get("duration_seconds"), "counts_down": obj.get("counts_down") if obj.get("counts_down") is not None else True, diff --git a/activitysmith_openapi/openapi-source.json b/activitysmith_openapi/openapi-source.json index dc05717..aeeecd6 100644 --- a/activitysmith_openapi/openapi-source.json +++ b/activitysmith_openapi/openapi-source.json @@ -1,6 +1,6 @@ { "repository": "ActivitySmithHQ/activitysmith-backend", - "commit": "49ad7b083b50f53bc3d81edb77ca6597845160a2", + "commit": "6832df646de7de8a6aaf0110960c37074b513c48", "path": "openapi.json", - "sha256": "b7e33cd485df8ddc5d7fb7b57b61106fd6f8ff3ffa7cc7bef4ac1ccbbb0cede7" + "sha256": "9ae85ad6127cfa2d50c33261459f5f9e85e011939d01ac4a9d507fa6ed11aa61" } diff --git a/activitysmith_openapi/test/test_content_state_end.py b/activitysmith_openapi/test/test_content_state_end.py index 4bea9a2..7d68a6f 100644 --- a/activitysmith_openapi/test/test_content_state_end.py +++ b/activitysmith_openapi/test/test_content_state_end.py @@ -40,7 +40,7 @@ def make_instance(self, include_optional) -> ContentStateEnd: number_of_steps = 1, current_step = 0, percentage = 0, - value = 1.337, + value = None, upper_limit = 1.337, duration_seconds = 1.337, counts_down = True, diff --git a/activitysmith_openapi/test/test_content_state_start.py b/activitysmith_openapi/test/test_content_state_start.py index 02aa2c5..4a1a68c 100644 --- a/activitysmith_openapi/test/test_content_state_start.py +++ b/activitysmith_openapi/test/test_content_state_start.py @@ -40,7 +40,7 @@ def make_instance(self, include_optional) -> ContentStateStart: number_of_steps = 1, current_step = 0, percentage = 0, - value = 1.337, + value = None, upper_limit = 1.337, duration_seconds = 1.337, counts_down = True, diff --git a/activitysmith_openapi/test/test_content_state_update.py b/activitysmith_openapi/test/test_content_state_update.py index ca888f5..11412f4 100644 --- a/activitysmith_openapi/test/test_content_state_update.py +++ b/activitysmith_openapi/test/test_content_state_update.py @@ -40,7 +40,7 @@ def make_instance(self, include_optional) -> ContentStateUpdate: number_of_steps = 1, current_step = 0, percentage = 0, - value = 1.337, + value = None, upper_limit = 1.337, duration_seconds = 1.337, counts_down = True, diff --git a/activitysmith_openapi/test/test_live_activity_end_request.py b/activitysmith_openapi/test/test_live_activity_end_request.py index a03564c..303c56c 100644 --- a/activitysmith_openapi/test/test_live_activity_end_request.py +++ b/activitysmith_openapi/test/test_live_activity_end_request.py @@ -48,7 +48,7 @@ def make_instance(self, include_optional) -> LiveActivityEndRequest: number_of_steps = 1, current_step = 0, percentage = 0, - value = 1.337, + value = null, upper_limit = 1.337, duration_seconds = 1.337, counts_down = True, @@ -89,7 +89,7 @@ def make_instance(self, include_optional) -> LiveActivityEndRequest: number_of_steps = 1, current_step = 0, percentage = 0, - value = 1.337, + value = null, upper_limit = 1.337, duration_seconds = 1.337, counts_down = True, diff --git a/activitysmith_openapi/test/test_live_activity_start_request.py b/activitysmith_openapi/test/test_live_activity_start_request.py index cb9b91a..9e3b610 100644 --- a/activitysmith_openapi/test/test_live_activity_start_request.py +++ b/activitysmith_openapi/test/test_live_activity_start_request.py @@ -44,7 +44,7 @@ def make_instance(self, include_optional) -> LiveActivityStartRequest: number_of_steps = 1, current_step = 0, percentage = 0, - value = 1.337, + value = null, upper_limit = 1.337, duration_seconds = 1.337, counts_down = True, @@ -93,7 +93,7 @@ def make_instance(self, include_optional) -> LiveActivityStartRequest: number_of_steps = 1, current_step = 0, percentage = 0, - value = 1.337, + value = null, upper_limit = 1.337, duration_seconds = 1.337, counts_down = True, diff --git a/activitysmith_openapi/test/test_live_activity_stream_delete_request.py b/activitysmith_openapi/test/test_live_activity_stream_delete_request.py index 3238961..fc63177 100644 --- a/activitysmith_openapi/test/test_live_activity_stream_delete_request.py +++ b/activitysmith_openapi/test/test_live_activity_stream_delete_request.py @@ -47,7 +47,7 @@ def make_instance(self, include_optional) -> LiveActivityStreamDeleteRequest: number_of_steps = 1, current_step = 0, percentage = 0, - value = 1.337, + value = null, upper_limit = 1.337, duration_seconds = 1.337, counts_down = True, diff --git a/activitysmith_openapi/test/test_live_activity_stream_request.py b/activitysmith_openapi/test/test_live_activity_stream_request.py index bc88f8f..85398f6 100644 --- a/activitysmith_openapi/test/test_live_activity_stream_request.py +++ b/activitysmith_openapi/test/test_live_activity_stream_request.py @@ -44,7 +44,7 @@ def make_instance(self, include_optional) -> LiveActivityStreamRequest: number_of_steps = 1, current_step = 0, percentage = 0, - value = 1.337, + value = null, upper_limit = 1.337, duration_seconds = 1.337, counts_down = True, @@ -98,7 +98,7 @@ def make_instance(self, include_optional) -> LiveActivityStreamRequest: number_of_steps = 1, current_step = 0, percentage = 0, - value = 1.337, + value = null, upper_limit = 1.337, duration_seconds = 1.337, counts_down = True, diff --git a/activitysmith_openapi/test/test_live_activity_update_request.py b/activitysmith_openapi/test/test_live_activity_update_request.py index 9200dc8..88f37d6 100644 --- a/activitysmith_openapi/test/test_live_activity_update_request.py +++ b/activitysmith_openapi/test/test_live_activity_update_request.py @@ -48,7 +48,7 @@ def make_instance(self, include_optional) -> LiveActivityUpdateRequest: number_of_steps = 1, current_step = 0, percentage = 0, - value = 1.337, + value = null, upper_limit = 1.337, duration_seconds = 1.337, counts_down = True, @@ -88,7 +88,7 @@ def make_instance(self, include_optional) -> LiveActivityUpdateRequest: number_of_steps = 1, current_step = 0, percentage = 0, - value = 1.337, + value = null, upper_limit = 1.337, duration_seconds = 1.337, counts_down = True, diff --git a/activitysmith_openapi/test/test_live_activity_value.py b/activitysmith_openapi/test/test_live_activity_value.py new file mode 100644 index 0000000..cd91311 --- /dev/null +++ b/activitysmith_openapi/test/test_live_activity_value.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + ActivitySmith API + + Send push notifications and Live Activities to your own devices via a single API key. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from activitysmith_openapi.models.live_activity_value import LiveActivityValue + +class TestLiveActivityValue(unittest.TestCase): + """LiveActivityValue unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LiveActivityValue: + """Test LiveActivityValue + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `LiveActivityValue` + """ + model = LiveActivityValue() + if include_optional: + return LiveActivityValue( + ) + else: + return LiveActivityValue( + ) + """ + + def testLiveActivityValue(self): + """Test LiveActivityValue""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/activitysmith_openapi/test/test_rate_limit_error.py b/activitysmith_openapi/test/test_rate_limit_error.py index 22f368d..5c9b1c5 100644 --- a/activitysmith_openapi/test/test_rate_limit_error.py +++ b/activitysmith_openapi/test/test_rate_limit_error.py @@ -35,6 +35,7 @@ def make_instance(self, include_optional) -> RateLimitError: model = RateLimitError() if include_optional: return RateLimitError( + code = 'rate_limited', error = '', message = '' ) diff --git a/activitysmith_openapi/test/test_send_push_notification429_response.py b/activitysmith_openapi/test/test_send_push_notification429_response.py index d47464f..b4d8cc1 100644 --- a/activitysmith_openapi/test/test_send_push_notification429_response.py +++ b/activitysmith_openapi/test/test_send_push_notification429_response.py @@ -35,6 +35,7 @@ def make_instance(self, include_optional) -> SendPushNotification429Response: model = SendPushNotification429Response() if include_optional: return SendPushNotification429Response( + code = 'rate_limited', error = '', message = '', limit = 56, diff --git a/activitysmith_openapi/test/test_stream_content_state.py b/activitysmith_openapi/test/test_stream_content_state.py index 2b9c480..f36eb8b 100644 --- a/activitysmith_openapi/test/test_stream_content_state.py +++ b/activitysmith_openapi/test/test_stream_content_state.py @@ -40,7 +40,7 @@ def make_instance(self, include_optional) -> StreamContentState: number_of_steps = 1, current_step = 0, percentage = 0, - value = 1.337, + value = None, upper_limit = 1.337, duration_seconds = 1.337, counts_down = True, From b9e0a3a14e104bd8f15c6a44c357b9703f62ffae Mon Sep 17 00:00:00 2001 From: bardonadam Date: Sun, 20 Sep 2026 12:23:08 +0700 Subject: [PATCH 2/2] feat: add Value Live Activities in v1.12.0 --- CHANGELOG.md | 4 ++ README.md | 84 +++++++++++++++----------- activitysmith/client.py | 5 +- activitysmith/normalization.py | 8 ++- activitysmith_openapi/__init__.py | 2 +- activitysmith_openapi/api_client.py | 2 +- activitysmith_openapi/configuration.py | 2 +- pyproject.toml | 2 +- tests/test_value_serialization.py | 22 +++++++ 9 files changed, 89 insertions(+), 42 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6bf11e..8e9a429 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.12.0 + +Adds the new `value` Live Activity type. + ## 1.11.0 This version adds support for Metadata and iOS deep links, and expands Tags support when updating or ending Live Activities. diff --git a/README.md b/README.md index c4eb458..68c8bc8 100644 --- a/README.md +++ b/README.md @@ -138,33 +138,43 @@ activitysmith.notifications.send( Choose the Live Activity type that matches what you want to show: -![Stats Live Activity with six labeled sales metrics](https://cdn.activitysmith.com/features/stats-live-activity.png) +- ![Value Live Activity showing revenue with a growth badge](https://cdn.activitysmith.com/features/value-live-activity.png) **Value**: Show a single value on your Lock Screen, such as revenue, a queue count, or a temperature. -**Stats**: Show up to 8 labeled values on your Lock Screen, from revenue and orders to uptime and conversion. +- ![Stats Live Activity with six labeled sales metrics](https://cdn.activitysmith.com/features/stats-live-activity.png) **Stats**: Show up to 8 labeled values on your Lock Screen, from revenue and orders to uptime and conversion. -![Metrics Live Activity with CPU and memory values](https://cdn.activitysmith.com/features/metrics-live-activity-start.png) +- ![Alert Live Activity showing a customer reactivation update](https://cdn.activitysmith.com/features/alert-live-activity.png) **Alert**: Show status updates with a clear message, badge, and icon. When you add an action button, `color` controls the button tint. -**Metrics**: Track two related values with segmented bars, such as CPU and memory. +- ![Metrics Live Activity with CPU and memory values](https://cdn.activitysmith.com/features/metrics-live-activity-start.png) **Metrics**: Track two related values with segmented bars, such as CPU and memory. -![Segmented Progress Live Activity showing a workflow step](https://cdn.activitysmith.com/features/update-live-activity.png) +- ![Segmented Progress Live Activity showing a workflow step](https://cdn.activitysmith.com/features/update-live-activity.png) **Segmented Progress**: Show progress through a known set of steps, like build, test, deploy, and verify. -**Segmented Progress**: Show progress through a known set of steps, like build, test, deploy, and verify. +- ![Progress Live Activity showing percentage completion](https://cdn.activitysmith.com/features/progress-live-activity.png) **Progress**: Show percentage progress for jobs that move continuously toward completion. -![Progress Live Activity showing percentage completion](https://cdn.activitysmith.com/features/progress-live-activity.png) +- ![Timer Live Activity showing a benchmark run countdown](https://cdn.activitysmith.com/features/timer-live-activity.png) **Timer**: Count down from a duration, or count up from 00:00 while a job runs. -**Progress**: Show percentage progress for jobs that move continuously toward completion. - -![Alert Live Activity showing a customer reactivation update](https://cdn.activitysmith.com/features/alert-live-activity.png) +### Start & Update Live Activity -**Alert**: Show status updates with a clear message, badge, and icon. When you add an action button, `color` controls the button tint. +Use a stable `stream_key` to identify the metric, job, deployment, or system you want to keep visible. The first `stream(...)` call starts the Live Activity. Later calls with the same `stream_key` update it. -![Timer Live Activity showing a benchmark run countdown](https://cdn.activitysmith.com/features/timer-live-activity.png) +#### Value -**Timer**: Count down from a duration, or count up from 00:00 while a job runs. +![Value Live Activity stream example](https://cdn.activitysmith.com/features/value-live-activity.png) -### Start & Update Live Activity +```python +activitysmith.live_activities.stream( + "revenue-today", + content_state=content_state( + title="Revenue", + type="value", + value="$1,240", + color="green", + icon=alert_icon("dollarsign.circle", color="green"), + badge=alert_badge("↑ 18%", color="purple"), + ), +) +``` -Use a stable `stream_key` to identify the metric, job, deployment, or system you want to keep visible. The first `stream(...)` call starts the Live Activity. Later calls with the same `stream_key` update it. +Send a string or number in `value`. Strings keep their formatting, including currency symbols, units, and decimal places. #### Stats @@ -189,6 +199,23 @@ activitysmith.live_activities.stream( ) ``` +#### Alert + +![Alert Live Activity stream example](https://cdn.activitysmith.com/features/alert-live-activity.png) + +```python +activitysmith.live_activities.stream( + "customer-ops", + content_state=content_state( + title="Reactivation", + message="Lumen came back after 2 weeks", + type="alert", + icon=alert_icon("cloud.sun", color="yellow"), + badge=alert_badge("Customer", color="magenta"), + ), +) +``` + #### Metrics ![Metrics Live Activity stream example](https://cdn.activitysmith.com/features/metrics-live-activity-start.png) @@ -241,23 +268,6 @@ activitysmith.live_activities.stream( ) ``` -#### Alert - -![Alert Live Activity stream example](https://cdn.activitysmith.com/features/alert-live-activity.png) - -```python -activitysmith.live_activities.stream( - "customer-ops", - content_state=content_state( - title="Reactivation", - message="Lumen came back after 2 weeks", - type="alert", - icon=alert_icon("cloud.sun", color="yellow"), - badge=alert_badge("Customer", color="magenta"), - ), -) -``` - #### Timer ![Timer Live Activity stream example](https://cdn.activitysmith.com/features/timer-live-activity.png) @@ -305,7 +315,7 @@ Add more context to Live Activities with icons and badges. #### Icon -Supported Live Activity types: `stats`, `metrics`, `progress`, `segmented_progress`, `alert`, and `timer`. +Supported Live Activity types: `value`, `stats`, `alert`, `metrics`, `segmented_progress`, `progress`, and `timer`. ![Metrics Live Activity with an SF Symbol icon on the iPhone Lock Screen](https://cdn.activitysmith.com/features/metrics-live-activity-with-icon.png) @@ -333,7 +343,7 @@ The `icon.symbol` value is an Apple SF Symbol name. Browse the catalog with one #### Badge -Badges are supported by `alert`, `progress`, and `segmented_progress` Live Activities. +Badges are supported by `value`, `alert`, `segmented_progress`, and `progress` Live Activities. ![Progress Live Activity with a badge on the iPhone Lock Screen](https://cdn.activitysmith.com/features/progress-live-activity-with-badge.png) @@ -445,7 +455,7 @@ activitysmith.live_activities.stream( Use `secondary_action` when you want a second button beside the primary `action`. -The secondary action button is supported for `alert`, `progress`, and `segmented_progress` Live Activities. Both buttons use the same `open_url`, `webhook`, and Apple Shortcut payload shapes. +The secondary action button is supported for `value`, `alert`, `segmented_progress`, and `progress` Live Activities. Both buttons use the same `open_url`, `webhook`, and Apple Shortcut payload shapes. ```python activitysmith.live_activities.stream( @@ -608,3 +618,7 @@ Wrap API calls with `try/except`. The SDK raises exceptions for non-2xx response ### [PyPI Package](https://pypi.org/project/activitysmith/) Install the ActivitySmith Python SDK from PyPI + +### [Source Code](https://github.com/ActivitySmithHQ/activitysmith-python) + +View the Python SDK source on GitHub diff --git a/activitysmith/client.py b/activitysmith/client.py index 8493c3e..07187f4 100644 --- a/activitysmith/client.py +++ b/activitysmith/client.py @@ -16,7 +16,7 @@ from .normalization import normalize_live_activity_request, normalize_metric_request -SDK_VERSION = "1.11.0" +SDK_VERSION = "1.12.0" SDK_HEADER_NAME = "X-ActivitySmith-SDK" SDK_HEADER_VALUE = f"python-v{SDK_VERSION}" @@ -175,7 +175,7 @@ def content_state( number_of_steps: int | None = None, current_step: int | None = None, percentage: int | float | None = None, - value: int | float | None = None, + value: str | int | float | None = None, upper_limit: int | float | None = None, duration_seconds: int | float | None = None, counts_down: bool | None = None, @@ -421,6 +421,7 @@ class LiveActivitiesResource: TYPE_STATS = "stats" TYPE_ALERT = "alert" TYPE_TIMER = "timer" + TYPE_VALUE = "value" def __init__(self, api: LiveActivitiesApi) -> None: self._api = api diff --git a/activitysmith/normalization.py b/activitysmith/normalization.py index 2e4ead7..7256eb9 100644 --- a/activitysmith/normalization.py +++ b/activitysmith/normalization.py @@ -1,5 +1,6 @@ """Adapt plain values to the generated client's union models.""" from typing import Any +from activitysmith_openapi.models.live_activity_value import LiveActivityValue from activitysmith_openapi.models.activity_metric_value import ActivityMetricValue from activitysmith_openapi.models.metric_value_update_request_value import MetricValueUpdateRequestValue @@ -22,7 +23,12 @@ def normalize_live_activity_request(request: Any) -> Any: if not isinstance(request, dict): return request state = request.get("content_state") - if not isinstance(state, dict) or not isinstance(state.get("metrics"), (list, tuple)): + if not isinstance(state, dict): + return request + if "value" in state: + state = {**state, "value": _wrap_value(state["value"], LiveActivityValue)} + request = {**request, "content_state": state} + if not isinstance(state.get("metrics"), (list, tuple)): return request metrics = [] for metric in state["metrics"]: diff --git a/activitysmith_openapi/__init__.py b/activitysmith_openapi/__init__.py index b094dd5..be074a0 100644 --- a/activitysmith_openapi/__init__.py +++ b/activitysmith_openapi/__init__.py @@ -14,7 +14,7 @@ """ # noqa: E501 -__version__ = "1.11.0" +__version__ = "1.12.0" # import apis into sdk package from activitysmith_openapi.api.app_icon_badges_api import AppIconBadgesApi diff --git a/activitysmith_openapi/api_client.py b/activitysmith_openapi/api_client.py index cd1a411..0b0e3ef 100644 --- a/activitysmith_openapi/api_client.py +++ b/activitysmith_openapi/api_client.py @@ -88,7 +88,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.11.0/python' + self.user_agent = 'OpenAPI-Generator/1.12.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/activitysmith_openapi/configuration.py b/activitysmith_openapi/configuration.py index d1c9eda..541b52f 100644 --- a/activitysmith_openapi/configuration.py +++ b/activitysmith_openapi/configuration.py @@ -400,7 +400,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 1.0.0\n"\ - "SDK Package Version: 1.11.0".\ + "SDK Package Version: 1.12.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/pyproject.toml b/pyproject.toml index 60aeeff..4501f59 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "activitysmith" -version = "1.11.0" +version = "1.12.0" description = "Official ActivitySmith Python SDK" readme = "README.md" requires-python = ">=3.9" diff --git a/tests/test_value_serialization.py b/tests/test_value_serialization.py index b4aa215..9c62212 100644 --- a/tests/test_value_serialization.py +++ b/tests/test_value_serialization.py @@ -142,3 +142,25 @@ def test_end_stream_tags(requests, tags): if tags is not None: assert requests[-1]["tags"] == tags assert requests[-1]["metadata"] == {} + + +@pytest.mark.parametrize("value", ["$1,240", "0007", "", 0, -12.75]) +@pytest.mark.parametrize("method", ["start", "update", "end", "stream", "end_stream"]) +@pytest.mark.parametrize("form", ["dict", "named", "helper"]) +def test_prominent_value_serializes_without_losing_format(requests, value, method, form): + activitysmith = ActivitySmith(api_key="test") + state = content_state("Revenue", type="value", value=value) + request = {"content_state": state} + if method in ("update", "end"): + request["activity_id"] = "activity-1" + args = ["revenue"] if method in ("stream", "end_stream") else [] + with pytest.raises(RequestCaptured): + if form == "named": + kwargs = dict(state) + if method in ("update", "end"): + kwargs["activity_id"] = "activity-1" + getattr(activitysmith.live_activities, method)(*args, **kwargs) + else: + getattr(activitysmith.live_activities, method)(*args, request) + assert requests[-1]["content_state"]["value"] == value + assert isinstance(requests[-1]["content_state"]["value"], str) == isinstance(value, str)