From f76c6cd3ec05e12b9f01ebe0996a860d18b1c190 Mon Sep 17 00:00:00 2001 From: activitysmith-bot Date: Tue, 15 Sep 2026 13:11:12 +0000 Subject: [PATCH] chore: regenerate SDK --- activitysmith_openapi/__init__.py | 3 + .../api/app_icon_badges_api.py | 9 +- activitysmith_openapi/configuration.py | 7 + .../docs/AppIconBadgeCountUpdateError.md | 37 ++++ .../docs/AppIconBadgeCountUpdateResponse.md | 6 +- .../docs/AppIconBadgesApi.md | 3 +- .../docs/LiveActivityEndRequest.md | 2 + .../docs/LiveActivityLimitError.md | 4 +- .../docs/LiveActivityStartRequest.md | 1 + .../docs/LiveActivityStreamDeleteRequest.md | 2 + .../docs/LiveActivityStreamRequest.md | 1 + .../docs/LiveActivityUpdateRequest.md | 2 + activitysmith_openapi/docs/MetadataValue.md | 28 +++ .../docs/PushNotificationAction.md | 2 +- .../docs/PushNotificationRequest.md | 3 +- .../docs/SendPushNotification429Response.md | 4 +- .../UpdateAppIconBadgeCount422Response.md | 37 ++++ activitysmith_openapi/models/__init__.py | 3 + .../app_icon_badge_count_update_error.py | 111 ++++++++++++ .../app_icon_badge_count_update_response.py | 12 +- .../models/live_activity_end_request.py | 20 ++- .../models/live_activity_limit_error.py | 12 +- .../models/live_activity_start_request.py | 17 +- .../live_activity_stream_delete_request.py | 22 ++- .../models/live_activity_stream_request.py | 17 +- .../models/live_activity_update_request.py | 20 ++- .../models/metadata_value.py | 161 ++++++++++++++++++ .../models/push_notification_action.py | 2 +- .../models/push_notification_request.py | 23 ++- ...update_app_icon_badge_count422_response.py | 137 +++++++++++++++ activitysmith_openapi/openapi-source.json | 6 + .../test_app_icon_badge_count_update_error.py | 66 +++++++ ...st_app_icon_badge_count_update_response.py | 6 +- .../test/test_live_activity_end_request.py | 6 + .../test/test_live_activity_limit_error.py | 4 +- .../test/test_live_activity_start_request.py | 3 + ...est_live_activity_stream_delete_request.py | 6 + .../test/test_live_activity_stream_request.py | 3 + .../test/test_live_activity_update_request.py | 6 + .../test/test_metadata_value.py | 50 ++++++ .../test/test_push_notification_request.py | 5 +- ...test_send_push_notification429_response.py | 4 +- ...update_app_icon_badge_count422_response.py | 66 +++++++ 43 files changed, 905 insertions(+), 34 deletions(-) create mode 100644 activitysmith_openapi/docs/AppIconBadgeCountUpdateError.md create mode 100644 activitysmith_openapi/docs/MetadataValue.md create mode 100644 activitysmith_openapi/docs/UpdateAppIconBadgeCount422Response.md create mode 100644 activitysmith_openapi/models/app_icon_badge_count_update_error.py create mode 100644 activitysmith_openapi/models/metadata_value.py create mode 100644 activitysmith_openapi/models/update_app_icon_badge_count422_response.py create mode 100644 activitysmith_openapi/openapi-source.json create mode 100644 activitysmith_openapi/test/test_app_icon_badge_count_update_error.py create mode 100644 activitysmith_openapi/test/test_metadata_value.py create mode 100644 activitysmith_openapi/test/test_update_app_icon_badge_count422_response.py diff --git a/activitysmith_openapi/__init__.py b/activitysmith_openapi/__init__.py index 6c01606..5768936 100644 --- a/activitysmith_openapi/__init__.py +++ b/activitysmith_openapi/__init__.py @@ -37,6 +37,7 @@ from activitysmith_openapi.models.activity_metric import ActivityMetric from activitysmith_openapi.models.activity_metric_value import ActivityMetricValue from activitysmith_openapi.models.alert_payload import AlertPayload +from activitysmith_openapi.models.app_icon_badge_count_update_error import AppIconBadgeCountUpdateError from activitysmith_openapi.models.app_icon_badge_count_update_request import AppIconBadgeCountUpdateRequest from activitysmith_openapi.models.app_icon_badge_count_update_response import AppIconBadgeCountUpdateResponse from activitysmith_openapi.models.bad_request_error import BadRequestError @@ -62,6 +63,7 @@ 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_webhook_method import LiveActivityWebhookMethod +from activitysmith_openapi.models.metadata_value import MetadataValue from activitysmith_openapi.models.metric_error import MetricError from activitysmith_openapi.models.metric_value_update_request import MetricValueUpdateRequest from activitysmith_openapi.models.metric_value_update_request_value import MetricValueUpdateRequestValue @@ -76,3 +78,4 @@ from activitysmith_openapi.models.rate_limit_error import RateLimitError from activitysmith_openapi.models.send_push_notification429_response import SendPushNotification429Response from activitysmith_openapi.models.stream_content_state import StreamContentState +from activitysmith_openapi.models.update_app_icon_badge_count422_response import UpdateAppIconBadgeCount422Response diff --git a/activitysmith_openapi/api/app_icon_badges_api.py b/activitysmith_openapi/api/app_icon_badges_api.py index 29d22f6..e832526 100644 --- a/activitysmith_openapi/api/app_icon_badges_api.py +++ b/activitysmith_openapi/api/app_icon_badges_api.py @@ -94,7 +94,8 @@ def update_app_icon_badge_count( '200': "AppIconBadgeCountUpdateResponse", '400': "BadRequestError", '403': "ForbiddenError", - '404': "NoRecipientsError", + '422': "UpdateAppIconBadgeCount422Response", + '502': "AppIconBadgeCountUpdateError", '429': "RateLimitError", } response_data = self.api_client.call_api( @@ -165,7 +166,8 @@ def update_app_icon_badge_count_with_http_info( '200': "AppIconBadgeCountUpdateResponse", '400': "BadRequestError", '403': "ForbiddenError", - '404': "NoRecipientsError", + '422': "UpdateAppIconBadgeCount422Response", + '502': "AppIconBadgeCountUpdateError", '429': "RateLimitError", } response_data = self.api_client.call_api( @@ -236,7 +238,8 @@ def update_app_icon_badge_count_without_preload_content( '200': "AppIconBadgeCountUpdateResponse", '400': "BadRequestError", '403': "ForbiddenError", - '404': "NoRecipientsError", + '422': "UpdateAppIconBadgeCount422Response", + '502': "AppIconBadgeCountUpdateError", '429': "RateLimitError", } response_data = self.api_client.call_api( diff --git a/activitysmith_openapi/configuration.py b/activitysmith_openapi/configuration.py index 4d3acda..28e3460 100644 --- a/activitysmith_openapi/configuration.py +++ b/activitysmith_openapi/configuration.py @@ -382,6 +382,13 @@ def auth_settings(self): 'key': 'Authorization', 'value': 'Bearer ' + self.access_token } + if self.access_token is not None: + auth['mcpOAuth'] = { + 'type': 'oauth2', + 'in': 'header', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + } return auth def to_debug_report(self): diff --git a/activitysmith_openapi/docs/AppIconBadgeCountUpdateError.md b/activitysmith_openapi/docs/AppIconBadgeCountUpdateError.md new file mode 100644 index 0000000..8aec0cf --- /dev/null +++ b/activitysmith_openapi/docs/AppIconBadgeCountUpdateError.md @@ -0,0 +1,37 @@ +# AppIconBadgeCountUpdateError + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | | +**code** | **str** | | +**message** | **str** | | +**badge** | **int** | | +**devices_targeted** | **int** | | [optional] +**devices_updated** | **int** | | +**users_updated** | **int** | | [optional] +**devices_notified** | **int** | Deprecated compatibility alias for devices_updated. | [optional] +**effective_channel_slugs** | **List[str]** | | [optional] + +## Example + +```python +from activitysmith_openapi.models.app_icon_badge_count_update_error import AppIconBadgeCountUpdateError + +# TODO update the JSON string below +json = "{}" +# create an instance of AppIconBadgeCountUpdateError from a JSON string +app_icon_badge_count_update_error_instance = AppIconBadgeCountUpdateError.from_json(json) +# print the JSON string representation of the object +print(AppIconBadgeCountUpdateError.to_json()) + +# convert the object into a dict +app_icon_badge_count_update_error_dict = app_icon_badge_count_update_error_instance.to_dict() +# create an instance of AppIconBadgeCountUpdateError from a dict +app_icon_badge_count_update_error_from_dict = AppIconBadgeCountUpdateError.from_dict(app_icon_badge_count_update_error_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/AppIconBadgeCountUpdateResponse.md b/activitysmith_openapi/docs/AppIconBadgeCountUpdateResponse.md index 74dd986..072e90e 100644 --- a/activitysmith_openapi/docs/AppIconBadgeCountUpdateResponse.md +++ b/activitysmith_openapi/docs/AppIconBadgeCountUpdateResponse.md @@ -7,8 +7,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **success** | **bool** | | **badge** | **int** | | -**devices_notified** | **int** | | -**users_notified** | **int** | | +**devices_updated** | **int** | Number of devices whose App Icon Badge Count was updated. | +**users_updated** | **int** | Number of account users with at least one updated device. | +**devices_notified** | **int** | Deprecated compatibility alias for devices_updated. | [optional] +**users_notified** | **int** | Deprecated compatibility alias for users_updated. | [optional] **effective_channel_slugs** | **List[str]** | | **timestamp** | **datetime** | | diff --git a/activitysmith_openapi/docs/AppIconBadgesApi.md b/activitysmith_openapi/docs/AppIconBadgesApi.md index 6ae3264..76505cf 100644 --- a/activitysmith_openapi/docs/AppIconBadgesApi.md +++ b/activitysmith_openapi/docs/AppIconBadgesApi.md @@ -85,7 +85,8 @@ Name | Type | Description | Notes **200** | App Icon Badge Count updated | - | **400** | Bad request | - | **403** | Forbidden | - | -**404** | No recipients found for effective channel target | - | +**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 | - | [[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/LiveActivityEndRequest.md b/activitysmith_openapi/docs/LiveActivityEndRequest.md index 94f4fa6..c723061 100644 --- a/activitysmith_openapi/docs/LiveActivityEndRequest.md +++ b/activitysmith_openapi/docs/LiveActivityEndRequest.md @@ -6,7 +6,9 @@ End an existing Live Activity by activity_id. 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] **activity_id** | **str** | | +**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] diff --git a/activitysmith_openapi/docs/LiveActivityLimitError.md b/activitysmith_openapi/docs/LiveActivityLimitError.md index d661fc6..25cb51a 100644 --- a/activitysmith_openapi/docs/LiveActivityLimitError.md +++ b/activitysmith_openapi/docs/LiveActivityLimitError.md @@ -8,7 +8,9 @@ Name | Type | Description | Notes **error** | **str** | | **message** | **str** | | **limit** | **int** | | -**active** | **int** | Current number of active Live Activities. | +**active** | **int** | Highest number of active Live Activities among the targeted devices. | +**blocked_devices** | **int** | Number of targeted devices that have reached the enforced iOS Live Activity concurrency threshold. Included only when targeted devices have mixed capacity. | [optional] +**targeted_devices** | **int** | Total number of targeted devices. Included only when targeted devices have mixed capacity. | [optional] ## Example diff --git a/activitysmith_openapi/docs/LiveActivityStartRequest.md b/activitysmith_openapi/docs/LiveActivityStartRequest.md index 914e655..f8b8e7d 100644 --- a/activitysmith_openapi/docs/LiveActivityStartRequest.md +++ b/activitysmith_openapi/docs/LiveActivityStartRequest.md @@ -6,6 +6,7 @@ Start a new Live Activity. The response includes activity_id for later update an 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] diff --git a/activitysmith_openapi/docs/LiveActivityStreamDeleteRequest.md b/activitysmith_openapi/docs/LiveActivityStreamDeleteRequest.md index bde073d..d1d068a 100644 --- a/activitysmith_openapi/docs/LiveActivityStreamDeleteRequest.md +++ b/activitysmith_openapi/docs/LiveActivityStreamDeleteRequest.md @@ -6,6 +6,8 @@ Optional payload for ending a managed stream. When omitted, ActivitySmith ends t 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] +**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] diff --git a/activitysmith_openapi/docs/LiveActivityStreamRequest.md b/activitysmith_openapi/docs/LiveActivityStreamRequest.md index 2aba012..2df7c2a 100644 --- a/activitysmith_openapi/docs/LiveActivityStreamRequest.md +++ b/activitysmith_openapi/docs/LiveActivityStreamRequest.md @@ -6,6 +6,7 @@ Send the latest state for a managed Live Activity stream. channels is the stream 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] diff --git a/activitysmith_openapi/docs/LiveActivityUpdateRequest.md b/activitysmith_openapi/docs/LiveActivityUpdateRequest.md index 1144734..e579170 100644 --- a/activitysmith_openapi/docs/LiveActivityUpdateRequest.md +++ b/activitysmith_openapi/docs/LiveActivityUpdateRequest.md @@ -6,7 +6,9 @@ Update an existing Live Activity by activity_id. 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] **activity_id** | **str** | | +**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] diff --git a/activitysmith_openapi/docs/MetadataValue.md b/activitysmith_openapi/docs/MetadataValue.md new file mode 100644 index 0000000..d7e08ed --- /dev/null +++ b/activitysmith_openapi/docs/MetadataValue.md @@ -0,0 +1,28 @@ +# MetadataValue + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from activitysmith_openapi.models.metadata_value import MetadataValue + +# TODO update the JSON string below +json = "{}" +# create an instance of MetadataValue from a JSON string +metadata_value_instance = MetadataValue.from_json(json) +# print the JSON string representation of the object +print(MetadataValue.to_json()) + +# convert the object into a dict +metadata_value_dict = metadata_value_instance.to_dict() +# create an instance of MetadataValue from a dict +metadata_value_from_dict = MetadataValue.from_dict(metadata_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/PushNotificationAction.md b/activitysmith_openapi/docs/PushNotificationAction.md index a47961f..b1569fd 100644 --- a/activitysmith_openapi/docs/PushNotificationAction.md +++ b/activitysmith_openapi/docs/PushNotificationAction.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **title** | **str** | Button title displayed in iOS expanded notification UI. | **type** | [**PushNotificationActionType**](PushNotificationActionType.md) | | -**url** | **str** | Action URL. For open_url, use an HTTP or HTTPS URL or a shortcuts://run-shortcut?name=... URL that runs a specific iPhone Shortcut. For webhook, use an HTTPS URL called by the ActivitySmith backend. | +**url** | **str** | Action URL. For open_url, use HTTP, HTTPS, Shortcuts, or an installed app’s custom URL scheme, such as spotify:// or spotify:track:123. Custom app schemes require iOS 1.13.4 build 2 or later; no web fallback is provided. Internal and executable schemes are blocked. For webhook, use an HTTPS URL called by the ActivitySmith backend. | **method** | [**PushNotificationWebhookMethod**](PushNotificationWebhookMethod.md) | Webhook HTTP method. Used only when type=webhook. | [optional] [default to PushNotificationWebhookMethod.POST] **body** | **object** | Optional webhook payload body. Used only when type=webhook. | [optional] diff --git a/activitysmith_openapi/docs/PushNotificationRequest.md b/activitysmith_openapi/docs/PushNotificationRequest.md index aa6611c..1c45c9e 100644 --- a/activitysmith_openapi/docs/PushNotificationRequest.md +++ b/activitysmith_openapi/docs/PushNotificationRequest.md @@ -5,11 +5,12 @@ 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] **title** | **str** | | **message** | **str** | | [optional] **subtitle** | **str** | | [optional] **media** | **str** | Optional HTTPS URL for an image, audio file, or video that users can preview or play when they expand the notification. If `redirection` is omitted, tapping the notification opens this URL. Cannot be combined with `actions`. | [optional] -**redirection** | **str** | Optional HTTP URL, HTTPS URL, or shortcuts://run-shortcut?name=... URL opened when the user taps the notification body. Use shortcuts://run-shortcut?name=... to run a specific iPhone Shortcut that already exists on the user's device. Overrides the default tap target from `media` when both are provided. | [optional] +**redirection** | **str** | Optional HTTP, HTTPS, Shortcuts, or installed app URL opened when the user taps the notification body. Custom schemes such as spotify:// and spotify:track:123 require iOS 1.13.4 build 2 or later and an installed handler; no web fallback is provided. Internal and executable schemes are blocked. Overrides the default tap target from media. | [optional] **actions** | [**List[PushNotificationAction]**](PushNotificationAction.md) | Optional interactive actions shown when users expand the notification. Cannot be combined with `media`. | [optional] **payload** | **object** | | [optional] **badge** | **int** | | [optional] diff --git a/activitysmith_openapi/docs/SendPushNotification429Response.md b/activitysmith_openapi/docs/SendPushNotification429Response.md index e1738e1..b4847aa 100644 --- a/activitysmith_openapi/docs/SendPushNotification429Response.md +++ b/activitysmith_openapi/docs/SendPushNotification429Response.md @@ -8,7 +8,9 @@ Name | Type | Description | Notes **error** | **str** | | **message** | **str** | | **limit** | **int** | | -**active** | **int** | Current number of active Live Activities. | +**active** | **int** | Highest number of active Live Activities among the targeted devices. | +**blocked_devices** | **int** | Number of targeted devices that have reached the enforced iOS Live Activity concurrency threshold. Included only when targeted devices have mixed capacity. | [optional] +**targeted_devices** | **int** | Total number of targeted devices. Included only when targeted devices have mixed capacity. | [optional] ## Example diff --git a/activitysmith_openapi/docs/UpdateAppIconBadgeCount422Response.md b/activitysmith_openapi/docs/UpdateAppIconBadgeCount422Response.md new file mode 100644 index 0000000..f7cbbfe --- /dev/null +++ b/activitysmith_openapi/docs/UpdateAppIconBadgeCount422Response.md @@ -0,0 +1,37 @@ +# UpdateAppIconBadgeCount422Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | | +**message** | **str** | | +**effective_channel_slugs** | **List[str]** | | [optional] +**code** | **str** | | +**badge** | **int** | | +**devices_targeted** | **int** | | [optional] +**devices_updated** | **int** | | +**users_updated** | **int** | | [optional] +**devices_notified** | **int** | Deprecated compatibility alias for devices_updated. | [optional] + +## Example + +```python +from activitysmith_openapi.models.update_app_icon_badge_count422_response import UpdateAppIconBadgeCount422Response + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateAppIconBadgeCount422Response from a JSON string +update_app_icon_badge_count422_response_instance = UpdateAppIconBadgeCount422Response.from_json(json) +# print the JSON string representation of the object +print(UpdateAppIconBadgeCount422Response.to_json()) + +# convert the object into a dict +update_app_icon_badge_count422_response_dict = update_app_icon_badge_count422_response_instance.to_dict() +# create an instance of UpdateAppIconBadgeCount422Response from a dict +update_app_icon_badge_count422_response_from_dict = UpdateAppIconBadgeCount422Response.from_dict(update_app_icon_badge_count422_response_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/models/__init__.py b/activitysmith_openapi/models/__init__.py index b9576c7..0f8f506 100644 --- a/activitysmith_openapi/models/__init__.py +++ b/activitysmith_openapi/models/__init__.py @@ -17,6 +17,7 @@ from activitysmith_openapi.models.activity_metric import ActivityMetric from activitysmith_openapi.models.activity_metric_value import ActivityMetricValue from activitysmith_openapi.models.alert_payload import AlertPayload +from activitysmith_openapi.models.app_icon_badge_count_update_error import AppIconBadgeCountUpdateError from activitysmith_openapi.models.app_icon_badge_count_update_request import AppIconBadgeCountUpdateRequest from activitysmith_openapi.models.app_icon_badge_count_update_response import AppIconBadgeCountUpdateResponse from activitysmith_openapi.models.bad_request_error import BadRequestError @@ -42,6 +43,7 @@ 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_webhook_method import LiveActivityWebhookMethod +from activitysmith_openapi.models.metadata_value import MetadataValue from activitysmith_openapi.models.metric_error import MetricError from activitysmith_openapi.models.metric_value_update_request import MetricValueUpdateRequest from activitysmith_openapi.models.metric_value_update_request_value import MetricValueUpdateRequestValue @@ -56,3 +58,4 @@ from activitysmith_openapi.models.rate_limit_error import RateLimitError from activitysmith_openapi.models.send_push_notification429_response import SendPushNotification429Response from activitysmith_openapi.models.stream_content_state import StreamContentState +from activitysmith_openapi.models.update_app_icon_badge_count422_response import UpdateAppIconBadgeCount422Response diff --git a/activitysmith_openapi/models/app_icon_badge_count_update_error.py b/activitysmith_openapi/models/app_icon_badge_count_update_error.py new file mode 100644 index 0000000..0b9c9c7 --- /dev/null +++ b/activitysmith_openapi/models/app_icon_badge_count_update_error.py @@ -0,0 +1,111 @@ +# 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 pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class AppIconBadgeCountUpdateError(BaseModel): + """ + AppIconBadgeCountUpdateError + """ # noqa: E501 + error: StrictStr + code: StrictStr + message: StrictStr + badge: Annotated[int, Field(le=2147483647, strict=True, ge=0)] + devices_targeted: Optional[StrictInt] = None + devices_updated: StrictInt + users_updated: Optional[StrictInt] = None + devices_notified: Optional[StrictInt] = Field(default=None, description="Deprecated compatibility alias for devices_updated.") + effective_channel_slugs: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["error", "code", "message", "badge", "devices_targeted", "devices_updated", "users_updated", "devices_notified", "effective_channel_slugs"] + + @field_validator('code') + def code_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['badge_device_disconnected', 'badge_update_failed']): + raise ValueError("must be one of enum values ('badge_device_disconnected', 'badge_update_failed')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AppIconBadgeCountUpdateError from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AppIconBadgeCountUpdateError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "error": obj.get("error"), + "code": obj.get("code"), + "message": obj.get("message"), + "badge": obj.get("badge"), + "devices_targeted": obj.get("devices_targeted"), + "devices_updated": obj.get("devices_updated"), + "users_updated": obj.get("users_updated"), + "devices_notified": obj.get("devices_notified"), + "effective_channel_slugs": obj.get("effective_channel_slugs") + }) + return _obj + + diff --git a/activitysmith_openapi/models/app_icon_badge_count_update_response.py b/activitysmith_openapi/models/app_icon_badge_count_update_response.py index 4818c20..e0582ba 100644 --- a/activitysmith_openapi/models/app_icon_badge_count_update_response.py +++ b/activitysmith_openapi/models/app_icon_badge_count_update_response.py @@ -19,7 +19,7 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List +from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self @@ -30,11 +30,13 @@ class AppIconBadgeCountUpdateResponse(BaseModel): """ # noqa: E501 success: StrictBool badge: Annotated[int, Field(le=2147483647, strict=True, ge=0)] - devices_notified: StrictInt - users_notified: StrictInt + devices_updated: StrictInt = Field(description="Number of devices whose App Icon Badge Count was updated.") + users_updated: StrictInt = Field(description="Number of account users with at least one updated device.") + devices_notified: Optional[StrictInt] = Field(default=None, description="Deprecated compatibility alias for devices_updated.") + users_notified: Optional[StrictInt] = Field(default=None, description="Deprecated compatibility alias for users_updated.") effective_channel_slugs: List[StrictStr] timestamp: datetime - __properties: ClassVar[List[str]] = ["success", "badge", "devices_notified", "users_notified", "effective_channel_slugs", "timestamp"] + __properties: ClassVar[List[str]] = ["success", "badge", "devices_updated", "users_updated", "devices_notified", "users_notified", "effective_channel_slugs", "timestamp"] model_config = ConfigDict( populate_by_name=True, @@ -89,6 +91,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "success": obj.get("success"), "badge": obj.get("badge"), + "devices_updated": obj.get("devices_updated"), + "users_updated": obj.get("users_updated"), "devices_notified": obj.get("devices_notified"), "users_notified": obj.get("users_notified"), "effective_channel_slugs": obj.get("effective_channel_slugs"), diff --git a/activitysmith_openapi/models/live_activity_end_request.py b/activitysmith_openapi/models/live_activity_end_request.py index d9da0dd..4b9d75c 100644 --- a/activitysmith_openapi/models/live_activity_end_request.py +++ b/activitysmith_openapi/models/live_activity_end_request.py @@ -19,8 +19,10 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from activitysmith_openapi.models.content_state_end import ContentStateEnd from activitysmith_openapi.models.live_activity_action import LiveActivityAction +from activitysmith_openapi.models.metadata_value import MetadataValue from typing import Optional, Set from typing_extensions import Self @@ -28,11 +30,13 @@ class LiveActivityEndRequest(BaseModel): """ End an existing Live Activity by activity_id. """ # noqa: E501 + 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.") activity_id: StrictStr + 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.") - __properties: ClassVar[List[str]] = ["activity_id", "content_state", "action", "secondary_action"] + __properties: ClassVar[List[str]] = ["metadata", "activity_id", "tags", "content_state", "action", "secondary_action"] model_config = ConfigDict( populate_by_name=True, @@ -73,6 +77,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each value in metadata (dict) + _field_dict = {} + if self.metadata: + for _key in self.metadata: + if self.metadata[_key]: + _field_dict[_key] = self.metadata[_key].to_dict() + _dict['metadata'] = _field_dict # override the default output from pydantic by calling `to_dict()` of content_state if self.content_state: _dict['content_state'] = self.content_state.to_dict() @@ -94,7 +105,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "metadata": dict( + (_k, MetadataValue.from_dict(_v)) + for _k, _v in obj["metadata"].items() + ) + if obj.get("metadata") is not None + else None, "activity_id": obj.get("activity_id"), + "tags": obj.get("tags"), "content_state": ContentStateEnd.from_dict(obj["content_state"]) if obj.get("content_state") is not None else None, "action": LiveActivityAction.from_dict(obj["action"]) if obj.get("action") is not None else None, "secondary_action": LiveActivityAction.from_dict(obj["secondary_action"]) if obj.get("secondary_action") is not None else None diff --git a/activitysmith_openapi/models/live_activity_limit_error.py b/activitysmith_openapi/models/live_activity_limit_error.py index f33b7e4..e3862e1 100644 --- a/activitysmith_openapi/models/live_activity_limit_error.py +++ b/activitysmith_openapi/models/live_activity_limit_error.py @@ -18,7 +18,7 @@ import json from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List +from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -29,8 +29,10 @@ class LiveActivityLimitError(BaseModel): error: StrictStr message: StrictStr limit: StrictInt - active: StrictInt = Field(description="Current number of active Live Activities.") - __properties: ClassVar[List[str]] = ["error", "message", "limit", "active"] + active: StrictInt = Field(description="Highest number of active Live Activities among the targeted devices.") + blocked_devices: Optional[StrictInt] = Field(default=None, description="Number of targeted devices that have reached the enforced iOS Live Activity concurrency threshold. Included only when targeted devices have mixed capacity.") + targeted_devices: Optional[StrictInt] = Field(default=None, description="Total number of targeted devices. Included only when targeted devices have mixed capacity.") + __properties: ClassVar[List[str]] = ["error", "message", "limit", "active", "blocked_devices", "targeted_devices"] model_config = ConfigDict( populate_by_name=True, @@ -86,7 +88,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "error": obj.get("error"), "message": obj.get("message"), "limit": obj.get("limit"), - "active": obj.get("active") + "active": obj.get("active"), + "blocked_devices": obj.get("blocked_devices"), + "targeted_devices": obj.get("targeted_devices") }) return _obj diff --git a/activitysmith_openapi/models/live_activity_start_request.py b/activitysmith_openapi/models/live_activity_start_request.py index 64ad780..1197184 100644 --- a/activitysmith_openapi/models/live_activity_start_request.py +++ b/activitysmith_openapi/models/live_activity_start_request.py @@ -24,6 +24,7 @@ from activitysmith_openapi.models.channel_target import ChannelTarget from activitysmith_openapi.models.content_state_start import ContentStateStart from activitysmith_openapi.models.live_activity_action import LiveActivityAction +from activitysmith_openapi.models.metadata_value import MetadataValue from typing import Optional, Set from typing_extensions import Self @@ -31,13 +32,14 @@ class LiveActivityStartRequest(BaseModel): """ Start a new Live Activity. The response includes activity_id for later update and end calls. """ # noqa: E501 + 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.") 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.") - __properties: ClassVar[List[str]] = ["content_state", "action", "secondary_action", "alert", "target", "tags"] + __properties: ClassVar[List[str]] = ["metadata", "content_state", "action", "secondary_action", "alert", "target", "tags"] model_config = ConfigDict( populate_by_name=True, @@ -78,6 +80,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each value in metadata (dict) + _field_dict = {} + if self.metadata: + for _key in self.metadata: + if self.metadata[_key]: + _field_dict[_key] = self.metadata[_key].to_dict() + _dict['metadata'] = _field_dict # override the default output from pydantic by calling `to_dict()` of content_state if self.content_state: _dict['content_state'] = self.content_state.to_dict() @@ -105,6 +114,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "metadata": dict( + (_k, MetadataValue.from_dict(_v)) + for _k, _v in obj["metadata"].items() + ) + if obj.get("metadata") is not None + else None, "content_state": ContentStateStart.from_dict(obj["content_state"]) if obj.get("content_state") is not None else None, "action": LiveActivityAction.from_dict(obj["action"]) if obj.get("action") is not None else None, "secondary_action": LiveActivityAction.from_dict(obj["secondary_action"]) if obj.get("secondary_action") is not None else None, diff --git a/activitysmith_openapi/models/live_activity_stream_delete_request.py b/activitysmith_openapi/models/live_activity_stream_delete_request.py index 8edb49c..b47c57b 100644 --- a/activitysmith_openapi/models/live_activity_stream_delete_request.py +++ b/activitysmith_openapi/models/live_activity_stream_delete_request.py @@ -17,10 +17,12 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field +from pydantic import BaseModel, ConfigDict, Field, field_validator from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from activitysmith_openapi.models.alert_payload import AlertPayload from activitysmith_openapi.models.live_activity_action import LiveActivityAction +from activitysmith_openapi.models.metadata_value import MetadataValue from activitysmith_openapi.models.stream_content_state import StreamContentState from typing import Optional, Set from typing_extensions import Self @@ -29,11 +31,13 @@ class LiveActivityStreamDeleteRequest(BaseModel): """ Optional payload for ending a managed stream. When omitted, ActivitySmith ends the stream using the latest known state when possible. """ # noqa: E501 + 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.") + 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.") alert: Optional[AlertPayload] = None - __properties: ClassVar[List[str]] = ["content_state", "action", "secondary_action", "alert"] + __properties: ClassVar[List[str]] = ["metadata", "tags", "content_state", "action", "secondary_action", "alert"] model_config = ConfigDict( populate_by_name=True, @@ -74,6 +78,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each value in metadata (dict) + _field_dict = {} + if self.metadata: + for _key in self.metadata: + if self.metadata[_key]: + _field_dict[_key] = self.metadata[_key].to_dict() + _dict['metadata'] = _field_dict # override the default output from pydantic by calling `to_dict()` of content_state if self.content_state: _dict['content_state'] = self.content_state.to_dict() @@ -98,6 +109,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "metadata": dict( + (_k, MetadataValue.from_dict(_v)) + for _k, _v in obj["metadata"].items() + ) + if obj.get("metadata") is not None + else None, + "tags": obj.get("tags"), "content_state": StreamContentState.from_dict(obj["content_state"]) if obj.get("content_state") is not None else None, "action": LiveActivityAction.from_dict(obj["action"]) if obj.get("action") is not None else None, "secondary_action": LiveActivityAction.from_dict(obj["secondary_action"]) if obj.get("secondary_action") is not None else None, diff --git a/activitysmith_openapi/models/live_activity_stream_request.py b/activitysmith_openapi/models/live_activity_stream_request.py index 7a2e7c4..3b39cad 100644 --- a/activitysmith_openapi/models/live_activity_stream_request.py +++ b/activitysmith_openapi/models/live_activity_stream_request.py @@ -23,6 +23,7 @@ from activitysmith_openapi.models.alert_payload import AlertPayload from activitysmith_openapi.models.channel_target import ChannelTarget from activitysmith_openapi.models.live_activity_action import LiveActivityAction +from activitysmith_openapi.models.metadata_value import MetadataValue from activitysmith_openapi.models.stream_content_state import StreamContentState from typing import Optional, Set from typing_extensions import Self @@ -31,6 +32,7 @@ class LiveActivityStreamRequest(BaseModel): """ Send the latest state for a managed Live Activity stream. channels is the streamlined form for stream targeting. target.channels is also accepted for compatibility. If both are provided, they must match. """ # noqa: E501 + 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.") @@ -38,7 +40,7 @@ class LiveActivityStreamRequest(BaseModel): 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 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.") - __properties: ClassVar[List[str]] = ["content_state", "action", "secondary_action", "alert", "channels", "target", "tags"] + __properties: ClassVar[List[str]] = ["metadata", "content_state", "action", "secondary_action", "alert", "channels", "target", "tags"] model_config = ConfigDict( populate_by_name=True, @@ -79,6 +81,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each value in metadata (dict) + _field_dict = {} + if self.metadata: + for _key in self.metadata: + if self.metadata[_key]: + _field_dict[_key] = self.metadata[_key].to_dict() + _dict['metadata'] = _field_dict # override the default output from pydantic by calling `to_dict()` of content_state if self.content_state: _dict['content_state'] = self.content_state.to_dict() @@ -106,6 +115,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "metadata": dict( + (_k, MetadataValue.from_dict(_v)) + for _k, _v in obj["metadata"].items() + ) + if obj.get("metadata") is not None + else None, "content_state": StreamContentState.from_dict(obj["content_state"]) if obj.get("content_state") is not None else None, "action": LiveActivityAction.from_dict(obj["action"]) if obj.get("action") is not None else None, "secondary_action": LiveActivityAction.from_dict(obj["secondary_action"]) if obj.get("secondary_action") is not None else None, diff --git a/activitysmith_openapi/models/live_activity_update_request.py b/activitysmith_openapi/models/live_activity_update_request.py index 3ed4911..4c342b9 100644 --- a/activitysmith_openapi/models/live_activity_update_request.py +++ b/activitysmith_openapi/models/live_activity_update_request.py @@ -19,8 +19,10 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from activitysmith_openapi.models.content_state_update import ContentStateUpdate from activitysmith_openapi.models.live_activity_action import LiveActivityAction +from activitysmith_openapi.models.metadata_value import MetadataValue from typing import Optional, Set from typing_extensions import Self @@ -28,11 +30,13 @@ class LiveActivityUpdateRequest(BaseModel): """ Update an existing Live Activity by activity_id. """ # noqa: E501 + 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.") activity_id: StrictStr + 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.") - __properties: ClassVar[List[str]] = ["activity_id", "content_state", "action", "secondary_action"] + __properties: ClassVar[List[str]] = ["metadata", "activity_id", "tags", "content_state", "action", "secondary_action"] model_config = ConfigDict( populate_by_name=True, @@ -73,6 +77,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each value in metadata (dict) + _field_dict = {} + if self.metadata: + for _key in self.metadata: + if self.metadata[_key]: + _field_dict[_key] = self.metadata[_key].to_dict() + _dict['metadata'] = _field_dict # override the default output from pydantic by calling `to_dict()` of content_state if self.content_state: _dict['content_state'] = self.content_state.to_dict() @@ -94,7 +105,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "metadata": dict( + (_k, MetadataValue.from_dict(_v)) + for _k, _v in obj["metadata"].items() + ) + if obj.get("metadata") is not None + else None, "activity_id": obj.get("activity_id"), + "tags": obj.get("tags"), "content_state": ContentStateUpdate.from_dict(obj["content_state"]) if obj.get("content_state") is not None else None, "action": LiveActivityAction.from_dict(obj["action"]) if obj.get("action") is not None else None, "secondary_action": LiveActivityAction.from_dict(obj["secondary_action"]) if obj.get("secondary_action") is not None else None diff --git a/activitysmith_openapi/models/metadata_value.py b/activitysmith_openapi/models/metadata_value.py new file mode 100644 index 0000000..a2053b1 --- /dev/null +++ b/activitysmith_openapi/models/metadata_value.py @@ -0,0 +1,161 @@ +# 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, StrictBool, StrictFloat, StrictInt, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional, Union +from typing_extensions import Annotated +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +METADATAVALUE_ONE_OF_SCHEMAS = ["bool", "float", "str"] + +class MetadataValue(BaseModel): + """ + MetadataValue + """ + # data type: str + oneof_schema_1_validator: Optional[Annotated[str, Field(strict=True, max_length=4000)]] = None + # data type: float + oneof_schema_2_validator: Optional[Union[StrictFloat, StrictInt]] = None + # data type: bool + oneof_schema_3_validator: Optional[StrictBool] = None + actual_instance: Optional[Union[bool, float, str]] = None + one_of_schemas: Set[str] = { "bool", "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 = MetadataValue.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)) + # validate data type: bool + try: + instance.oneof_schema_3_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 MetadataValue with oneOf schemas: bool, float, str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in MetadataValue with oneOf schemas: bool, 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)) + # deserialize data into bool + try: + # validation + instance.oneof_schema_3_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_3_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 MetadataValue with oneOf schemas: bool, float, str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into MetadataValue with oneOf schemas: bool, 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], bool, 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 efd94cd..5af3e5b 100644 --- a/activitysmith_openapi/models/push_notification_action.py +++ b/activitysmith_openapi/models/push_notification_action.py @@ -30,7 +30,7 @@ class PushNotificationAction(BaseModel): """ # noqa: E501 title: StrictStr = Field(description="Button title displayed in iOS expanded notification UI.") type: PushNotificationActionType - url: StrictStr = Field(description="Action URL. For open_url, use an HTTP or HTTPS URL or a shortcuts://run-shortcut?name=... URL that runs a specific iPhone Shortcut. For webhook, use an HTTPS URL called by the ActivitySmith backend.") + url: StrictStr = Field(description="Action URL. For open_url, use HTTP, HTTPS, Shortcuts, or an installed app’s custom URL scheme, such as spotify:// or spotify:track:123. Custom app schemes require iOS 1.13.4 build 2 or later; no web fallback is provided. Internal and executable schemes are blocked. For webhook, use an HTTPS URL called by the ActivitySmith backend.") method: Optional[PushNotificationWebhookMethod] = Field(default=PushNotificationWebhookMethod.POST, description="Webhook HTTP method. Used only when type=webhook.") body: Optional[Dict[str, Any]] = Field(default=None, description="Optional webhook payload body. Used only when type=webhook.") additional_properties: Dict[str, Any] = {} diff --git a/activitysmith_openapi/models/push_notification_request.py b/activitysmith_openapi/models/push_notification_request.py index 4e83ea0..c62d06c 100644 --- a/activitysmith_openapi/models/push_notification_request.py +++ b/activitysmith_openapi/models/push_notification_request.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from activitysmith_openapi.models.channel_target import ChannelTarget +from activitysmith_openapi.models.metadata_value import MetadataValue from activitysmith_openapi.models.push_notification_action import PushNotificationAction from typing import Optional, Set from typing_extensions import Self @@ -29,11 +30,12 @@ class PushNotificationRequest(BaseModel): """ PushNotificationRequest """ # noqa: E501 + 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.") title: StrictStr message: Optional[StrictStr] = None subtitle: Optional[StrictStr] = None media: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Optional HTTPS URL for an image, audio file, or video that users can preview or play when they expand the notification. If `redirection` is omitted, tapping the notification opens this URL. Cannot be combined with `actions`.") - redirection: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Optional HTTP URL, HTTPS URL, or shortcuts://run-shortcut?name=... URL opened when the user taps the notification body. Use shortcuts://run-shortcut?name=... to run a specific iPhone Shortcut that already exists on the user's device. Overrides the default tap target from `media` when both are provided.") + redirection: Optional[Annotated[str, Field(strict=True, max_length=2048)]] = Field(default=None, description="Optional HTTP, HTTPS, Shortcuts, or installed app URL opened when the user taps the notification body. Custom schemes such as spotify:// and spotify:track:123 require iOS 1.13.4 build 2 or later and an installed handler; no web fallback is provided. Internal and executable schemes are blocked. Overrides the default tap target from media.") actions: Optional[Annotated[List[PushNotificationAction], Field(max_length=4)]] = Field(default=None, description="Optional interactive actions shown when users expand the notification. Cannot be combined with `media`.") payload: Optional[Dict[str, Any]] = None badge: Optional[StrictInt] = None @@ -41,7 +43,7 @@ class PushNotificationRequest(BaseModel): 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.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["title", "message", "subtitle", "media", "redirection", "actions", "payload", "badge", "sound", "target", "tags"] + __properties: ClassVar[List[str]] = ["metadata", "title", "message", "subtitle", "media", "redirection", "actions", "payload", "badge", "sound", "target", "tags"] @field_validator('media') def media_validate_regular_expression(cls, value): @@ -59,8 +61,8 @@ def redirection_validate_regular_expression(cls, value): if value is None: return value - if not re.match(r"^(http|https|shortcuts):\/\/", value): - raise ValueError(r"must validate the regular expression /^(http|https|shortcuts):\/\//") + if not re.match(r"^[A-Za-z][A-Za-z0-9+.-]*:", value): + raise ValueError(r"must validate the regular expression /^[A-Za-z][A-Za-z0-9+.-]*:/") return value model_config = ConfigDict( @@ -104,6 +106,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each value in metadata (dict) + _field_dict = {} + if self.metadata: + for _key in self.metadata: + if self.metadata[_key]: + _field_dict[_key] = self.metadata[_key].to_dict() + _dict['metadata'] = _field_dict # override the default output from pydantic by calling `to_dict()` of each item in actions (list) _items = [] if self.actions: @@ -131,6 +140,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "metadata": dict( + (_k, MetadataValue.from_dict(_v)) + for _k, _v in obj["metadata"].items() + ) + if obj.get("metadata") is not None + else None, "title": obj.get("title"), "message": obj.get("message"), "subtitle": obj.get("subtitle"), diff --git a/activitysmith_openapi/models/update_app_icon_badge_count422_response.py b/activitysmith_openapi/models/update_app_icon_badge_count422_response.py new file mode 100644 index 0000000..ebf28ab --- /dev/null +++ b/activitysmith_openapi/models/update_app_icon_badge_count422_response.py @@ -0,0 +1,137 @@ +# 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, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from activitysmith_openapi.models.app_icon_badge_count_update_error import AppIconBadgeCountUpdateError +from activitysmith_openapi.models.no_recipients_error import NoRecipientsError +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +UPDATEAPPICONBADGECOUNT422RESPONSE_ONE_OF_SCHEMAS = ["AppIconBadgeCountUpdateError", "NoRecipientsError"] + +class UpdateAppIconBadgeCount422Response(BaseModel): + """ + UpdateAppIconBadgeCount422Response + """ + # data type: NoRecipientsError + oneof_schema_1_validator: Optional[NoRecipientsError] = None + # data type: AppIconBadgeCountUpdateError + oneof_schema_2_validator: Optional[AppIconBadgeCountUpdateError] = None + actual_instance: Optional[Union[AppIconBadgeCountUpdateError, NoRecipientsError]] = None + one_of_schemas: Set[str] = { "AppIconBadgeCountUpdateError", "NoRecipientsError" } + + 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 = UpdateAppIconBadgeCount422Response.model_construct() + error_messages = [] + match = 0 + # validate data type: NoRecipientsError + if not isinstance(v, NoRecipientsError): + error_messages.append(f"Error! Input type `{type(v)}` is not `NoRecipientsError`") + else: + match += 1 + # validate data type: AppIconBadgeCountUpdateError + if not isinstance(v, AppIconBadgeCountUpdateError): + error_messages.append(f"Error! Input type `{type(v)}` is not `AppIconBadgeCountUpdateError`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in UpdateAppIconBadgeCount422Response with oneOf schemas: AppIconBadgeCountUpdateError, NoRecipientsError. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in UpdateAppIconBadgeCount422Response with oneOf schemas: AppIconBadgeCountUpdateError, NoRecipientsError. 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 NoRecipientsError + try: + instance.actual_instance = NoRecipientsError.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into AppIconBadgeCountUpdateError + try: + instance.actual_instance = AppIconBadgeCountUpdateError.from_json(json_str) + 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 UpdateAppIconBadgeCount422Response with oneOf schemas: AppIconBadgeCountUpdateError, NoRecipientsError. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into UpdateAppIconBadgeCount422Response with oneOf schemas: AppIconBadgeCountUpdateError, NoRecipientsError. 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], AppIconBadgeCountUpdateError, NoRecipientsError]]: + """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/openapi-source.json b/activitysmith_openapi/openapi-source.json new file mode 100644 index 0000000..dc05717 --- /dev/null +++ b/activitysmith_openapi/openapi-source.json @@ -0,0 +1,6 @@ +{ + "repository": "ActivitySmithHQ/activitysmith-backend", + "commit": "49ad7b083b50f53bc3d81edb77ca6597845160a2", + "path": "openapi.json", + "sha256": "b7e33cd485df8ddc5d7fb7b57b61106fd6f8ff3ffa7cc7bef4ac1ccbbb0cede7" +} diff --git a/activitysmith_openapi/test/test_app_icon_badge_count_update_error.py b/activitysmith_openapi/test/test_app_icon_badge_count_update_error.py new file mode 100644 index 0000000..b6b6f1e --- /dev/null +++ b/activitysmith_openapi/test/test_app_icon_badge_count_update_error.py @@ -0,0 +1,66 @@ +# 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.app_icon_badge_count_update_error import AppIconBadgeCountUpdateError + +class TestAppIconBadgeCountUpdateError(unittest.TestCase): + """AppIconBadgeCountUpdateError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AppIconBadgeCountUpdateError: + """Test AppIconBadgeCountUpdateError + 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 `AppIconBadgeCountUpdateError` + """ + model = AppIconBadgeCountUpdateError() + if include_optional: + return AppIconBadgeCountUpdateError( + error = '', + code = 'badge_device_disconnected', + message = '', + badge = 0, + devices_targeted = 56, + devices_updated = 56, + users_updated = 56, + devices_notified = 56, + effective_channel_slugs = [ + '' + ] + ) + else: + return AppIconBadgeCountUpdateError( + error = '', + code = 'badge_device_disconnected', + message = '', + badge = 0, + devices_updated = 56, + ) + """ + + def testAppIconBadgeCountUpdateError(self): + """Test AppIconBadgeCountUpdateError""" + # 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_app_icon_badge_count_update_response.py b/activitysmith_openapi/test/test_app_icon_badge_count_update_response.py index 82f2555..ada9340 100644 --- a/activitysmith_openapi/test/test_app_icon_badge_count_update_response.py +++ b/activitysmith_openapi/test/test_app_icon_badge_count_update_response.py @@ -37,6 +37,8 @@ def make_instance(self, include_optional) -> AppIconBadgeCountUpdateResponse: return AppIconBadgeCountUpdateResponse( success = True, badge = 0, + devices_updated = 56, + users_updated = 56, devices_notified = 56, users_notified = 56, effective_channel_slugs = [ @@ -48,8 +50,8 @@ def make_instance(self, include_optional) -> AppIconBadgeCountUpdateResponse: return AppIconBadgeCountUpdateResponse( success = True, badge = 0, - devices_notified = 56, - users_notified = 56, + devices_updated = 56, + users_updated = 56, effective_channel_slugs = [ '' ], diff --git a/activitysmith_openapi/test/test_live_activity_end_request.py b/activitysmith_openapi/test/test_live_activity_end_request.py index 5e51e63..a03564c 100644 --- a/activitysmith_openapi/test/test_live_activity_end_request.py +++ b/activitysmith_openapi/test/test_live_activity_end_request.py @@ -35,7 +35,13 @@ def make_instance(self, include_optional) -> LiveActivityEndRequest: model = LiveActivityEndRequest() if include_optional: return LiveActivityEndRequest( + metadata = { + 'key' : null + }, activity_id = '', + tags = [ + '0' + ], content_state = activitysmith_openapi.models.content_state_end.ContentStateEnd( title = '', subtitle = '', diff --git a/activitysmith_openapi/test/test_live_activity_limit_error.py b/activitysmith_openapi/test/test_live_activity_limit_error.py index c618fef..99a9502 100644 --- a/activitysmith_openapi/test/test_live_activity_limit_error.py +++ b/activitysmith_openapi/test/test_live_activity_limit_error.py @@ -38,7 +38,9 @@ def make_instance(self, include_optional) -> LiveActivityLimitError: error = '', message = '', limit = 56, - active = 56 + active = 56, + blocked_devices = 56, + targeted_devices = 56 ) else: return LiveActivityLimitError( diff --git a/activitysmith_openapi/test/test_live_activity_start_request.py b/activitysmith_openapi/test/test_live_activity_start_request.py index beb6dcb..cb9b91a 100644 --- a/activitysmith_openapi/test/test_live_activity_start_request.py +++ b/activitysmith_openapi/test/test_live_activity_start_request.py @@ -35,6 +35,9 @@ def make_instance(self, include_optional) -> LiveActivityStartRequest: model = LiveActivityStartRequest() if include_optional: return LiveActivityStartRequest( + metadata = { + 'key' : null + }, content_state = activitysmith_openapi.models.content_state_start.ContentStateStart( title = '', subtitle = '', 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 dc33c0a..3238961 100644 --- a/activitysmith_openapi/test/test_live_activity_stream_delete_request.py +++ b/activitysmith_openapi/test/test_live_activity_stream_delete_request.py @@ -35,6 +35,12 @@ def make_instance(self, include_optional) -> LiveActivityStreamDeleteRequest: model = LiveActivityStreamDeleteRequest() if include_optional: return LiveActivityStreamDeleteRequest( + metadata = { + 'key' : null + }, + tags = [ + 'gB:9JLe6iL71-aa-.Ctq:dcsc.3-8:1gAa8Xa6u61ArrlGpCQjkQVRmfnjddwcDM0' + ], content_state = activitysmith_openapi.models.stream_content_state.StreamContentState( title = '', subtitle = '', diff --git a/activitysmith_openapi/test/test_live_activity_stream_request.py b/activitysmith_openapi/test/test_live_activity_stream_request.py index d63a709..bc88f8f 100644 --- a/activitysmith_openapi/test/test_live_activity_stream_request.py +++ b/activitysmith_openapi/test/test_live_activity_stream_request.py @@ -35,6 +35,9 @@ def make_instance(self, include_optional) -> LiveActivityStreamRequest: model = LiveActivityStreamRequest() if include_optional: return LiveActivityStreamRequest( + metadata = { + 'key' : null + }, content_state = activitysmith_openapi.models.stream_content_state.StreamContentState( title = '', subtitle = '', diff --git a/activitysmith_openapi/test/test_live_activity_update_request.py b/activitysmith_openapi/test/test_live_activity_update_request.py index aa6241a..9200dc8 100644 --- a/activitysmith_openapi/test/test_live_activity_update_request.py +++ b/activitysmith_openapi/test/test_live_activity_update_request.py @@ -35,7 +35,13 @@ def make_instance(self, include_optional) -> LiveActivityUpdateRequest: model = LiveActivityUpdateRequest() if include_optional: return LiveActivityUpdateRequest( + metadata = { + 'key' : null + }, activity_id = '', + tags = [ + '0' + ], content_state = activitysmith_openapi.models.content_state_update.ContentStateUpdate( title = '', subtitle = '', diff --git a/activitysmith_openapi/test/test_metadata_value.py b/activitysmith_openapi/test/test_metadata_value.py new file mode 100644 index 0000000..e7115d2 --- /dev/null +++ b/activitysmith_openapi/test/test_metadata_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.metadata_value import MetadataValue + +class TestMetadataValue(unittest.TestCase): + """MetadataValue unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MetadataValue: + """Test MetadataValue + 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 `MetadataValue` + """ + model = MetadataValue() + if include_optional: + return MetadataValue( + ) + else: + return MetadataValue( + ) + """ + + def testMetadataValue(self): + """Test MetadataValue""" + # 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_push_notification_request.py b/activitysmith_openapi/test/test_push_notification_request.py index 7139f55..803435e 100644 --- a/activitysmith_openapi/test/test_push_notification_request.py +++ b/activitysmith_openapi/test/test_push_notification_request.py @@ -35,11 +35,14 @@ def make_instance(self, include_optional) -> PushNotificationRequest: model = PushNotificationRequest() if include_optional: return PushNotificationRequest( + metadata = { + 'key' : null + }, title = '', message = '', subtitle = '', media = 'https:/', - redirection = 'shortcuts:/', + redirection = 'A5bTTFjjMRwg.Zbs8YayHLrJdgMvb:', actions = [ { 'key' : null diff --git a/activitysmith_openapi/test/test_send_push_notification429_response.py b/activitysmith_openapi/test/test_send_push_notification429_response.py index 5466f95..d47464f 100644 --- a/activitysmith_openapi/test/test_send_push_notification429_response.py +++ b/activitysmith_openapi/test/test_send_push_notification429_response.py @@ -38,7 +38,9 @@ def make_instance(self, include_optional) -> SendPushNotification429Response: error = '', message = '', limit = 56, - active = 56 + active = 56, + blocked_devices = 56, + targeted_devices = 56 ) else: return SendPushNotification429Response( diff --git a/activitysmith_openapi/test/test_update_app_icon_badge_count422_response.py b/activitysmith_openapi/test/test_update_app_icon_badge_count422_response.py new file mode 100644 index 0000000..23bea2e --- /dev/null +++ b/activitysmith_openapi/test/test_update_app_icon_badge_count422_response.py @@ -0,0 +1,66 @@ +# 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.update_app_icon_badge_count422_response import UpdateAppIconBadgeCount422Response + +class TestUpdateAppIconBadgeCount422Response(unittest.TestCase): + """UpdateAppIconBadgeCount422Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateAppIconBadgeCount422Response: + """Test UpdateAppIconBadgeCount422Response + 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 `UpdateAppIconBadgeCount422Response` + """ + model = UpdateAppIconBadgeCount422Response() + if include_optional: + return UpdateAppIconBadgeCount422Response( + error = '', + message = '', + effective_channel_slugs = [ + '' + ], + code = 'badge_device_disconnected', + badge = 0, + devices_targeted = 56, + devices_updated = 56, + users_updated = 56, + devices_notified = 56 + ) + else: + return UpdateAppIconBadgeCount422Response( + error = '', + message = '', + code = 'badge_device_disconnected', + badge = 0, + devices_updated = 56, + ) + """ + + def testUpdateAppIconBadgeCount422Response(self): + """Test UpdateAppIconBadgeCount422Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main()