From 48ebde9f01f2576381c962d21f6222f69a98c4a7 Mon Sep 17 00:00:00 2001 From: activitysmith-bot Date: Mon, 12 Oct 2026 04:16:24 +0000 Subject: [PATCH] chore: regenerate SDK --- activitysmith_openapi/__init__.py | 2 + .../api/push_notifications_api.py | 318 +++++++++++++++++- .../docs/AppIconBadgeCountUpdateResponse.md | 3 + .../docs/LiveActivityEndResponse.md | 6 + .../docs/LiveActivityStartResponse.md | 3 + .../docs/LiveActivityStreamDeleteResponse.md | 5 + .../docs/LiveActivityStreamPutResponse.md | 5 + .../docs/LiveActivityUpdateResponse.md | 7 + .../docs/PushNotificationReplaceRequest.md | 40 +++ .../docs/PushNotificationReplaceResponse.md | 36 ++ .../docs/PushNotificationResponse.md | 6 + .../docs/PushNotificationsApi.md | 91 ++++- activitysmith_openapi/models/__init__.py | 2 + .../app_icon_badge_count_update_response.py | 10 +- .../models/live_activity_end_response.py | 23 +- .../models/live_activity_start_response.py | 10 +- .../live_activity_stream_delete_response.py | 16 +- .../live_activity_stream_put_response.py | 14 +- .../models/live_activity_update_response.py | 21 +- .../push_notification_replace_request.py | 172 ++++++++++ .../push_notification_replace_response.py | 101 ++++++ .../models/push_notification_response.py | 16 +- activitysmith_openapi/openapi-source.json | 4 +- ...st_app_icon_badge_count_update_response.py | 5 +- .../test/test_live_activity_end_response.py | 10 +- .../test/test_live_activity_start_response.py | 7 +- ...st_live_activity_stream_delete_response.py | 9 +- .../test_live_activity_stream_put_response.py | 9 +- .../test_live_activity_update_response.py | 15 +- .../test_push_notification_replace_request.py | 70 ++++ ...test_push_notification_replace_response.py | 64 ++++ .../test/test_push_notification_response.py | 8 +- .../test/test_push_notifications_api.py | 7 + 33 files changed, 1085 insertions(+), 30 deletions(-) create mode 100644 activitysmith_openapi/docs/PushNotificationReplaceRequest.md create mode 100644 activitysmith_openapi/docs/PushNotificationReplaceResponse.md create mode 100644 activitysmith_openapi/models/push_notification_replace_request.py create mode 100644 activitysmith_openapi/models/push_notification_replace_response.py create mode 100644 activitysmith_openapi/test/test_push_notification_replace_request.py create mode 100644 activitysmith_openapi/test/test_push_notification_replace_response.py diff --git a/activitysmith_openapi/__init__.py b/activitysmith_openapi/__init__.py index da2e10f..5a7b0c5 100644 --- a/activitysmith_openapi/__init__.py +++ b/activitysmith_openapi/__init__.py @@ -76,6 +76,8 @@ from activitysmith_openapi.models.push_interruption_level import PushInterruptionLevel from activitysmith_openapi.models.push_notification_action import PushNotificationAction from activitysmith_openapi.models.push_notification_action_type import PushNotificationActionType +from activitysmith_openapi.models.push_notification_replace_request import PushNotificationReplaceRequest +from activitysmith_openapi.models.push_notification_replace_response import PushNotificationReplaceResponse from activitysmith_openapi.models.push_notification_request import PushNotificationRequest from activitysmith_openapi.models.push_notification_response import PushNotificationResponse from activitysmith_openapi.models.push_notification_webhook_method import PushNotificationWebhookMethod diff --git a/activitysmith_openapi/api/push_notifications_api.py b/activitysmith_openapi/api/push_notifications_api.py index 4a65371..192d2e7 100644 --- a/activitysmith_openapi/api/push_notifications_api.py +++ b/activitysmith_openapi/api/push_notifications_api.py @@ -16,6 +16,10 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated +from pydantic import Field +from typing_extensions import Annotated +from activitysmith_openapi.models.push_notification_replace_request import PushNotificationReplaceRequest +from activitysmith_openapi.models.push_notification_replace_response import PushNotificationReplaceResponse from activitysmith_openapi.models.push_notification_request import PushNotificationRequest from activitysmith_openapi.models.push_notification_response import PushNotificationResponse @@ -37,6 +41,314 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client + @validate_call + def replace_push_notification( + self, + notification_id: Annotated[str, Field(min_length=1, strict=True, description="The `notification_id` returned when the Push Notification was sent.")], + push_notification_replace_request: PushNotificationReplaceRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PushNotificationReplaceResponse: + """Replace a push notification + + Replaces a Push Notification you already sent, using the `notification_id` from the send response. The replacement takes the original's place on the Lock Screen and in Notification Center instead of appearing as a second notification. It is delivered silently, with no sound or screen wake, to the same recipients as the original. Notification history is updated in place. + + :param notification_id: The `notification_id` returned when the Push Notification was sent. (required) + :type notification_id: str + :param push_notification_replace_request: (required) + :type push_notification_replace_request: PushNotificationReplaceRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._replace_push_notification_serialize( + notification_id=notification_id, + push_notification_replace_request=push_notification_replace_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PushNotificationReplaceResponse", + '400': "BadRequestError", + '402': "BillingBlockedError", + '403': "ForbiddenError", + '404': "NotFoundError", + '409': "NotFoundError", + '422': "NoRecipientsError", + '429': "SendPushNotification429Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def replace_push_notification_with_http_info( + self, + notification_id: Annotated[str, Field(min_length=1, strict=True, description="The `notification_id` returned when the Push Notification was sent.")], + push_notification_replace_request: PushNotificationReplaceRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PushNotificationReplaceResponse]: + """Replace a push notification + + Replaces a Push Notification you already sent, using the `notification_id` from the send response. The replacement takes the original's place on the Lock Screen and in Notification Center instead of appearing as a second notification. It is delivered silently, with no sound or screen wake, to the same recipients as the original. Notification history is updated in place. + + :param notification_id: The `notification_id` returned when the Push Notification was sent. (required) + :type notification_id: str + :param push_notification_replace_request: (required) + :type push_notification_replace_request: PushNotificationReplaceRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._replace_push_notification_serialize( + notification_id=notification_id, + push_notification_replace_request=push_notification_replace_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PushNotificationReplaceResponse", + '400': "BadRequestError", + '402': "BillingBlockedError", + '403': "ForbiddenError", + '404': "NotFoundError", + '409': "NotFoundError", + '422': "NoRecipientsError", + '429': "SendPushNotification429Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def replace_push_notification_without_preload_content( + self, + notification_id: Annotated[str, Field(min_length=1, strict=True, description="The `notification_id` returned when the Push Notification was sent.")], + push_notification_replace_request: PushNotificationReplaceRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Replace a push notification + + Replaces a Push Notification you already sent, using the `notification_id` from the send response. The replacement takes the original's place on the Lock Screen and in Notification Center instead of appearing as a second notification. It is delivered silently, with no sound or screen wake, to the same recipients as the original. Notification history is updated in place. + + :param notification_id: The `notification_id` returned when the Push Notification was sent. (required) + :type notification_id: str + :param push_notification_replace_request: (required) + :type push_notification_replace_request: PushNotificationReplaceRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._replace_push_notification_serialize( + notification_id=notification_id, + push_notification_replace_request=push_notification_replace_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PushNotificationReplaceResponse", + '400': "BadRequestError", + '402': "BillingBlockedError", + '403': "ForbiddenError", + '404': "NotFoundError", + '409': "NotFoundError", + '422': "NoRecipientsError", + '429': "SendPushNotification429Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _replace_push_notification_serialize( + self, + notification_id, + push_notification_replace_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if notification_id is not None: + _path_params['notification_id'] = notification_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if push_notification_replace_request is not None: + _body_params = push_notification_replace_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'apiKeyAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/push-notification/{notification_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def send_push_notification( self, @@ -56,7 +368,7 @@ def send_push_notification( ) -> PushNotificationResponse: """Send a push notification - Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. `media` cannot be combined with `actions`. Optional `icon` shows a custom image, such as a service logo or avatar, next to a smaller app icon. Optional `interruption_level` sets how urgently iOS presents the notification. Optional tags to organize and filter notification history. + Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. `media` cannot be combined with `actions`. Optional `icon` shows a custom image, such as a logo or avatar, next to a smaller app icon. Optional `interruption_level` sets how urgently iOS presents the notification. Optional tags to organize and filter notification history. :param push_notification_request: (required) :type push_notification_request: PushNotificationRequest @@ -128,7 +440,7 @@ def send_push_notification_with_http_info( ) -> ApiResponse[PushNotificationResponse]: """Send a push notification - Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. `media` cannot be combined with `actions`. Optional `icon` shows a custom image, such as a service logo or avatar, next to a smaller app icon. Optional `interruption_level` sets how urgently iOS presents the notification. Optional tags to organize and filter notification history. + Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. `media` cannot be combined with `actions`. Optional `icon` shows a custom image, such as a logo or avatar, next to a smaller app icon. Optional `interruption_level` sets how urgently iOS presents the notification. Optional tags to organize and filter notification history. :param push_notification_request: (required) :type push_notification_request: PushNotificationRequest @@ -200,7 +512,7 @@ def send_push_notification_without_preload_content( ) -> RESTResponseType: """Send a push notification - Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. `media` cannot be combined with `actions`. Optional `icon` shows a custom image, such as a service logo or avatar, next to a smaller app icon. Optional `interruption_level` sets how urgently iOS presents the notification. Optional tags to organize and filter notification history. + Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. `media` cannot be combined with `actions`. Optional `icon` shows a custom image, such as a logo or avatar, next to a smaller app icon. Optional `interruption_level` sets how urgently iOS presents the notification. Optional tags to organize and filter notification history. :param push_notification_request: (required) :type push_notification_request: PushNotificationRequest diff --git a/activitysmith_openapi/docs/AppIconBadgeCountUpdateResponse.md b/activitysmith_openapi/docs/AppIconBadgeCountUpdateResponse.md index 072e90e..a3139d8 100644 --- a/activitysmith_openapi/docs/AppIconBadgeCountUpdateResponse.md +++ b/activitysmith_openapi/docs/AppIconBadgeCountUpdateResponse.md @@ -13,6 +13,9 @@ Name | Type | Description | Notes **users_notified** | **int** | Deprecated compatibility alias for users_updated. | [optional] **effective_channel_slugs** | **List[str]** | | **timestamp** | **datetime** | | +**devices_targeted** | **int** | Number of device tokens targeted. | [optional] +**devices_deactivated** | **int** | Number of device tokens deactivated because APNs reported them unregistered. | [optional] +**devices_unregistered** | **int** | Number of targeted device tokens APNs reported as unregistered. | [optional] ## Example diff --git a/activitysmith_openapi/docs/LiveActivityEndResponse.md b/activitysmith_openapi/docs/LiveActivityEndResponse.md index 0277816..c6efeb1 100644 --- a/activitysmith_openapi/docs/LiveActivityEndResponse.md +++ b/activitysmith_openapi/docs/LiveActivityEndResponse.md @@ -11,6 +11,12 @@ Name | Type | Description | Notes **devices_queued** | **int** | | [optional] **devices_notified** | **int** | | [optional] **timestamp** | **datetime** | | +**ignored** | **bool** | True when the Live Activity had already ended and the request had no effect. | [optional] +**message** | **str** | | [optional] +**end_reason** | **str** | | [optional] +**forced_completion** | **bool** | True when the Live Activity was marked complete without a confirmed APNs end delivery. | [optional] +**warning** | **str** | | [optional] +**errors** | **List[str]** | Per-device delivery errors when some devices could not be reached. | [optional] ## Example diff --git a/activitysmith_openapi/docs/LiveActivityStartResponse.md b/activitysmith_openapi/docs/LiveActivityStartResponse.md index 2cf977d..8d3bce5 100644 --- a/activitysmith_openapi/docs/LiveActivityStartResponse.md +++ b/activitysmith_openapi/docs/LiveActivityStartResponse.md @@ -13,6 +13,9 @@ Name | Type | Description | Notes **effective_channel_slugs** | **List[str]** | | [optional] **tags** | **List[str]** | Optional tags to organize and filter notification history. | [optional] **timestamp** | **datetime** | | +**ended_activity_id** | **str** | Present when starting this Live Activity ended an older one to stay within the device limit. | [optional] +**message** | **str** | | [optional] +**errors** | **List[str]** | Per-device delivery errors when some devices could not be reached. | [optional] ## Example diff --git a/activitysmith_openapi/docs/LiveActivityStreamDeleteResponse.md b/activitysmith_openapi/docs/LiveActivityStreamDeleteResponse.md index f5dc07f..5b6bf37 100644 --- a/activitysmith_openapi/docs/LiveActivityStreamDeleteResponse.md +++ b/activitysmith_openapi/docs/LiveActivityStreamDeleteResponse.md @@ -13,6 +13,11 @@ Name | Type | Description | Notes **devices_queued** | **int** | | [optional] **devices_notified** | **int** | | [optional] **timestamp** | **datetime** | | +**ignored** | **bool** | True when the stream was already ended and the request had no effect. | [optional] +**message** | **str** | | [optional] +**forced_completion** | **bool** | | [optional] +**warning** | **str** | | [optional] +**errors** | **List[str]** | Per-device delivery errors when some devices could not be reached. | [optional] ## Example diff --git a/activitysmith_openapi/docs/LiveActivityStreamPutResponse.md b/activitysmith_openapi/docs/LiveActivityStreamPutResponse.md index 682d9e8..8700231 100644 --- a/activitysmith_openapi/docs/LiveActivityStreamPutResponse.md +++ b/activitysmith_openapi/docs/LiveActivityStreamPutResponse.md @@ -16,7 +16,12 @@ Name | Type | Description | Notes **users_notified** | **int** | | [optional] **effective_channel_slugs** | **List[str]** | | [optional] **tags** | **List[str]** | Optional tags to organize and filter notification history. | [optional] +**warning** | **str** | Present on `updated` responses when the current Live Activity has received more than 12 updates and has averaged more than one update every 2 minutes since it started. The update is still sent, but iOS may throttle Live Activities that update this often. | [optional] **timestamp** | **datetime** | | +**ignored** | **bool** | True when the request had no effect. | [optional] +**remote_push_sent** | **bool** | | [optional] +**message** | **str** | | [optional] +**errors** | **List[str]** | Per-device delivery errors when some devices could not be reached. | [optional] ## Example diff --git a/activitysmith_openapi/docs/LiveActivityUpdateResponse.md b/activitysmith_openapi/docs/LiveActivityUpdateResponse.md index 944204c..17a1e8b 100644 --- a/activitysmith_openapi/docs/LiveActivityUpdateResponse.md +++ b/activitysmith_openapi/docs/LiveActivityUpdateResponse.md @@ -11,6 +11,13 @@ Name | Type | Description | Notes **devices_queued** | **int** | | [optional] **devices_notified** | **int** | | [optional] **timestamp** | **datetime** | | +**users_notified** | **int** | | [optional] +**effective_channel_slugs** | **List[str]** | | [optional] +**tags** | **List[str]** | Optional tags to organize and filter notification history. | [optional] +**operation** | **str** | Present when the update started a new Live Activity for a managed stream. | [optional] +**stream_key** | **str** | | [optional] +**previous_activity_id** | **str** | | [optional] +**errors** | **List[str]** | Per-device delivery errors when some devices could not be reached. | [optional] ## Example diff --git a/activitysmith_openapi/docs/PushNotificationReplaceRequest.md b/activitysmith_openapi/docs/PushNotificationReplaceRequest.md new file mode 100644 index 0000000..8a864ac --- /dev/null +++ b/activitysmith_openapi/docs/PushNotificationReplaceRequest.md @@ -0,0 +1,40 @@ +# PushNotificationReplaceRequest + +Replacement content. title, subtitle, message, redirection, media, icon, actions, and payload fully replace the original values. Omit metadata or tags to keep the stored values; send {} or [] to clear them. + +## Properties + +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] +**icon** | **str** | Optional HTTPS image URL without credentials for a custom notification icon. If the image cannot be loaded, the app icon is used. iOS may omit subtitle when displaying a custom icon. | [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, 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] +**tags** | **List[str]** | Optional tags to organize and filter notification history. | [optional] + +## Example + +```python +from activitysmith_openapi.models.push_notification_replace_request import PushNotificationReplaceRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of PushNotificationReplaceRequest from a JSON string +push_notification_replace_request_instance = PushNotificationReplaceRequest.from_json(json) +# print the JSON string representation of the object +print(PushNotificationReplaceRequest.to_json()) + +# convert the object into a dict +push_notification_replace_request_dict = push_notification_replace_request_instance.to_dict() +# create an instance of PushNotificationReplaceRequest from a dict +push_notification_replace_request_from_dict = PushNotificationReplaceRequest.from_dict(push_notification_replace_request_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/PushNotificationReplaceResponse.md b/activitysmith_openapi/docs/PushNotificationReplaceResponse.md new file mode 100644 index 0000000..b313059 --- /dev/null +++ b/activitysmith_openapi/docs/PushNotificationReplaceResponse.md @@ -0,0 +1,36 @@ +# PushNotificationReplaceResponse + +Apple APNs acceptance result for the replacement. Acceptance does not confirm device delivery or presentation. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | True when APNs accepts the replacement for at least one device. | +**notification_id** | **str** | ID of the replaced Push Notification. It stays the same, so you can replace it again. | +**devices_notified** | **int** | Number of device tokens for which APNs accepted the notification, without confirming on-device delivery. | [optional] +**users_notified** | **int** | | [optional] +**effective_channel_slugs** | **List[str]** | | [optional] +**tags** | **List[str]** | Optional tags to organize and filter notification history. | [optional] +**timestamp** | **datetime** | | + +## Example + +```python +from activitysmith_openapi.models.push_notification_replace_response import PushNotificationReplaceResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of PushNotificationReplaceResponse from a JSON string +push_notification_replace_response_instance = PushNotificationReplaceResponse.from_json(json) +# print the JSON string representation of the object +print(PushNotificationReplaceResponse.to_json()) + +# convert the object into a dict +push_notification_replace_response_dict = push_notification_replace_response_instance.to_dict() +# create an instance of PushNotificationReplaceResponse from a dict +push_notification_replace_response_from_dict = PushNotificationReplaceResponse.from_dict(push_notification_replace_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/docs/PushNotificationResponse.md b/activitysmith_openapi/docs/PushNotificationResponse.md index 1e78b7f..f91b8c5 100644 --- a/activitysmith_openapi/docs/PushNotificationResponse.md +++ b/activitysmith_openapi/docs/PushNotificationResponse.md @@ -7,11 +7,17 @@ Apple APNs acceptance result. Acceptance does not confirm device delivery or pre Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **success** | **bool** | True when APNs accepts the notification for at least one targeted device. | +**notification_id** | **str** | ID of this Push Notification. Pass it to `PUT /push-notification/{notification_id}` to replace the notification later. | [optional] **devices_notified** | **int** | Number of device tokens for which APNs accepted the notification, without confirming on-device delivery. | [optional] **users_notified** | **int** | | [optional] **effective_channel_slugs** | **List[str]** | | [optional] **tags** | **List[str]** | Optional tags to organize and filter notification history. | [optional] **timestamp** | **datetime** | | +**devices_targeted** | **int** | Number of device tokens targeted. | [optional] +**devices_deactivated** | **int** | Number of device tokens deactivated because APNs reported them unregistered. | [optional] +**devices_unregistered** | **int** | Number of targeted device tokens APNs reported as unregistered. | [optional] +**credential_test** | **bool** | True when the request was an integration connection test and no paired devices were available. | [optional] +**message** | **str** | | [optional] ## Example diff --git a/activitysmith_openapi/docs/PushNotificationsApi.md b/activitysmith_openapi/docs/PushNotificationsApi.md index ef3b424..13de2ab 100644 --- a/activitysmith_openapi/docs/PushNotificationsApi.md +++ b/activitysmith_openapi/docs/PushNotificationsApi.md @@ -4,15 +4,104 @@ All URIs are relative to *https://activitysmith.com/api* Method | HTTP request | Description ------------- | ------------- | ------------- +[**replace_push_notification**](PushNotificationsApi.md#replace_push_notification) | **PUT** /push-notification/{notification_id} | Replace a push notification [**send_push_notification**](PushNotificationsApi.md#send_push_notification) | **POST** /push-notification | Send a push notification +# **replace_push_notification** +> PushNotificationReplaceResponse replace_push_notification(notification_id, push_notification_replace_request) + +Replace a push notification + +Replaces a Push Notification you already sent, using the `notification_id` from the send response. The replacement takes the original's place on the Lock Screen and in Notification Center instead of appearing as a second notification. It is delivered silently, with no sound or screen wake, to the same recipients as the original. Notification history is updated in place. + +### Example + +* Bearer (API Key) Authentication (apiKeyAuth): + +```python +import activitysmith_openapi +from activitysmith_openapi.models.push_notification_replace_request import PushNotificationReplaceRequest +from activitysmith_openapi.models.push_notification_replace_response import PushNotificationReplaceResponse +from activitysmith_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://activitysmith.com/api +# See configuration.py for a list of all supported configuration parameters. +configuration = activitysmith_openapi.Configuration( + host = "https://activitysmith.com/api" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (API Key): apiKeyAuth +configuration = activitysmith_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with activitysmith_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = activitysmith_openapi.PushNotificationsApi(api_client) + notification_id = 'notification_id_example' # str | The `notification_id` returned when the Push Notification was sent. + push_notification_replace_request = {"title":"✅ checkout-api recovered","message":"Error rate is back to normal. Incident resolved."} # PushNotificationReplaceRequest | + + try: + # Replace a push notification + api_response = api_instance.replace_push_notification(notification_id, push_notification_replace_request) + print("The response of PushNotificationsApi->replace_push_notification:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PushNotificationsApi->replace_push_notification: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **notification_id** | **str**| The `notification_id` returned when the Push Notification was sent. | + **push_notification_replace_request** | [**PushNotificationReplaceRequest**](PushNotificationReplaceRequest.md)| | + +### Return type + +[**PushNotificationReplaceResponse**](PushNotificationReplaceResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Push notification replaced | * 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.
| +**402** | Billing access required | - | +**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** | Push notification 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.
| +**409** | Push notification was sent before replacement support | * 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 recipients of the original Push Notification are still available | * 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) + # **send_push_notification** > PushNotificationResponse send_push_notification(push_notification_request) Send a push notification -Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. `media` cannot be combined with `actions`. Optional `icon` shows a custom image, such as a service logo or avatar, next to a smaller app icon. Optional `interruption_level` sets how urgently iOS presents the notification. Optional tags to organize and filter notification history. +Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. `media` cannot be combined with `actions`. Optional `icon` shows a custom image, such as a logo or avatar, next to a smaller app icon. Optional `interruption_level` sets how urgently iOS presents the notification. Optional tags to organize and filter notification history. ### Example diff --git a/activitysmith_openapi/models/__init__.py b/activitysmith_openapi/models/__init__.py index 6fd8af3..e30e221 100644 --- a/activitysmith_openapi/models/__init__.py +++ b/activitysmith_openapi/models/__init__.py @@ -56,6 +56,8 @@ from activitysmith_openapi.models.push_interruption_level import PushInterruptionLevel from activitysmith_openapi.models.push_notification_action import PushNotificationAction from activitysmith_openapi.models.push_notification_action_type import PushNotificationActionType +from activitysmith_openapi.models.push_notification_replace_request import PushNotificationReplaceRequest +from activitysmith_openapi.models.push_notification_replace_response import PushNotificationReplaceResponse from activitysmith_openapi.models.push_notification_request import PushNotificationRequest from activitysmith_openapi.models.push_notification_response import PushNotificationResponse from activitysmith_openapi.models.push_notification_webhook_method import PushNotificationWebhookMethod 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 e0582ba..a8bd224 100644 --- a/activitysmith_openapi/models/app_icon_badge_count_update_response.py +++ b/activitysmith_openapi/models/app_icon_badge_count_update_response.py @@ -36,7 +36,10 @@ class AppIconBadgeCountUpdateResponse(BaseModel): 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_updated", "users_updated", "devices_notified", "users_notified", "effective_channel_slugs", "timestamp"] + devices_targeted: Optional[StrictInt] = Field(default=None, description="Number of device tokens targeted.") + devices_deactivated: Optional[StrictInt] = Field(default=None, description="Number of device tokens deactivated because APNs reported them unregistered.") + devices_unregistered: Optional[StrictInt] = Field(default=None, description="Number of targeted device tokens APNs reported as unregistered.") + __properties: ClassVar[List[str]] = ["success", "badge", "devices_updated", "users_updated", "devices_notified", "users_notified", "effective_channel_slugs", "timestamp", "devices_targeted", "devices_deactivated", "devices_unregistered"] model_config = ConfigDict( populate_by_name=True, @@ -96,7 +99,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "devices_notified": obj.get("devices_notified"), "users_notified": obj.get("users_notified"), "effective_channel_slugs": obj.get("effective_channel_slugs"), - "timestamp": obj.get("timestamp") + "timestamp": obj.get("timestamp"), + "devices_targeted": obj.get("devices_targeted"), + "devices_deactivated": obj.get("devices_deactivated"), + "devices_unregistered": obj.get("devices_unregistered") }) return _obj diff --git a/activitysmith_openapi/models/live_activity_end_response.py b/activitysmith_openapi/models/live_activity_end_response.py index 0dd0380..fd76006 100644 --- a/activitysmith_openapi/models/live_activity_end_response.py +++ b/activitysmith_openapi/models/live_activity_end_response.py @@ -18,7 +18,7 @@ import json from datetime import datetime -from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -32,7 +32,13 @@ class LiveActivityEndResponse(BaseModel): devices_queued: Optional[StrictInt] = None devices_notified: Optional[StrictInt] = None timestamp: datetime - __properties: ClassVar[List[str]] = ["success", "activity_id", "devices_queued", "devices_notified", "timestamp"] + ignored: Optional[StrictBool] = Field(default=None, description="True when the Live Activity had already ended and the request had no effect.") + message: Optional[StrictStr] = None + end_reason: Optional[StrictStr] = None + forced_completion: Optional[StrictBool] = Field(default=None, description="True when the Live Activity was marked complete without a confirmed APNs end delivery.") + warning: Optional[StrictStr] = None + errors: Optional[List[StrictStr]] = Field(default=None, description="Per-device delivery errors when some devices could not be reached.") + __properties: ClassVar[List[str]] = ["success", "activity_id", "devices_queued", "devices_notified", "timestamp", "ignored", "message", "end_reason", "forced_completion", "warning", "errors"] model_config = ConfigDict( populate_by_name=True, @@ -73,6 +79,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # set to None if end_reason (nullable) is None + # and model_fields_set contains the field + if self.end_reason is None and "end_reason" in self.model_fields_set: + _dict['end_reason'] = None + return _dict @classmethod @@ -89,7 +100,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "activity_id": obj.get("activity_id"), "devices_queued": obj.get("devices_queued"), "devices_notified": obj.get("devices_notified"), - "timestamp": obj.get("timestamp") + "timestamp": obj.get("timestamp"), + "ignored": obj.get("ignored"), + "message": obj.get("message"), + "end_reason": obj.get("end_reason"), + "forced_completion": obj.get("forced_completion"), + "warning": obj.get("warning"), + "errors": obj.get("errors") }) return _obj diff --git a/activitysmith_openapi/models/live_activity_start_response.py b/activitysmith_openapi/models/live_activity_start_response.py index 56eab2d..b8bb622 100644 --- a/activitysmith_openapi/models/live_activity_start_response.py +++ b/activitysmith_openapi/models/live_activity_start_response.py @@ -35,7 +35,10 @@ class LiveActivityStartResponse(BaseModel): effective_channel_slugs: Optional[List[StrictStr]] = 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.") timestamp: datetime - __properties: ClassVar[List[str]] = ["success", "devices_notified", "users_notified", "activity_id", "effective_channel_slugs", "tags", "timestamp"] + ended_activity_id: Optional[StrictStr] = Field(default=None, description="Present when starting this Live Activity ended an older one to stay within the device limit.") + message: Optional[StrictStr] = None + errors: Optional[List[StrictStr]] = Field(default=None, description="Per-device delivery errors when some devices could not be reached.") + __properties: ClassVar[List[str]] = ["success", "devices_notified", "users_notified", "activity_id", "effective_channel_slugs", "tags", "timestamp", "ended_activity_id", "message", "errors"] model_config = ConfigDict( populate_by_name=True, @@ -94,7 +97,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "activity_id": obj.get("activity_id"), "effective_channel_slugs": obj.get("effective_channel_slugs"), "tags": obj.get("tags"), - "timestamp": obj.get("timestamp") + "timestamp": obj.get("timestamp"), + "ended_activity_id": obj.get("ended_activity_id"), + "message": obj.get("message"), + "errors": obj.get("errors") }) return _obj diff --git a/activitysmith_openapi/models/live_activity_stream_delete_response.py b/activitysmith_openapi/models/live_activity_stream_delete_response.py index cd76adc..42d3475 100644 --- a/activitysmith_openapi/models/live_activity_stream_delete_response.py +++ b/activitysmith_openapi/models/live_activity_stream_delete_response.py @@ -18,7 +18,7 @@ import json from datetime import datetime -from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -34,7 +34,12 @@ class LiveActivityStreamDeleteResponse(BaseModel): devices_queued: Optional[StrictInt] = None devices_notified: Optional[StrictInt] = None timestamp: datetime - __properties: ClassVar[List[str]] = ["success", "operation", "stream_key", "activity_id", "devices_queued", "devices_notified", "timestamp"] + ignored: Optional[StrictBool] = Field(default=None, description="True when the stream was already ended and the request had no effect.") + message: Optional[StrictStr] = None + forced_completion: Optional[StrictBool] = None + warning: Optional[StrictStr] = None + errors: Optional[List[StrictStr]] = Field(default=None, description="Per-device delivery errors when some devices could not be reached.") + __properties: ClassVar[List[str]] = ["success", "operation", "stream_key", "activity_id", "devices_queued", "devices_notified", "timestamp", "ignored", "message", "forced_completion", "warning", "errors"] @field_validator('operation') def operation_validate_enum(cls, value): @@ -105,7 +110,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "activity_id": obj.get("activity_id"), "devices_queued": obj.get("devices_queued"), "devices_notified": obj.get("devices_notified"), - "timestamp": obj.get("timestamp") + "timestamp": obj.get("timestamp"), + "ignored": obj.get("ignored"), + "message": obj.get("message"), + "forced_completion": obj.get("forced_completion"), + "warning": obj.get("warning"), + "errors": obj.get("errors") }) return _obj diff --git a/activitysmith_openapi/models/live_activity_stream_put_response.py b/activitysmith_openapi/models/live_activity_stream_put_response.py index d64c3ea..ce18661 100644 --- a/activitysmith_openapi/models/live_activity_stream_put_response.py +++ b/activitysmith_openapi/models/live_activity_stream_put_response.py @@ -38,8 +38,13 @@ class LiveActivityStreamPutResponse(BaseModel): users_notified: Optional[StrictInt] = None effective_channel_slugs: Optional[List[StrictStr]] = 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.") + warning: Optional[StrictStr] = Field(default=None, description="Present on `updated` responses when the current Live Activity has received more than 12 updates and has averaged more than one update every 2 minutes since it started. The update is still sent, but iOS may throttle Live Activities that update this often.") timestamp: datetime - __properties: ClassVar[List[str]] = ["success", "operation", "stream_key", "activity_id", "previous_activity_id", "devices_notified", "devices_queued", "users_notified", "effective_channel_slugs", "tags", "timestamp"] + ignored: Optional[StrictBool] = Field(default=None, description="True when the request had no effect.") + remote_push_sent: Optional[StrictBool] = None + message: Optional[StrictStr] = None + errors: Optional[List[StrictStr]] = Field(default=None, description="Per-device delivery errors when some devices could not be reached.") + __properties: ClassVar[List[str]] = ["success", "operation", "stream_key", "activity_id", "previous_activity_id", "devices_notified", "devices_queued", "users_notified", "effective_channel_slugs", "tags", "warning", "timestamp", "ignored", "remote_push_sent", "message", "errors"] @field_validator('operation') def operation_validate_enum(cls, value): @@ -114,7 +119,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "users_notified": obj.get("users_notified"), "effective_channel_slugs": obj.get("effective_channel_slugs"), "tags": obj.get("tags"), - "timestamp": obj.get("timestamp") + "warning": obj.get("warning"), + "timestamp": obj.get("timestamp"), + "ignored": obj.get("ignored"), + "remote_push_sent": obj.get("remote_push_sent"), + "message": obj.get("message"), + "errors": obj.get("errors") }) return _obj diff --git a/activitysmith_openapi/models/live_activity_update_response.py b/activitysmith_openapi/models/live_activity_update_response.py index 055a0da..caebad3 100644 --- a/activitysmith_openapi/models/live_activity_update_response.py +++ b/activitysmith_openapi/models/live_activity_update_response.py @@ -18,8 +18,9 @@ import json from datetime import datetime -from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, 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 @@ -32,7 +33,14 @@ class LiveActivityUpdateResponse(BaseModel): devices_queued: Optional[StrictInt] = None devices_notified: Optional[StrictInt] = None timestamp: datetime - __properties: ClassVar[List[str]] = ["success", "activity_id", "devices_queued", "devices_notified", "timestamp"] + users_notified: Optional[StrictInt] = None + effective_channel_slugs: Optional[List[StrictStr]] = 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.") + operation: Optional[StrictStr] = Field(default=None, description="Present when the update started a new Live Activity for a managed stream.") + stream_key: Optional[StrictStr] = None + previous_activity_id: Optional[StrictStr] = None + errors: Optional[List[StrictStr]] = Field(default=None, description="Per-device delivery errors when some devices could not be reached.") + __properties: ClassVar[List[str]] = ["success", "activity_id", "devices_queued", "devices_notified", "timestamp", "users_notified", "effective_channel_slugs", "tags", "operation", "stream_key", "previous_activity_id", "errors"] model_config = ConfigDict( populate_by_name=True, @@ -89,7 +97,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "activity_id": obj.get("activity_id"), "devices_queued": obj.get("devices_queued"), "devices_notified": obj.get("devices_notified"), - "timestamp": obj.get("timestamp") + "timestamp": obj.get("timestamp"), + "users_notified": obj.get("users_notified"), + "effective_channel_slugs": obj.get("effective_channel_slugs"), + "tags": obj.get("tags"), + "operation": obj.get("operation"), + "stream_key": obj.get("stream_key"), + "previous_activity_id": obj.get("previous_activity_id"), + "errors": obj.get("errors") }) return _obj diff --git a/activitysmith_openapi/models/push_notification_replace_request.py b/activitysmith_openapi/models/push_notification_replace_request.py new file mode 100644 index 0000000..f604b62 --- /dev/null +++ b/activitysmith_openapi/models/push_notification_replace_request.py @@ -0,0 +1,172 @@ +# 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 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 + +class PushNotificationReplaceRequest(BaseModel): + """ + Replacement content. title, subtitle, message, redirection, media, icon, actions, and payload fully replace the original values. Omit metadata or tags to keep the stored values; send {} or [] to clear them. + """ # 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 + icon: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Optional HTTPS image URL without credentials for a custom notification icon. If the image cannot be loaded, the app icon is used. iOS may omit subtitle when displaying a custom icon.") + 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, 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 + 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]] = ["metadata", "title", "message", "subtitle", "icon", "media", "redirection", "actions", "payload", "badge", "tags"] + + @field_validator('icon') + def icon_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^https:\/\/", value): + raise ValueError(r"must validate the regular expression /^https:\/\//") + return value + + @field_validator('media') + def media_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^https:\/\/", value): + raise ValueError(r"must validate the regular expression /^https:\/\//") + return value + + @field_validator('redirection') + def redirection_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + 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( + 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 PushNotificationReplaceRequest 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. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + 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: + for _item in self.actions: + if _item: + _items.append(_item.to_dict()) + _dict['actions'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PushNotificationReplaceRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + 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"), + "icon": obj.get("icon"), + "media": obj.get("media"), + "redirection": obj.get("redirection"), + "actions": [PushNotificationAction.from_dict(_item) for _item in obj["actions"]] if obj.get("actions") is not None else None, + "payload": obj.get("payload"), + "badge": obj.get("badge"), + "tags": obj.get("tags") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/activitysmith_openapi/models/push_notification_replace_response.py b/activitysmith_openapi/models/push_notification_replace_response.py new file mode 100644 index 0000000..94994ae --- /dev/null +++ b/activitysmith_openapi/models/push_notification_replace_response.py @@ -0,0 +1,101 @@ +# 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, 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 PushNotificationReplaceResponse(BaseModel): + """ + Apple APNs acceptance result for the replacement. Acceptance does not confirm device delivery or presentation. + """ # noqa: E501 + success: StrictBool = Field(description="True when APNs accepts the replacement for at least one device.") + notification_id: StrictStr = Field(description="ID of the replaced Push Notification. It stays the same, so you can replace it again.") + devices_notified: Optional[StrictInt] = Field(default=None, description="Number of device tokens for which APNs accepted the notification, without confirming on-device delivery.") + users_notified: Optional[StrictInt] = None + effective_channel_slugs: Optional[List[StrictStr]] = 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.") + timestamp: datetime + __properties: ClassVar[List[str]] = ["success", "notification_id", "devices_notified", "users_notified", "effective_channel_slugs", "tags", "timestamp"] + + 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 PushNotificationReplaceResponse 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 PushNotificationReplaceResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "success": obj.get("success"), + "notification_id": obj.get("notification_id"), + "devices_notified": obj.get("devices_notified"), + "users_notified": obj.get("users_notified"), + "effective_channel_slugs": obj.get("effective_channel_slugs"), + "tags": obj.get("tags"), + "timestamp": obj.get("timestamp") + }) + return _obj + + diff --git a/activitysmith_openapi/models/push_notification_response.py b/activitysmith_openapi/models/push_notification_response.py index 816142d..b4d12e0 100644 --- a/activitysmith_openapi/models/push_notification_response.py +++ b/activitysmith_openapi/models/push_notification_response.py @@ -29,12 +29,18 @@ class PushNotificationResponse(BaseModel): Apple APNs acceptance result. Acceptance does not confirm device delivery or presentation. Alerts remain eligible for APNs delivery retries for 24 hours; device settings and APNs storage policies still apply. """ # noqa: E501 success: StrictBool = Field(description="True when APNs accepts the notification for at least one targeted device.") + notification_id: Optional[StrictStr] = Field(default=None, description="ID of this Push Notification. Pass it to `PUT /push-notification/{notification_id}` to replace the notification later.") devices_notified: Optional[StrictInt] = Field(default=None, description="Number of device tokens for which APNs accepted the notification, without confirming on-device delivery.") users_notified: Optional[StrictInt] = None effective_channel_slugs: Optional[List[StrictStr]] = 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.") timestamp: datetime - __properties: ClassVar[List[str]] = ["success", "devices_notified", "users_notified", "effective_channel_slugs", "tags", "timestamp"] + devices_targeted: Optional[StrictInt] = Field(default=None, description="Number of device tokens targeted.") + devices_deactivated: Optional[StrictInt] = Field(default=None, description="Number of device tokens deactivated because APNs reported them unregistered.") + devices_unregistered: Optional[StrictInt] = Field(default=None, description="Number of targeted device tokens APNs reported as unregistered.") + credential_test: Optional[StrictBool] = Field(default=None, description="True when the request was an integration connection test and no paired devices were available.") + message: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["success", "notification_id", "devices_notified", "users_notified", "effective_channel_slugs", "tags", "timestamp", "devices_targeted", "devices_deactivated", "devices_unregistered", "credential_test", "message"] model_config = ConfigDict( populate_by_name=True, @@ -88,11 +94,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "success": obj.get("success"), + "notification_id": obj.get("notification_id"), "devices_notified": obj.get("devices_notified"), "users_notified": obj.get("users_notified"), "effective_channel_slugs": obj.get("effective_channel_slugs"), "tags": obj.get("tags"), - "timestamp": obj.get("timestamp") + "timestamp": obj.get("timestamp"), + "devices_targeted": obj.get("devices_targeted"), + "devices_deactivated": obj.get("devices_deactivated"), + "devices_unregistered": obj.get("devices_unregistered"), + "credential_test": obj.get("credential_test"), + "message": obj.get("message") }) return _obj diff --git a/activitysmith_openapi/openapi-source.json b/activitysmith_openapi/openapi-source.json index a320213..28e1d47 100644 --- a/activitysmith_openapi/openapi-source.json +++ b/activitysmith_openapi/openapi-source.json @@ -1,6 +1,6 @@ { "repository": "ActivitySmithHQ/activitysmith-backend", - "commit": "ce15d69eeb25776a3ae395e77d8b907ff7ba0709", + "commit": "dd6757c5defa3d1e6524faef789b6829184fb852", "path": "openapi.json", - "sha256": "b113d50e06d6581707d9472dda6e371b996441f58dceba87a88f79cb96508a7d" + "sha256": "24dae2d064095351d5e5cf800228e64a2d23c40b1e31a9754503081ddf31c5d8" } 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 ada9340..67983e5 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 @@ -44,7 +44,10 @@ def make_instance(self, include_optional) -> AppIconBadgeCountUpdateResponse: effective_channel_slugs = [ '' ], - timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + devices_targeted = 56, + devices_deactivated = 56, + devices_unregistered = 56 ) else: return AppIconBadgeCountUpdateResponse( diff --git a/activitysmith_openapi/test/test_live_activity_end_response.py b/activitysmith_openapi/test/test_live_activity_end_response.py index c0225c8..12bc773 100644 --- a/activitysmith_openapi/test/test_live_activity_end_response.py +++ b/activitysmith_openapi/test/test_live_activity_end_response.py @@ -39,7 +39,15 @@ def make_instance(self, include_optional) -> LiveActivityEndResponse: activity_id = '', devices_queued = 56, devices_notified = 56, - timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + ignored = True, + message = '', + end_reason = '', + forced_completion = True, + warning = '', + errors = [ + '' + ] ) else: return LiveActivityEndResponse( diff --git a/activitysmith_openapi/test/test_live_activity_start_response.py b/activitysmith_openapi/test/test_live_activity_start_response.py index 83930fa..ccd973b 100644 --- a/activitysmith_openapi/test/test_live_activity_start_response.py +++ b/activitysmith_openapi/test/test_live_activity_start_response.py @@ -45,7 +45,12 @@ def make_instance(self, include_optional) -> LiveActivityStartResponse: tags = [ 'gB:9JLe6iL71-aa-.Ctq:dcsc.3-8:1gAa8Xa6u61ArrlGpCQjkQVRmfnjddwcDM0' ], - timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + ended_activity_id = '', + message = '', + errors = [ + '' + ] ) else: return LiveActivityStartResponse( diff --git a/activitysmith_openapi/test/test_live_activity_stream_delete_response.py b/activitysmith_openapi/test/test_live_activity_stream_delete_response.py index fa08e58..1a4461f 100644 --- a/activitysmith_openapi/test/test_live_activity_stream_delete_response.py +++ b/activitysmith_openapi/test/test_live_activity_stream_delete_response.py @@ -41,7 +41,14 @@ def make_instance(self, include_optional) -> LiveActivityStreamDeleteResponse: activity_id = '', devices_queued = 56, devices_notified = 56, - timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + ignored = True, + message = '', + forced_completion = True, + warning = '', + errors = [ + '' + ] ) else: return LiveActivityStreamDeleteResponse( diff --git a/activitysmith_openapi/test/test_live_activity_stream_put_response.py b/activitysmith_openapi/test/test_live_activity_stream_put_response.py index 8db94ca..e46ff50 100644 --- a/activitysmith_openapi/test/test_live_activity_stream_put_response.py +++ b/activitysmith_openapi/test/test_live_activity_stream_put_response.py @@ -49,7 +49,14 @@ def make_instance(self, include_optional) -> LiveActivityStreamPutResponse: tags = [ 'gB:9JLe6iL71-aa-.Ctq:dcsc.3-8:1gAa8Xa6u61ArrlGpCQjkQVRmfnjddwcDM0' ], - timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + warning = '', + timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + ignored = True, + remote_push_sent = True, + message = '', + errors = [ + '' + ] ) else: return LiveActivityStreamPutResponse( diff --git a/activitysmith_openapi/test/test_live_activity_update_response.py b/activitysmith_openapi/test/test_live_activity_update_response.py index 7695340..62bf86e 100644 --- a/activitysmith_openapi/test/test_live_activity_update_response.py +++ b/activitysmith_openapi/test/test_live_activity_update_response.py @@ -39,7 +39,20 @@ def make_instance(self, include_optional) -> LiveActivityUpdateResponse: activity_id = '', devices_queued = 56, devices_notified = 56, - timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + users_notified = 56, + effective_channel_slugs = [ + '' + ], + tags = [ + 'gB:9JLe6iL71-aa-.Ctq:dcsc.3-8:1gAa8Xa6u61ArrlGpCQjkQVRmfnjddwcDM0' + ], + operation = '', + stream_key = '', + previous_activity_id = '', + errors = [ + '' + ] ) else: return LiveActivityUpdateResponse( diff --git a/activitysmith_openapi/test/test_push_notification_replace_request.py b/activitysmith_openapi/test/test_push_notification_replace_request.py new file mode 100644 index 0000000..06aeb53 --- /dev/null +++ b/activitysmith_openapi/test/test_push_notification_replace_request.py @@ -0,0 +1,70 @@ +# 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.push_notification_replace_request import PushNotificationReplaceRequest + +class TestPushNotificationReplaceRequest(unittest.TestCase): + """PushNotificationReplaceRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PushNotificationReplaceRequest: + """Test PushNotificationReplaceRequest + 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 `PushNotificationReplaceRequest` + """ + model = PushNotificationReplaceRequest() + if include_optional: + return PushNotificationReplaceRequest( + metadata = { + 'key' : null + }, + title = '', + message = '', + subtitle = '', + icon = 'https:/', + media = 'https:/', + redirection = 'A5bTTFjjMRwg.Zbs8YayHLrJdgMvb:', + actions = [ + { + 'key' : null + } + ], + payload = None, + badge = 56, + tags = [ + 'gB:9JLe6iL71-aa-.Ctq:dcsc.3-8:1gAa8Xa6u61ArrlGpCQjkQVRmfnjddwcDM0' + ] + ) + else: + return PushNotificationReplaceRequest( + title = '', + ) + """ + + def testPushNotificationReplaceRequest(self): + """Test PushNotificationReplaceRequest""" + # 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_replace_response.py b/activitysmith_openapi/test/test_push_notification_replace_response.py new file mode 100644 index 0000000..bcfb25b --- /dev/null +++ b/activitysmith_openapi/test/test_push_notification_replace_response.py @@ -0,0 +1,64 @@ +# 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.push_notification_replace_response import PushNotificationReplaceResponse + +class TestPushNotificationReplaceResponse(unittest.TestCase): + """PushNotificationReplaceResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PushNotificationReplaceResponse: + """Test PushNotificationReplaceResponse + 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 `PushNotificationReplaceResponse` + """ + model = PushNotificationReplaceResponse() + if include_optional: + return PushNotificationReplaceResponse( + success = True, + notification_id = '', + devices_notified = 56, + users_notified = 56, + effective_channel_slugs = [ + '' + ], + tags = [ + 'gB:9JLe6iL71-aa-.Ctq:dcsc.3-8:1gAa8Xa6u61ArrlGpCQjkQVRmfnjddwcDM0' + ], + timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return PushNotificationReplaceResponse( + success = True, + notification_id = '', + timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + ) + """ + + def testPushNotificationReplaceResponse(self): + """Test PushNotificationReplaceResponse""" + # 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_response.py b/activitysmith_openapi/test/test_push_notification_response.py index 74c30dc..61919f5 100644 --- a/activitysmith_openapi/test/test_push_notification_response.py +++ b/activitysmith_openapi/test/test_push_notification_response.py @@ -36,6 +36,7 @@ def make_instance(self, include_optional) -> PushNotificationResponse: if include_optional: return PushNotificationResponse( success = True, + notification_id = '', devices_notified = 56, users_notified = 56, effective_channel_slugs = [ @@ -44,7 +45,12 @@ def make_instance(self, include_optional) -> PushNotificationResponse: tags = [ 'gB:9JLe6iL71-aa-.Ctq:dcsc.3-8:1gAa8Xa6u61ArrlGpCQjkQVRmfnjddwcDM0' ], - timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + devices_targeted = 56, + devices_deactivated = 56, + devices_unregistered = 56, + credential_test = True, + message = '' ) else: return PushNotificationResponse( diff --git a/activitysmith_openapi/test/test_push_notifications_api.py b/activitysmith_openapi/test/test_push_notifications_api.py index f28a870..dea2be8 100644 --- a/activitysmith_openapi/test/test_push_notifications_api.py +++ b/activitysmith_openapi/test/test_push_notifications_api.py @@ -26,6 +26,13 @@ def setUp(self) -> None: def tearDown(self) -> None: pass + def test_replace_push_notification(self) -> None: + """Test case for replace_push_notification + + Replace a push notification + """ + pass + def test_send_push_notification(self) -> None: """Test case for send_push_notification