From 82af76b4e74d40e3fb9257f3c6a59591d678c64f Mon Sep 17 00:00:00 2001 From: activitysmith-bot Date: Fri, 10 Jul 2026 11:58:41 +0000 Subject: [PATCH 1/4] chore: regenerate SDK --- activitysmith_openapi/__init__.py | 3 + activitysmith_openapi/api/__init__.py | 1 + .../api/app_icon_badges_api.py | 321 ++++++++++++++++++ .../docs/AppIconBadgeCountUpdateRequest.md | 31 ++ .../docs/AppIconBadgeCountUpdateResponse.md | 34 ++ .../docs/AppIconBadgesApi.md | 92 +++++ .../docs/LiveActivityAction.md | 2 +- .../docs/PushNotificationAction.md | 2 +- .../docs/PushNotificationRequest.md | 2 +- activitysmith_openapi/models/__init__.py | 2 + .../models/activity_metric.py | 13 - activitysmith_openapi/models/alert_payload.py | 13 - .../app_icon_badge_count_update_request.py | 94 +++++ .../app_icon_badge_count_update_response.py | 99 ++++++ .../models/bad_request_error.py | 13 - .../models/channel_target.py | 13 - .../models/content_state_end.py | 13 - .../models/content_state_start.py | 13 - .../models/content_state_update.py | 13 - .../models/forbidden_error.py | 13 - .../models/live_activity_alert_badge.py | 13 - .../models/live_activity_alert_icon.py | 13 - .../models/live_activity_end_request.py | 13 - .../models/live_activity_end_response.py | 13 - .../models/live_activity_limit_error.py | 13 - .../models/live_activity_start_request.py | 13 - .../models/live_activity_start_response.py | 13 - .../live_activity_stream_delete_request.py | 13 - .../live_activity_stream_delete_response.py | 13 - .../live_activity_stream_put_response.py | 13 - .../models/live_activity_stream_request.py | 13 - .../models/live_activity_update_request.py | 13 - .../models/live_activity_update_response.py | 13 - activitysmith_openapi/models/metric_error.py | 13 - .../models/metric_value_update_request.py | 13 - .../models/metric_value_update_response.py | 13 - .../models/no_recipients_error.py | 13 - .../models/not_found_error.py | 13 - .../models/push_notification_response.py | 13 - .../models/rate_limit_error.py | 13 - .../models/stream_content_state.py | 13 - ...est_app_icon_badge_count_update_request.py | 56 +++ ...st_app_icon_badge_count_update_response.py | 66 ++++ .../test/test_app_icon_badges_api.py | 38 +++ .../test/test_content_state_end.py | 14 +- .../test/test_content_state_start.py | 14 +- .../test/test_content_state_update.py | 14 +- .../test/test_live_activity_action.py | 2 +- .../test/test_live_activity_end_request.py | 72 +++- .../test/test_live_activity_start_request.py | 79 ++++- ...est_live_activity_stream_delete_request.py | 45 ++- .../test/test_live_activity_stream_request.py | 83 ++++- .../test/test_live_activity_update_request.py | 70 +++- .../test/test_push_notification_action.py | 2 +- .../test/test_push_notification_request.py | 7 +- .../test/test_stream_content_state.py | 14 +- 56 files changed, 1216 insertions(+), 420 deletions(-) create mode 100644 activitysmith_openapi/api/app_icon_badges_api.py create mode 100644 activitysmith_openapi/docs/AppIconBadgeCountUpdateRequest.md create mode 100644 activitysmith_openapi/docs/AppIconBadgeCountUpdateResponse.md create mode 100644 activitysmith_openapi/docs/AppIconBadgesApi.md create mode 100644 activitysmith_openapi/models/app_icon_badge_count_update_request.py create mode 100644 activitysmith_openapi/models/app_icon_badge_count_update_response.py create mode 100644 activitysmith_openapi/test/test_app_icon_badge_count_update_request.py create mode 100644 activitysmith_openapi/test/test_app_icon_badge_count_update_response.py create mode 100644 activitysmith_openapi/test/test_app_icon_badges_api.py diff --git a/activitysmith_openapi/__init__.py b/activitysmith_openapi/__init__.py index aafc03e..fdf1b33 100644 --- a/activitysmith_openapi/__init__.py +++ b/activitysmith_openapi/__init__.py @@ -17,6 +17,7 @@ __version__ = "1.8.0" # import apis into sdk package +from activitysmith_openapi.api.app_icon_badges_api import AppIconBadgesApi from activitysmith_openapi.api.live_activities_api import LiveActivitiesApi from activitysmith_openapi.api.metrics_api import MetricsApi from activitysmith_openapi.api.push_notifications_api import PushNotificationsApi @@ -36,6 +37,8 @@ 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_request import AppIconBadgeCountUpdateRequest +from activitysmith_openapi.models.app_icon_badge_count_update_response import AppIconBadgeCountUpdateResponse from activitysmith_openapi.models.bad_request_error import BadRequestError from activitysmith_openapi.models.channel_target import ChannelTarget from activitysmith_openapi.models.content_state_end import ContentStateEnd diff --git a/activitysmith_openapi/api/__init__.py b/activitysmith_openapi/api/__init__.py index 42c9218..f70481e 100644 --- a/activitysmith_openapi/api/__init__.py +++ b/activitysmith_openapi/api/__init__.py @@ -1,6 +1,7 @@ # flake8: noqa # import apis into api package +from activitysmith_openapi.api.app_icon_badges_api import AppIconBadgesApi from activitysmith_openapi.api.live_activities_api import LiveActivitiesApi from activitysmith_openapi.api.metrics_api import MetricsApi from activitysmith_openapi.api.push_notifications_api import PushNotificationsApi diff --git a/activitysmith_openapi/api/app_icon_badges_api.py b/activitysmith_openapi/api/app_icon_badges_api.py new file mode 100644 index 0000000..074d52f --- /dev/null +++ b/activitysmith_openapi/api/app_icon_badges_api.py @@ -0,0 +1,321 @@ +# 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +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.api_client import ApiClient, RequestSerialized +from activitysmith_openapi.api_response import ApiResponse +from activitysmith_openapi.rest import RESTResponseType + + +class AppIconBadgesApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def update_app_icon_badge_count( + self, + app_icon_badge_count_update_request: AppIconBadgeCountUpdateRequest, + _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, + ) -> AppIconBadgeCountUpdateResponse: + """Update App Icon Badge Count + + Updates the App Icon Badge Count on devices matched by API key scope and optional target channels. Send `badge: 0` to clear the count. Badge updates are independent of push notifications and do not create a push notification history item. + + :param app_icon_badge_count_update_request: (required) + :type app_icon_badge_count_update_request: AppIconBadgeCountUpdateRequest + :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._update_app_icon_badge_count_serialize( + app_icon_badge_count_update_request=app_icon_badge_count_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AppIconBadgeCountUpdateResponse", + '400': "BadRequestError", + '403': "ForbiddenError", + '404': "NoRecipientsError", + '429': "RateLimitError", + } + 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 update_app_icon_badge_count_with_http_info( + self, + app_icon_badge_count_update_request: AppIconBadgeCountUpdateRequest, + _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[AppIconBadgeCountUpdateResponse]: + """Update App Icon Badge Count + + Updates the App Icon Badge Count on devices matched by API key scope and optional target channels. Send `badge: 0` to clear the count. Badge updates are independent of push notifications and do not create a push notification history item. + + :param app_icon_badge_count_update_request: (required) + :type app_icon_badge_count_update_request: AppIconBadgeCountUpdateRequest + :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._update_app_icon_badge_count_serialize( + app_icon_badge_count_update_request=app_icon_badge_count_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AppIconBadgeCountUpdateResponse", + '400': "BadRequestError", + '403': "ForbiddenError", + '404': "NoRecipientsError", + '429': "RateLimitError", + } + 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 update_app_icon_badge_count_without_preload_content( + self, + app_icon_badge_count_update_request: AppIconBadgeCountUpdateRequest, + _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: + """Update App Icon Badge Count + + Updates the App Icon Badge Count on devices matched by API key scope and optional target channels. Send `badge: 0` to clear the count. Badge updates are independent of push notifications and do not create a push notification history item. + + :param app_icon_badge_count_update_request: (required) + :type app_icon_badge_count_update_request: AppIconBadgeCountUpdateRequest + :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._update_app_icon_badge_count_serialize( + app_icon_badge_count_update_request=app_icon_badge_count_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AppIconBadgeCountUpdateResponse", + '400': "BadRequestError", + '403': "ForbiddenError", + '404': "NoRecipientsError", + '429': "RateLimitError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_app_icon_badge_count_serialize( + self, + app_icon_badge_count_update_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 + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if app_icon_badge_count_update_request is not None: + _body_params = app_icon_badge_count_update_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='POST', + resource_path='/badge', + 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 + ) + + diff --git a/activitysmith_openapi/docs/AppIconBadgeCountUpdateRequest.md b/activitysmith_openapi/docs/AppIconBadgeCountUpdateRequest.md new file mode 100644 index 0000000..03087ab --- /dev/null +++ b/activitysmith_openapi/docs/AppIconBadgeCountUpdateRequest.md @@ -0,0 +1,31 @@ +# AppIconBadgeCountUpdateRequest + +App Icon Badge Count update. Send badge 0 to clear the count. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**badge** | **int** | The count to show on the ActivitySmith app icon. Send 0 to clear it. | +**target** | [**ChannelTarget**](ChannelTarget.md) | | [optional] + +## Example + +```python +from activitysmith_openapi.models.app_icon_badge_count_update_request import AppIconBadgeCountUpdateRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of AppIconBadgeCountUpdateRequest from a JSON string +app_icon_badge_count_update_request_instance = AppIconBadgeCountUpdateRequest.from_json(json) +# print the JSON string representation of the object +print(AppIconBadgeCountUpdateRequest.to_json()) + +# convert the object into a dict +app_icon_badge_count_update_request_dict = app_icon_badge_count_update_request_instance.to_dict() +# create an instance of AppIconBadgeCountUpdateRequest from a dict +app_icon_badge_count_update_request_from_dict = AppIconBadgeCountUpdateRequest.from_dict(app_icon_badge_count_update_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/AppIconBadgeCountUpdateResponse.md b/activitysmith_openapi/docs/AppIconBadgeCountUpdateResponse.md new file mode 100644 index 0000000..74dd986 --- /dev/null +++ b/activitysmith_openapi/docs/AppIconBadgeCountUpdateResponse.md @@ -0,0 +1,34 @@ +# AppIconBadgeCountUpdateResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | +**badge** | **int** | | +**devices_notified** | **int** | | +**users_notified** | **int** | | +**effective_channel_slugs** | **List[str]** | | +**timestamp** | **datetime** | | + +## Example + +```python +from activitysmith_openapi.models.app_icon_badge_count_update_response import AppIconBadgeCountUpdateResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of AppIconBadgeCountUpdateResponse from a JSON string +app_icon_badge_count_update_response_instance = AppIconBadgeCountUpdateResponse.from_json(json) +# print the JSON string representation of the object +print(AppIconBadgeCountUpdateResponse.to_json()) + +# convert the object into a dict +app_icon_badge_count_update_response_dict = app_icon_badge_count_update_response_instance.to_dict() +# create an instance of AppIconBadgeCountUpdateResponse from a dict +app_icon_badge_count_update_response_from_dict = AppIconBadgeCountUpdateResponse.from_dict(app_icon_badge_count_update_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/AppIconBadgesApi.md b/activitysmith_openapi/docs/AppIconBadgesApi.md new file mode 100644 index 0000000..933504d --- /dev/null +++ b/activitysmith_openapi/docs/AppIconBadgesApi.md @@ -0,0 +1,92 @@ +# activitysmith_openapi.AppIconBadgesApi + +All URIs are relative to *https://activitysmith.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**update_app_icon_badge_count**](AppIconBadgesApi.md#update_app_icon_badge_count) | **POST** /badge | Update App Icon Badge Count + + +# **update_app_icon_badge_count** +> AppIconBadgeCountUpdateResponse update_app_icon_badge_count(app_icon_badge_count_update_request) + +Update App Icon Badge Count + +Updates the App Icon Badge Count on devices matched by API key scope and optional target channels. Send `badge: 0` to clear the count. Badge updates are independent of push notifications and do not create a push notification history item. + +### Example + +* Bearer (API Key) Authentication (apiKeyAuth): + +```python +import activitysmith_openapi +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.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.AppIconBadgesApi(api_client) + app_icon_badge_count_update_request = {"badge":12} # AppIconBadgeCountUpdateRequest | + + try: + # Update App Icon Badge Count + api_response = api_instance.update_app_icon_badge_count(app_icon_badge_count_update_request) + print("The response of AppIconBadgesApi->update_app_icon_badge_count:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AppIconBadgesApi->update_app_icon_badge_count: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app_icon_badge_count_update_request** | [**AppIconBadgeCountUpdateRequest**](AppIconBadgeCountUpdateRequest.md)| | + +### Return type + +[**AppIconBadgeCountUpdateResponse**](AppIconBadgeCountUpdateResponse.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** | App Icon Badge Count updated | - | +**400** | Bad request (invalid badge value or channel targeting input) | - | +**403** | Forbidden (API key scope or channel assignment violation) | - | +**404** | No recipients found for effective channel target | - | +**429** | Rate limit exceeded | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/activitysmith_openapi/docs/LiveActivityAction.md b/activitysmith_openapi/docs/LiveActivityAction.md index 8a1b79d..61178fa 100644 --- a/activitysmith_openapi/docs/LiveActivityAction.md +++ b/activitysmith_openapi/docs/LiveActivityAction.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **type** | [**LiveActivityActionType**](LiveActivityActionType.md) | | **url** | **str** | Action URL. For open_url, use an 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. | **method** | [**LiveActivityWebhookMethod**](LiveActivityWebhookMethod.md) | Webhook HTTP method. Used only when type=webhook. | [optional] [default to LiveActivityWebhookMethod.POST] -**body** | **Dict[str, object]** | Optional webhook payload body. Used only when type=webhook. | [optional] +**body** | **object** | Optional webhook payload body. Used only when type=webhook. | [optional] ## Example diff --git a/activitysmith_openapi/docs/PushNotificationAction.md b/activitysmith_openapi/docs/PushNotificationAction.md index c7a203b..243436c 100644 --- a/activitysmith_openapi/docs/PushNotificationAction.md +++ b/activitysmith_openapi/docs/PushNotificationAction.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **type** | [**PushNotificationActionType**](PushNotificationActionType.md) | | **url** | **str** | Action URL. For open_url, use an 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. | **method** | [**PushNotificationWebhookMethod**](PushNotificationWebhookMethod.md) | Webhook HTTP method. Used only when type=webhook. | [optional] [default to PushNotificationWebhookMethod.POST] -**body** | **Dict[str, object]** | Optional webhook payload body. Used only when type=webhook. | [optional] +**body** | **object** | Optional webhook payload body. Used only when type=webhook. | [optional] ## Example diff --git a/activitysmith_openapi/docs/PushNotificationRequest.md b/activitysmith_openapi/docs/PushNotificationRequest.md index a1aa74d..8c02f50 100644 --- a/activitysmith_openapi/docs/PushNotificationRequest.md +++ b/activitysmith_openapi/docs/PushNotificationRequest.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **media** | **str** | Optional HTTPS URL for an image, audio file, or video that users can preview or play when they expand the notification. If `redirection` is omitted, tapping the notification opens this URL. Cannot be combined with `actions`. | [optional] **redirection** | **str** | Optional HTTPS 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] **actions** | [**List[PushNotificationAction]**](PushNotificationAction.md) | Optional interactive actions shown when users expand the notification. Cannot be combined with `media`. | [optional] -**payload** | **Dict[str, object]** | | [optional] +**payload** | **object** | | [optional] **badge** | **int** | | [optional] **sound** | **str** | | [optional] **target** | [**ChannelTarget**](ChannelTarget.md) | | [optional] diff --git a/activitysmith_openapi/models/__init__.py b/activitysmith_openapi/models/__init__.py index 10f918d..b9576c7 100644 --- a/activitysmith_openapi/models/__init__.py +++ b/activitysmith_openapi/models/__init__.py @@ -17,6 +17,8 @@ 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_request import AppIconBadgeCountUpdateRequest +from activitysmith_openapi.models.app_icon_badge_count_update_response import AppIconBadgeCountUpdateResponse from activitysmith_openapi.models.bad_request_error import BadRequestError from activitysmith_openapi.models.channel_target import ChannelTarget from activitysmith_openapi.models.content_state_end import ContentStateEnd diff --git a/activitysmith_openapi/models/activity_metric.py b/activitysmith_openapi/models/activity_metric.py index 8a45c63..cef382f 100644 --- a/activitysmith_openapi/models/activity_metric.py +++ b/activitysmith_openapi/models/activity_metric.py @@ -32,7 +32,6 @@ class ActivityMetric(BaseModel): value: ActivityMetricValue unit: Optional[StrictStr] = None color: Optional[StrictStr] = Field(default=None, description="Optional per-metric accent color for metrics and stats activities.") - additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["label", "value", "unit", "color"] @field_validator('color') @@ -75,10 +74,8 @@ def to_dict(self) -> Dict[str, Any]: * `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( @@ -89,11 +86,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of value if self.value: _dict['value'] = self.value.to_dict() - # 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 @@ -111,11 +103,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "unit": obj.get("unit"), "color": obj.get("color") }) - # 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/alert_payload.py b/activitysmith_openapi/models/alert_payload.py index 44501ff..73ef542 100644 --- a/activitysmith_openapi/models/alert_payload.py +++ b/activitysmith_openapi/models/alert_payload.py @@ -28,7 +28,6 @@ class AlertPayload(BaseModel): """ # noqa: E501 title: Optional[StrictStr] = None body: Optional[StrictStr] = None - additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["title", "body"] model_config = ConfigDict( @@ -61,10 +60,8 @@ def to_dict(self) -> Dict[str, Any]: * `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( @@ -72,11 +69,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # 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 @@ -92,11 +84,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "title": obj.get("title"), "body": obj.get("body") }) - # 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/app_icon_badge_count_update_request.py b/activitysmith_openapi/models/app_icon_badge_count_update_request.py new file mode 100644 index 0000000..0b199a4 --- /dev/null +++ b/activitysmith_openapi/models/app_icon_badge_count_update_request.py @@ -0,0 +1,94 @@ +# 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 +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from activitysmith_openapi.models.channel_target import ChannelTarget +from typing import Optional, Set +from typing_extensions import Self + +class AppIconBadgeCountUpdateRequest(BaseModel): + """ + App Icon Badge Count update. Send badge 0 to clear the count. + """ # noqa: E501 + badge: Annotated[int, Field(le=2147483647, strict=True, ge=0)] = Field(description="The count to show on the ActivitySmith app icon. Send 0 to clear it.") + target: Optional[ChannelTarget] = None + __properties: ClassVar[List[str]] = ["badge", "target"] + + 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 AppIconBadgeCountUpdateRequest 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, + ) + # override the default output from pydantic by calling `to_dict()` of target + if self.target: + _dict['target'] = self.target.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AppIconBadgeCountUpdateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "badge": obj.get("badge"), + "target": ChannelTarget.from_dict(obj["target"]) if obj.get("target") is not None else None + }) + 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 new file mode 100644 index 0000000..4818c20 --- /dev/null +++ b/activitysmith_openapi/models/app_icon_badge_count_update_response.py @@ -0,0 +1,99 @@ +# 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 +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class AppIconBadgeCountUpdateResponse(BaseModel): + """ + AppIconBadgeCountUpdateResponse + """ # noqa: E501 + success: StrictBool + badge: Annotated[int, Field(le=2147483647, strict=True, ge=0)] + devices_notified: StrictInt + users_notified: StrictInt + effective_channel_slugs: List[StrictStr] + timestamp: datetime + __properties: ClassVar[List[str]] = ["success", "badge", "devices_notified", "users_notified", "effective_channel_slugs", "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 AppIconBadgeCountUpdateResponse 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 AppIconBadgeCountUpdateResponse 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"), + "badge": obj.get("badge"), + "devices_notified": obj.get("devices_notified"), + "users_notified": obj.get("users_notified"), + "effective_channel_slugs": obj.get("effective_channel_slugs"), + "timestamp": obj.get("timestamp") + }) + return _obj + + diff --git a/activitysmith_openapi/models/bad_request_error.py b/activitysmith_openapi/models/bad_request_error.py index e6e1113..86cd08c 100644 --- a/activitysmith_openapi/models/bad_request_error.py +++ b/activitysmith_openapi/models/bad_request_error.py @@ -28,7 +28,6 @@ class BadRequestError(BaseModel): """ # noqa: E501 error: StrictStr message: StrictStr - additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["error", "message"] model_config = ConfigDict( @@ -61,10 +60,8 @@ def to_dict(self) -> Dict[str, Any]: * `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( @@ -72,11 +69,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # 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 @@ -92,11 +84,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "error": obj.get("error"), "message": obj.get("message") }) - # 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/channel_target.py b/activitysmith_openapi/models/channel_target.py index 5dc9e74..e91ee8a 100644 --- a/activitysmith_openapi/models/channel_target.py +++ b/activitysmith_openapi/models/channel_target.py @@ -28,7 +28,6 @@ class ChannelTarget(BaseModel): ChannelTarget """ # noqa: E501 channels: Annotated[List[StrictStr], Field(min_length=1)] = Field(description="Channel slugs. When omitted, API key scope determines recipients.") - additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["channels"] model_config = ConfigDict( @@ -61,10 +60,8 @@ def to_dict(self) -> Dict[str, Any]: * `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( @@ -72,11 +69,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # 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 @@ -91,11 +83,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "channels": obj.get("channels") }) - # 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/content_state_end.py b/activitysmith_openapi/models/content_state_end.py index 04bbf22..6c5cc3a 100644 --- a/activitysmith_openapi/models/content_state_end.py +++ b/activitysmith_openapi/models/content_state_end.py @@ -49,7 +49,6 @@ class ContentStateEnd(BaseModel): step_color: Optional[StrictStr] = Field(default=None, description="Optional. Overrides color for the current step. Only applies to type=segmented_progress.") step_colors: Optional[List[StrictStr]] = Field(default=None, description="Optional. Colors for completed steps. When used with segmented_progress, the array length should match current_step.") auto_dismiss_minutes: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=3, description="Optional. Minutes before the ended Live Activity is dismissed. Default 3. Set 0 for immediate dismissal. iOS will dismiss ended Live Activities after ~4 hours max.") - additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["title", "subtitle", "number_of_steps", "current_step", "percentage", "value", "upper_limit", "duration_seconds", "counts_down", "is_running", "metrics", "message", "icon", "badge", "type", "color", "step_color", "step_colors", "auto_dismiss_minutes"] @field_validator('type') @@ -123,10 +122,8 @@ def to_dict(self) -> Dict[str, Any]: * `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( @@ -147,11 +144,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of badge if self.badge: _dict['badge'] = self.badge.to_dict() - # 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 @@ -184,11 +176,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "step_colors": obj.get("step_colors"), "auto_dismiss_minutes": obj.get("auto_dismiss_minutes") if obj.get("auto_dismiss_minutes") is not None else 3 }) - # 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/content_state_start.py b/activitysmith_openapi/models/content_state_start.py index 5ec78de..42cade6 100644 --- a/activitysmith_openapi/models/content_state_start.py +++ b/activitysmith_openapi/models/content_state_start.py @@ -48,7 +48,6 @@ class ContentStateStart(BaseModel): color: Optional[StrictStr] = Field(default=None, description="Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included.") step_color: Optional[StrictStr] = Field(default=None, description="Optional. Overrides color for the current step. Only applies to type=segmented_progress.") step_colors: Optional[List[StrictStr]] = Field(default=None, description="Optional. Colors for completed steps. When used with segmented_progress, the array length should match current_step.") - additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["title", "subtitle", "number_of_steps", "current_step", "percentage", "value", "upper_limit", "duration_seconds", "counts_down", "is_running", "metrics", "message", "icon", "badge", "type", "color", "step_color", "step_colors"] @field_validator('type') @@ -119,10 +118,8 @@ def to_dict(self) -> Dict[str, Any]: * `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( @@ -143,11 +140,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of badge if self.badge: _dict['badge'] = self.badge.to_dict() - # 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 @@ -179,11 +171,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "step_color": obj.get("step_color"), "step_colors": obj.get("step_colors") }) - # 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/content_state_update.py b/activitysmith_openapi/models/content_state_update.py index ae29563..52b4780 100644 --- a/activitysmith_openapi/models/content_state_update.py +++ b/activitysmith_openapi/models/content_state_update.py @@ -48,7 +48,6 @@ class ContentStateUpdate(BaseModel): color: Optional[StrictStr] = Field(default=None, description="Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included.") step_color: Optional[StrictStr] = Field(default=None, description="Optional. Overrides color for the current step. Only applies to type=segmented_progress.") step_colors: Optional[List[StrictStr]] = Field(default=None, description="Optional. Colors for completed steps. When used with segmented_progress, the array length should match current_step.") - additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["title", "subtitle", "number_of_steps", "current_step", "percentage", "value", "upper_limit", "duration_seconds", "counts_down", "is_running", "metrics", "message", "icon", "badge", "type", "color", "step_color", "step_colors"] @field_validator('type') @@ -122,10 +121,8 @@ def to_dict(self) -> Dict[str, Any]: * `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( @@ -146,11 +143,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of badge if self.badge: _dict['badge'] = self.badge.to_dict() - # 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 @@ -182,11 +174,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "step_color": obj.get("step_color"), "step_colors": obj.get("step_colors") }) - # 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/forbidden_error.py b/activitysmith_openapi/models/forbidden_error.py index b965152..55a0259 100644 --- a/activitysmith_openapi/models/forbidden_error.py +++ b/activitysmith_openapi/models/forbidden_error.py @@ -28,7 +28,6 @@ class ForbiddenError(BaseModel): """ # noqa: E501 error: StrictStr message: StrictStr - additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["error", "message"] model_config = ConfigDict( @@ -61,10 +60,8 @@ def to_dict(self) -> Dict[str, Any]: * `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( @@ -72,11 +69,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # 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 @@ -92,11 +84,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "error": obj.get("error"), "message": obj.get("message") }) - # 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/live_activity_alert_badge.py b/activitysmith_openapi/models/live_activity_alert_badge.py index e4e4d0a..dee1287 100644 --- a/activitysmith_openapi/models/live_activity_alert_badge.py +++ b/activitysmith_openapi/models/live_activity_alert_badge.py @@ -30,7 +30,6 @@ class LiveActivityAlertBadge(BaseModel): """ # noqa: E501 title: Annotated[str, Field(min_length=1, strict=True)] color: Optional[LiveActivityColor] = Field(default=None, description="Optional badge color.") - additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["title", "color"] model_config = ConfigDict( @@ -63,10 +62,8 @@ def to_dict(self) -> Dict[str, Any]: * `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( @@ -74,11 +71,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # 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 @@ -94,11 +86,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "title": obj.get("title"), "color": obj.get("color") }) - # 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/live_activity_alert_icon.py b/activitysmith_openapi/models/live_activity_alert_icon.py index 1f46b7c..b7c8fb8 100644 --- a/activitysmith_openapi/models/live_activity_alert_icon.py +++ b/activitysmith_openapi/models/live_activity_alert_icon.py @@ -30,7 +30,6 @@ class LiveActivityAlertIcon(BaseModel): """ # noqa: E501 symbol: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Apple SF Symbol name.") color: Optional[LiveActivityColor] = Field(default=None, description="Optional icon color.") - additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["symbol", "color"] model_config = ConfigDict( @@ -63,10 +62,8 @@ def to_dict(self) -> Dict[str, Any]: * `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( @@ -74,11 +71,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # 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 @@ -94,11 +86,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "symbol": obj.get("symbol"), "color": obj.get("color") }) - # 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/live_activity_end_request.py b/activitysmith_openapi/models/live_activity_end_request.py index edffff1..5662089 100644 --- a/activitysmith_openapi/models/live_activity_end_request.py +++ b/activitysmith_openapi/models/live_activity_end_request.py @@ -32,7 +32,6 @@ class LiveActivityEndRequest(BaseModel): content_state: ContentStateEnd action: Optional[LiveActivityAction] = None secondary_action: Optional[LiveActivityAction] = Field(default=None, description="Optional secondary action button. Supported only for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.") - additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["activity_id", "content_state", "action", "secondary_action"] model_config = ConfigDict( @@ -65,10 +64,8 @@ def to_dict(self) -> Dict[str, Any]: * `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( @@ -85,11 +82,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of secondary_action if self.secondary_action: _dict['secondary_action'] = self.secondary_action.to_dict() - # 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 @@ -107,11 +99,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "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 }) - # 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/live_activity_end_response.py b/activitysmith_openapi/models/live_activity_end_response.py index 9c53412..0dd0380 100644 --- a/activitysmith_openapi/models/live_activity_end_response.py +++ b/activitysmith_openapi/models/live_activity_end_response.py @@ -32,7 +32,6 @@ class LiveActivityEndResponse(BaseModel): devices_queued: Optional[StrictInt] = None devices_notified: Optional[StrictInt] = None timestamp: datetime - additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["success", "activity_id", "devices_queued", "devices_notified", "timestamp"] model_config = ConfigDict( @@ -65,10 +64,8 @@ def to_dict(self) -> Dict[str, Any]: * `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( @@ -76,11 +73,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # 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 @@ -99,11 +91,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "devices_notified": obj.get("devices_notified"), "timestamp": obj.get("timestamp") }) - # 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/live_activity_limit_error.py b/activitysmith_openapi/models/live_activity_limit_error.py index 9b5abba..f33b7e4 100644 --- a/activitysmith_openapi/models/live_activity_limit_error.py +++ b/activitysmith_openapi/models/live_activity_limit_error.py @@ -30,7 +30,6 @@ class LiveActivityLimitError(BaseModel): message: StrictStr limit: StrictInt active: StrictInt = Field(description="Current number of active Live Activities.") - additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["error", "message", "limit", "active"] model_config = ConfigDict( @@ -63,10 +62,8 @@ def to_dict(self) -> Dict[str, Any]: * `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( @@ -74,11 +71,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # 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 @@ -96,11 +88,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "limit": obj.get("limit"), "active": obj.get("active") }) - # 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/live_activity_start_request.py b/activitysmith_openapi/models/live_activity_start_request.py index 6d35a48..cd9297b 100644 --- a/activitysmith_openapi/models/live_activity_start_request.py +++ b/activitysmith_openapi/models/live_activity_start_request.py @@ -35,7 +35,6 @@ class LiveActivityStartRequest(BaseModel): secondary_action: Optional[LiveActivityAction] = Field(default=None, description="Optional secondary action button. Supported only 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 - additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["content_state", "action", "secondary_action", "alert", "target"] model_config = ConfigDict( @@ -68,10 +67,8 @@ def to_dict(self) -> Dict[str, Any]: * `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( @@ -94,11 +91,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of target if self.target: _dict['target'] = self.target.to_dict() - # 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 @@ -117,11 +109,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "alert": AlertPayload.from_dict(obj["alert"]) if obj.get("alert") is not None else None, "target": ChannelTarget.from_dict(obj["target"]) if obj.get("target") is not None else None }) - # 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/live_activity_start_response.py b/activitysmith_openapi/models/live_activity_start_response.py index 5f6ecf0..2ff3047 100644 --- a/activitysmith_openapi/models/live_activity_start_response.py +++ b/activitysmith_openapi/models/live_activity_start_response.py @@ -33,7 +33,6 @@ class LiveActivityStartResponse(BaseModel): activity_id: StrictStr effective_channel_slugs: Optional[List[StrictStr]] = None timestamp: datetime - additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["success", "devices_notified", "users_notified", "activity_id", "effective_channel_slugs", "timestamp"] model_config = ConfigDict( @@ -66,10 +65,8 @@ def to_dict(self) -> Dict[str, Any]: * `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( @@ -77,11 +74,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # 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 @@ -101,11 +93,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "effective_channel_slugs": obj.get("effective_channel_slugs"), "timestamp": obj.get("timestamp") }) - # 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/live_activity_stream_delete_request.py b/activitysmith_openapi/models/live_activity_stream_delete_request.py index 46b39c5..f71d033 100644 --- a/activitysmith_openapi/models/live_activity_stream_delete_request.py +++ b/activitysmith_openapi/models/live_activity_stream_delete_request.py @@ -33,7 +33,6 @@ class LiveActivityStreamDeleteRequest(BaseModel): action: Optional[LiveActivityAction] = None secondary_action: Optional[LiveActivityAction] = Field(default=None, description="Optional secondary action button. Supported only for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.") alert: Optional[AlertPayload] = None - additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["content_state", "action", "secondary_action", "alert"] model_config = ConfigDict( @@ -66,10 +65,8 @@ def to_dict(self) -> Dict[str, Any]: * `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( @@ -89,11 +86,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of alert if self.alert: _dict['alert'] = self.alert.to_dict() - # 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 @@ -111,11 +103,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "secondary_action": LiveActivityAction.from_dict(obj["secondary_action"]) if obj.get("secondary_action") is not None else None, "alert": AlertPayload.from_dict(obj["alert"]) if obj.get("alert") is not None else None }) - # 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/live_activity_stream_delete_response.py b/activitysmith_openapi/models/live_activity_stream_delete_response.py index f4a128e..cd76adc 100644 --- a/activitysmith_openapi/models/live_activity_stream_delete_response.py +++ b/activitysmith_openapi/models/live_activity_stream_delete_response.py @@ -34,7 +34,6 @@ class LiveActivityStreamDeleteResponse(BaseModel): devices_queued: Optional[StrictInt] = None devices_notified: Optional[StrictInt] = None timestamp: datetime - additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["success", "operation", "stream_key", "activity_id", "devices_queued", "devices_notified", "timestamp"] @field_validator('operation') @@ -74,10 +73,8 @@ def to_dict(self) -> Dict[str, Any]: * `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( @@ -85,11 +82,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # 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 - # set to None if activity_id (nullable) is None # and model_fields_set contains the field if self.activity_id is None and "activity_id" in self.model_fields_set: @@ -115,11 +107,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "devices_notified": obj.get("devices_notified"), "timestamp": obj.get("timestamp") }) - # 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/live_activity_stream_put_response.py b/activitysmith_openapi/models/live_activity_stream_put_response.py index 4acc6f5..eaaa181 100644 --- a/activitysmith_openapi/models/live_activity_stream_put_response.py +++ b/activitysmith_openapi/models/live_activity_stream_put_response.py @@ -37,7 +37,6 @@ class LiveActivityStreamPutResponse(BaseModel): users_notified: Optional[StrictInt] = None effective_channel_slugs: Optional[List[StrictStr]] = None timestamp: datetime - additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["success", "operation", "stream_key", "activity_id", "previous_activity_id", "devices_notified", "devices_queued", "users_notified", "effective_channel_slugs", "timestamp"] @field_validator('operation') @@ -77,10 +76,8 @@ def to_dict(self) -> Dict[str, Any]: * `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( @@ -88,11 +85,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # 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 - # set to None if activity_id (nullable) is None # and model_fields_set contains the field if self.activity_id is None and "activity_id" in self.model_fields_set: @@ -121,11 +113,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "effective_channel_slugs": obj.get("effective_channel_slugs"), "timestamp": obj.get("timestamp") }) - # 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/live_activity_stream_request.py b/activitysmith_openapi/models/live_activity_stream_request.py index 1cba75e..41c7553 100644 --- a/activitysmith_openapi/models/live_activity_stream_request.py +++ b/activitysmith_openapi/models/live_activity_stream_request.py @@ -37,7 +37,6 @@ class LiveActivityStreamRequest(BaseModel): alert: Optional[AlertPayload] = None channels: Optional[Annotated[List[StrictStr], Field(min_length=1)]] = Field(default=None, description="Channel slugs. When omitted, API key scope determines recipients.") target: Optional[ChannelTarget] = None - additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["content_state", "action", "secondary_action", "alert", "channels", "target"] model_config = ConfigDict( @@ -70,10 +69,8 @@ def to_dict(self) -> Dict[str, Any]: * `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( @@ -96,11 +93,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of target if self.target: _dict['target'] = self.target.to_dict() - # 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 @@ -120,11 +112,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "channels": obj.get("channels"), "target": ChannelTarget.from_dict(obj["target"]) if obj.get("target") is not None else None }) - # 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/live_activity_update_request.py b/activitysmith_openapi/models/live_activity_update_request.py index 165e66d..079bdc4 100644 --- a/activitysmith_openapi/models/live_activity_update_request.py +++ b/activitysmith_openapi/models/live_activity_update_request.py @@ -32,7 +32,6 @@ class LiveActivityUpdateRequest(BaseModel): content_state: ContentStateUpdate action: Optional[LiveActivityAction] = None secondary_action: Optional[LiveActivityAction] = Field(default=None, description="Optional secondary action button. Supported only for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.") - additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["activity_id", "content_state", "action", "secondary_action"] model_config = ConfigDict( @@ -65,10 +64,8 @@ def to_dict(self) -> Dict[str, Any]: * `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( @@ -85,11 +82,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of secondary_action if self.secondary_action: _dict['secondary_action'] = self.secondary_action.to_dict() - # 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 @@ -107,11 +99,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "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 }) - # 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/live_activity_update_response.py b/activitysmith_openapi/models/live_activity_update_response.py index c1b00a7..055a0da 100644 --- a/activitysmith_openapi/models/live_activity_update_response.py +++ b/activitysmith_openapi/models/live_activity_update_response.py @@ -32,7 +32,6 @@ class LiveActivityUpdateResponse(BaseModel): devices_queued: Optional[StrictInt] = None devices_notified: Optional[StrictInt] = None timestamp: datetime - additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["success", "activity_id", "devices_queued", "devices_notified", "timestamp"] model_config = ConfigDict( @@ -65,10 +64,8 @@ def to_dict(self) -> Dict[str, Any]: * `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( @@ -76,11 +73,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # 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 @@ -99,11 +91,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "devices_notified": obj.get("devices_notified"), "timestamp": obj.get("timestamp") }) - # 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/metric_error.py b/activitysmith_openapi/models/metric_error.py index a9bc675..f3cfb51 100644 --- a/activitysmith_openapi/models/metric_error.py +++ b/activitysmith_openapi/models/metric_error.py @@ -28,7 +28,6 @@ class MetricError(BaseModel): """ # noqa: E501 error: StrictStr message: Optional[StrictStr] = None - additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["error", "message"] model_config = ConfigDict( @@ -61,10 +60,8 @@ def to_dict(self) -> Dict[str, Any]: * `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( @@ -72,11 +69,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # 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 @@ -92,11 +84,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "error": obj.get("error"), "message": obj.get("message") }) - # 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/metric_value_update_request.py b/activitysmith_openapi/models/metric_value_update_request.py index d90f96b..67e138a 100644 --- a/activitysmith_openapi/models/metric_value_update_request.py +++ b/activitysmith_openapi/models/metric_value_update_request.py @@ -30,7 +30,6 @@ class MetricValueUpdateRequest(BaseModel): """ # noqa: E501 value: MetricValueUpdateRequestValue timestamp: Optional[datetime] = Field(default=None, description="Optional ISO timestamp for when the metric value was measured. Defaults to the server receive time.") - additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["value", "timestamp"] model_config = ConfigDict( @@ -63,10 +62,8 @@ def to_dict(self) -> Dict[str, Any]: * `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( @@ -77,11 +74,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of value if self.value: _dict['value'] = self.value.to_dict() - # 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 @@ -97,11 +89,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "value": MetricValueUpdateRequestValue.from_dict(obj["value"]) if obj.get("value") is not None else None, "timestamp": obj.get("timestamp") }) - # 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/metric_value_update_response.py b/activitysmith_openapi/models/metric_value_update_response.py index 50fa5f8..8cad9da 100644 --- a/activitysmith_openapi/models/metric_value_update_response.py +++ b/activitysmith_openapi/models/metric_value_update_response.py @@ -27,7 +27,6 @@ class MetricValueUpdateResponse(BaseModel): MetricValueUpdateResponse """ # noqa: E501 success: StrictBool - additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["success"] model_config = ConfigDict( @@ -60,10 +59,8 @@ def to_dict(self) -> Dict[str, Any]: * `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( @@ -71,11 +68,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # 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 @@ -90,11 +82,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "success": obj.get("success") }) - # 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/no_recipients_error.py b/activitysmith_openapi/models/no_recipients_error.py index 3fae1f9..42ba7ed 100644 --- a/activitysmith_openapi/models/no_recipients_error.py +++ b/activitysmith_openapi/models/no_recipients_error.py @@ -29,7 +29,6 @@ class NoRecipientsError(BaseModel): error: StrictStr message: StrictStr effective_channel_slugs: Optional[List[StrictStr]] = None - additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["error", "message", "effective_channel_slugs"] model_config = ConfigDict( @@ -62,10 +61,8 @@ def to_dict(self) -> Dict[str, Any]: * `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( @@ -73,11 +70,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # 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 @@ -94,11 +86,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "message": obj.get("message"), "effective_channel_slugs": obj.get("effective_channel_slugs") }) - # 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/not_found_error.py b/activitysmith_openapi/models/not_found_error.py index 0d14eab..98ccec2 100644 --- a/activitysmith_openapi/models/not_found_error.py +++ b/activitysmith_openapi/models/not_found_error.py @@ -28,7 +28,6 @@ class NotFoundError(BaseModel): """ # noqa: E501 error: StrictStr message: StrictStr - additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["error", "message"] model_config = ConfigDict( @@ -61,10 +60,8 @@ def to_dict(self) -> Dict[str, Any]: * `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( @@ -72,11 +69,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # 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 @@ -92,11 +84,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "error": obj.get("error"), "message": obj.get("message") }) - # 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_response.py b/activitysmith_openapi/models/push_notification_response.py index 9445802..fe32548 100644 --- a/activitysmith_openapi/models/push_notification_response.py +++ b/activitysmith_openapi/models/push_notification_response.py @@ -32,7 +32,6 @@ class PushNotificationResponse(BaseModel): users_notified: Optional[StrictInt] = None effective_channel_slugs: Optional[List[StrictStr]] = None timestamp: datetime - additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["success", "devices_notified", "users_notified", "effective_channel_slugs", "timestamp"] model_config = ConfigDict( @@ -65,10 +64,8 @@ def to_dict(self) -> Dict[str, Any]: * `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( @@ -76,11 +73,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # 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 @@ -99,11 +91,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "effective_channel_slugs": obj.get("effective_channel_slugs"), "timestamp": obj.get("timestamp") }) - # 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/rate_limit_error.py b/activitysmith_openapi/models/rate_limit_error.py index f559e59..5881109 100644 --- a/activitysmith_openapi/models/rate_limit_error.py +++ b/activitysmith_openapi/models/rate_limit_error.py @@ -28,7 +28,6 @@ class RateLimitError(BaseModel): """ # noqa: E501 error: StrictStr message: StrictStr - additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["error", "message"] model_config = ConfigDict( @@ -61,10 +60,8 @@ def to_dict(self) -> Dict[str, Any]: * `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( @@ -72,11 +69,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # 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 @@ -92,11 +84,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "error": obj.get("error"), "message": obj.get("message") }) - # 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/stream_content_state.py b/activitysmith_openapi/models/stream_content_state.py index 6b7d3cb..d8114b2 100644 --- a/activitysmith_openapi/models/stream_content_state.py +++ b/activitysmith_openapi/models/stream_content_state.py @@ -50,7 +50,6 @@ class StreamContentState(BaseModel): badge: Optional[LiveActivityAlertBadge] = Field(default=None, description="Optional badge. Supported by alert, progress, and segmented_progress.") auto_dismiss_seconds: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Optional. Seconds before the ended Live Activity is dismissed.") auto_dismiss_minutes: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Optional. Minutes before the ended Live Activity is dismissed.") - additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["title", "subtitle", "number_of_steps", "current_step", "percentage", "value", "upper_limit", "duration_seconds", "counts_down", "is_running", "type", "color", "step_color", "step_colors", "metrics", "message", "icon", "badge", "auto_dismiss_seconds", "auto_dismiss_minutes"] @field_validator('type') @@ -124,10 +123,8 @@ def to_dict(self) -> Dict[str, Any]: * `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( @@ -148,11 +145,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of badge if self.badge: _dict['badge'] = self.badge.to_dict() - # 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 @@ -186,11 +178,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "auto_dismiss_seconds": obj.get("auto_dismiss_seconds"), "auto_dismiss_minutes": obj.get("auto_dismiss_minutes") }) - # 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/test/test_app_icon_badge_count_update_request.py b/activitysmith_openapi/test/test_app_icon_badge_count_update_request.py new file mode 100644 index 0000000..db50693 --- /dev/null +++ b/activitysmith_openapi/test/test_app_icon_badge_count_update_request.py @@ -0,0 +1,56 @@ +# 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_request import AppIconBadgeCountUpdateRequest + +class TestAppIconBadgeCountUpdateRequest(unittest.TestCase): + """AppIconBadgeCountUpdateRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AppIconBadgeCountUpdateRequest: + """Test AppIconBadgeCountUpdateRequest + 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 `AppIconBadgeCountUpdateRequest` + """ + model = AppIconBadgeCountUpdateRequest() + if include_optional: + return AppIconBadgeCountUpdateRequest( + badge = 0, + target = activitysmith_openapi.models.channel_target.ChannelTarget( + channels = [ + '' + ], ) + ) + else: + return AppIconBadgeCountUpdateRequest( + badge = 0, + ) + """ + + def testAppIconBadgeCountUpdateRequest(self): + """Test AppIconBadgeCountUpdateRequest""" + # 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 new file mode 100644 index 0000000..82f2555 --- /dev/null +++ b/activitysmith_openapi/test/test_app_icon_badge_count_update_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.app_icon_badge_count_update_response import AppIconBadgeCountUpdateResponse + +class TestAppIconBadgeCountUpdateResponse(unittest.TestCase): + """AppIconBadgeCountUpdateResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AppIconBadgeCountUpdateResponse: + """Test AppIconBadgeCountUpdateResponse + 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 `AppIconBadgeCountUpdateResponse` + """ + model = AppIconBadgeCountUpdateResponse() + if include_optional: + return AppIconBadgeCountUpdateResponse( + success = True, + badge = 0, + devices_notified = 56, + users_notified = 56, + effective_channel_slugs = [ + '' + ], + timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return AppIconBadgeCountUpdateResponse( + success = True, + badge = 0, + devices_notified = 56, + users_notified = 56, + effective_channel_slugs = [ + '' + ], + timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + ) + """ + + def testAppIconBadgeCountUpdateResponse(self): + """Test AppIconBadgeCountUpdateResponse""" + # 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_badges_api.py b/activitysmith_openapi/test/test_app_icon_badges_api.py new file mode 100644 index 0000000..00b0e62 --- /dev/null +++ b/activitysmith_openapi/test/test_app_icon_badges_api.py @@ -0,0 +1,38 @@ +# 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.api.app_icon_badges_api import AppIconBadgesApi + + +class TestAppIconBadgesApi(unittest.TestCase): + """AppIconBadgesApi unit test stubs""" + + def setUp(self) -> None: + self.api = AppIconBadgesApi() + + def tearDown(self) -> None: + pass + + def test_update_app_icon_badge_count(self) -> None: + """Test case for update_app_icon_badge_count + + Update App Icon Badge Count + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/activitysmith_openapi/test/test_content_state_end.py b/activitysmith_openapi/test/test_content_state_end.py index 220fdfe..4bea9a2 100644 --- a/activitysmith_openapi/test/test_content_state_end.py +++ b/activitysmith_openapi/test/test_content_state_end.py @@ -46,11 +46,19 @@ def make_instance(self, include_optional) -> ContentStateEnd: counts_down = True, is_running = True, metrics = [ - { } + activitysmith_openapi.models.activity_metric.ActivityMetric( + label = '0', + value = null, + unit = '', + color = 'lime', ) ], message = '0', - icon = { }, - badge = { }, + icon = activitysmith_openapi.models.live_activity_alert_icon.LiveActivityAlertIcon( + symbol = '0', + color = 'lime', ), + badge = activitysmith_openapi.models.live_activity_alert_badge.LiveActivityAlertBadge( + title = '0', + color = 'lime', ), type = 'segmented_progress', color = 'lime', step_color = 'lime', diff --git a/activitysmith_openapi/test/test_content_state_start.py b/activitysmith_openapi/test/test_content_state_start.py index ccdbb6c..02aa2c5 100644 --- a/activitysmith_openapi/test/test_content_state_start.py +++ b/activitysmith_openapi/test/test_content_state_start.py @@ -46,11 +46,19 @@ def make_instance(self, include_optional) -> ContentStateStart: counts_down = True, is_running = True, metrics = [ - { } + activitysmith_openapi.models.activity_metric.ActivityMetric( + label = '0', + value = null, + unit = '', + color = 'lime', ) ], message = '0', - icon = { }, - badge = { }, + icon = activitysmith_openapi.models.live_activity_alert_icon.LiveActivityAlertIcon( + symbol = '0', + color = 'lime', ), + badge = activitysmith_openapi.models.live_activity_alert_badge.LiveActivityAlertBadge( + title = '0', + color = 'lime', ), type = 'segmented_progress', color = 'lime', step_color = 'lime', diff --git a/activitysmith_openapi/test/test_content_state_update.py b/activitysmith_openapi/test/test_content_state_update.py index c0b9056..ca888f5 100644 --- a/activitysmith_openapi/test/test_content_state_update.py +++ b/activitysmith_openapi/test/test_content_state_update.py @@ -46,11 +46,19 @@ def make_instance(self, include_optional) -> ContentStateUpdate: counts_down = True, is_running = True, metrics = [ - { } + activitysmith_openapi.models.activity_metric.ActivityMetric( + label = '0', + value = null, + unit = '', + color = 'lime', ) ], message = '0', - icon = { }, - badge = { }, + icon = activitysmith_openapi.models.live_activity_alert_icon.LiveActivityAlertIcon( + symbol = '0', + color = 'lime', ), + badge = activitysmith_openapi.models.live_activity_alert_badge.LiveActivityAlertBadge( + title = '0', + color = 'lime', ), type = 'segmented_progress', color = 'lime', step_color = 'lime', diff --git a/activitysmith_openapi/test/test_live_activity_action.py b/activitysmith_openapi/test/test_live_activity_action.py index ec696ec..3ea7ffe 100644 --- a/activitysmith_openapi/test/test_live_activity_action.py +++ b/activitysmith_openapi/test/test_live_activity_action.py @@ -39,7 +39,7 @@ def make_instance(self, include_optional) -> LiveActivityAction: type = 'open_url', url = '', method = 'POST', - body = { } + body = None ) else: return LiveActivityAction( diff --git a/activitysmith_openapi/test/test_live_activity_end_request.py b/activitysmith_openapi/test/test_live_activity_end_request.py index 9e2ff46..5e51e63 100644 --- a/activitysmith_openapi/test/test_live_activity_end_request.py +++ b/activitysmith_openapi/test/test_live_activity_end_request.py @@ -36,14 +36,78 @@ def make_instance(self, include_optional) -> LiveActivityEndRequest: if include_optional: return LiveActivityEndRequest( activity_id = '', - content_state = { }, - action = { }, - secondary_action = { } + content_state = activitysmith_openapi.models.content_state_end.ContentStateEnd( + title = '', + subtitle = '', + number_of_steps = 1, + current_step = 0, + percentage = 0, + value = 1.337, + upper_limit = 1.337, + duration_seconds = 1.337, + counts_down = True, + is_running = True, + metrics = [ + activitysmith_openapi.models.activity_metric.ActivityMetric( + label = '0', + value = null, + unit = '', + color = 'lime', ) + ], + message = '0', + icon = activitysmith_openapi.models.live_activity_alert_icon.LiveActivityAlertIcon( + symbol = '0', + color = 'lime', ), + badge = activitysmith_openapi.models.live_activity_alert_badge.LiveActivityAlertBadge( + title = '0', ), + type = 'segmented_progress', + color = 'lime', + step_color = 'lime', + step_colors = [ + 'lime' + ], + auto_dismiss_minutes = 0, ), + action = { + 'key' : null + }, + secondary_action = { + 'key' : null + } ) else: return LiveActivityEndRequest( activity_id = '', - content_state = { }, + content_state = activitysmith_openapi.models.content_state_end.ContentStateEnd( + title = '', + subtitle = '', + number_of_steps = 1, + current_step = 0, + percentage = 0, + value = 1.337, + upper_limit = 1.337, + duration_seconds = 1.337, + counts_down = True, + is_running = True, + metrics = [ + activitysmith_openapi.models.activity_metric.ActivityMetric( + label = '0', + value = null, + unit = '', + color = 'lime', ) + ], + message = '0', + icon = activitysmith_openapi.models.live_activity_alert_icon.LiveActivityAlertIcon( + symbol = '0', + color = 'lime', ), + badge = activitysmith_openapi.models.live_activity_alert_badge.LiveActivityAlertBadge( + title = '0', ), + type = 'segmented_progress', + color = 'lime', + step_color = 'lime', + step_colors = [ + 'lime' + ], + auto_dismiss_minutes = 0, ), ) """ diff --git a/activitysmith_openapi/test/test_live_activity_start_request.py b/activitysmith_openapi/test/test_live_activity_start_request.py index 3ba6c30..b6ee970 100644 --- a/activitysmith_openapi/test/test_live_activity_start_request.py +++ b/activitysmith_openapi/test/test_live_activity_start_request.py @@ -35,15 +35,82 @@ def make_instance(self, include_optional) -> LiveActivityStartRequest: model = LiveActivityStartRequest() if include_optional: return LiveActivityStartRequest( - content_state = { }, - action = { }, - secondary_action = { }, - alert = { }, - target = { } + content_state = activitysmith_openapi.models.content_state_start.ContentStateStart( + title = '', + subtitle = '', + number_of_steps = 1, + current_step = 0, + percentage = 0, + value = 1.337, + upper_limit = 1.337, + duration_seconds = 1.337, + counts_down = True, + is_running = True, + metrics = [ + activitysmith_openapi.models.activity_metric.ActivityMetric( + label = '0', + value = null, + unit = '', + color = 'lime', ) + ], + message = '0', + icon = activitysmith_openapi.models.live_activity_alert_icon.LiveActivityAlertIcon( + symbol = '0', + color = 'lime', ), + badge = activitysmith_openapi.models.live_activity_alert_badge.LiveActivityAlertBadge( + title = '0', ), + type = 'segmented_progress', + color = 'lime', + step_color = 'lime', + step_colors = [ + 'lime' + ], ), + action = { + 'key' : null + }, + secondary_action = { + 'key' : null + }, + alert = activitysmith_openapi.models.alert_payload.AlertPayload( + title = '', + body = '', ), + target = activitysmith_openapi.models.channel_target.ChannelTarget( + channels = [ + '' + ], ) ) else: return LiveActivityStartRequest( - content_state = { }, + content_state = activitysmith_openapi.models.content_state_start.ContentStateStart( + title = '', + subtitle = '', + number_of_steps = 1, + current_step = 0, + percentage = 0, + value = 1.337, + upper_limit = 1.337, + duration_seconds = 1.337, + counts_down = True, + is_running = True, + metrics = [ + activitysmith_openapi.models.activity_metric.ActivityMetric( + label = '0', + value = null, + unit = '', + color = 'lime', ) + ], + message = '0', + icon = activitysmith_openapi.models.live_activity_alert_icon.LiveActivityAlertIcon( + symbol = '0', + color = 'lime', ), + badge = activitysmith_openapi.models.live_activity_alert_badge.LiveActivityAlertBadge( + title = '0', ), + type = 'segmented_progress', + color = 'lime', + step_color = 'lime', + step_colors = [ + 'lime' + ], ), ) """ 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 795f287..dc33c0a 100644 --- a/activitysmith_openapi/test/test_live_activity_stream_delete_request.py +++ b/activitysmith_openapi/test/test_live_activity_stream_delete_request.py @@ -35,10 +35,47 @@ def make_instance(self, include_optional) -> LiveActivityStreamDeleteRequest: model = LiveActivityStreamDeleteRequest() if include_optional: return LiveActivityStreamDeleteRequest( - content_state = { }, - action = { }, - secondary_action = { }, - alert = { } + content_state = activitysmith_openapi.models.stream_content_state.StreamContentState( + title = '', + subtitle = '', + number_of_steps = 1, + current_step = 0, + percentage = 0, + value = 1.337, + upper_limit = 1.337, + duration_seconds = 1.337, + counts_down = True, + is_running = True, + type = 'segmented_progress', + color = 'lime', + step_color = 'lime', + step_colors = [ + 'lime' + ], + metrics = [ + activitysmith_openapi.models.activity_metric.ActivityMetric( + label = '0', + value = null, + unit = '', + color = 'lime', ) + ], + message = '0', + icon = activitysmith_openapi.models.live_activity_alert_icon.LiveActivityAlertIcon( + symbol = '0', + color = 'lime', ), + badge = activitysmith_openapi.models.live_activity_alert_badge.LiveActivityAlertBadge( + title = '0', ), + auto_dismiss_seconds = 0, + auto_dismiss_minutes = 0, ), + action = { + 'key' : null + }, + secondary_action = { + 'key' : null + }, + alert = activitysmith_openapi.models.alert_payload.AlertPayload( + title = '', + body = '', ) ) else: return LiveActivityStreamDeleteRequest( diff --git a/activitysmith_openapi/test/test_live_activity_stream_request.py b/activitysmith_openapi/test/test_live_activity_stream_request.py index f02f8a0..2bb40e1 100644 --- a/activitysmith_openapi/test/test_live_activity_stream_request.py +++ b/activitysmith_openapi/test/test_live_activity_stream_request.py @@ -35,18 +35,89 @@ def make_instance(self, include_optional) -> LiveActivityStreamRequest: model = LiveActivityStreamRequest() if include_optional: return LiveActivityStreamRequest( - content_state = { }, - action = { }, - secondary_action = { }, - alert = { }, + content_state = activitysmith_openapi.models.stream_content_state.StreamContentState( + title = '', + subtitle = '', + number_of_steps = 1, + current_step = 0, + percentage = 0, + value = 1.337, + upper_limit = 1.337, + duration_seconds = 1.337, + counts_down = True, + is_running = True, + type = 'segmented_progress', + color = 'lime', + step_color = 'lime', + step_colors = [ + 'lime' + ], + metrics = [ + activitysmith_openapi.models.activity_metric.ActivityMetric( + label = '0', + value = null, + unit = '', + color = 'lime', ) + ], + message = '0', + icon = activitysmith_openapi.models.live_activity_alert_icon.LiveActivityAlertIcon( + symbol = '0', + color = 'lime', ), + badge = activitysmith_openapi.models.live_activity_alert_badge.LiveActivityAlertBadge( + title = '0', ), + auto_dismiss_seconds = 0, + auto_dismiss_minutes = 0, ), + action = { + 'key' : null + }, + secondary_action = { + 'key' : null + }, + alert = activitysmith_openapi.models.alert_payload.AlertPayload( + title = '', + body = '', ), channels = [ '' ], - target = { } + target = activitysmith_openapi.models.channel_target.ChannelTarget( + channels = [ + '' + ], ) ) else: return LiveActivityStreamRequest( - content_state = { }, + content_state = activitysmith_openapi.models.stream_content_state.StreamContentState( + title = '', + subtitle = '', + number_of_steps = 1, + current_step = 0, + percentage = 0, + value = 1.337, + upper_limit = 1.337, + duration_seconds = 1.337, + counts_down = True, + is_running = True, + type = 'segmented_progress', + color = 'lime', + step_color = 'lime', + step_colors = [ + 'lime' + ], + metrics = [ + activitysmith_openapi.models.activity_metric.ActivityMetric( + label = '0', + value = null, + unit = '', + color = 'lime', ) + ], + message = '0', + icon = activitysmith_openapi.models.live_activity_alert_icon.LiveActivityAlertIcon( + symbol = '0', + color = 'lime', ), + badge = activitysmith_openapi.models.live_activity_alert_badge.LiveActivityAlertBadge( + title = '0', ), + auto_dismiss_seconds = 0, + auto_dismiss_minutes = 0, ), ) """ diff --git a/activitysmith_openapi/test/test_live_activity_update_request.py b/activitysmith_openapi/test/test_live_activity_update_request.py index b5945bd..aa6241a 100644 --- a/activitysmith_openapi/test/test_live_activity_update_request.py +++ b/activitysmith_openapi/test/test_live_activity_update_request.py @@ -36,14 +36,76 @@ def make_instance(self, include_optional) -> LiveActivityUpdateRequest: if include_optional: return LiveActivityUpdateRequest( activity_id = '', - content_state = { }, - action = { }, - secondary_action = { } + content_state = activitysmith_openapi.models.content_state_update.ContentStateUpdate( + title = '', + subtitle = '', + number_of_steps = 1, + current_step = 0, + percentage = 0, + value = 1.337, + upper_limit = 1.337, + duration_seconds = 1.337, + counts_down = True, + is_running = True, + metrics = [ + activitysmith_openapi.models.activity_metric.ActivityMetric( + label = '0', + value = null, + unit = '', + color = 'lime', ) + ], + message = '0', + icon = activitysmith_openapi.models.live_activity_alert_icon.LiveActivityAlertIcon( + symbol = '0', + color = 'lime', ), + badge = activitysmith_openapi.models.live_activity_alert_badge.LiveActivityAlertBadge( + title = '0', ), + type = 'segmented_progress', + color = 'lime', + step_color = 'lime', + step_colors = [ + 'lime' + ], ), + action = { + 'key' : null + }, + secondary_action = { + 'key' : null + } ) else: return LiveActivityUpdateRequest( activity_id = '', - content_state = { }, + content_state = activitysmith_openapi.models.content_state_update.ContentStateUpdate( + title = '', + subtitle = '', + number_of_steps = 1, + current_step = 0, + percentage = 0, + value = 1.337, + upper_limit = 1.337, + duration_seconds = 1.337, + counts_down = True, + is_running = True, + metrics = [ + activitysmith_openapi.models.activity_metric.ActivityMetric( + label = '0', + value = null, + unit = '', + color = 'lime', ) + ], + message = '0', + icon = activitysmith_openapi.models.live_activity_alert_icon.LiveActivityAlertIcon( + symbol = '0', + color = 'lime', ), + badge = activitysmith_openapi.models.live_activity_alert_badge.LiveActivityAlertBadge( + title = '0', ), + type = 'segmented_progress', + color = 'lime', + step_color = 'lime', + step_colors = [ + 'lime' + ], ), ) """ diff --git a/activitysmith_openapi/test/test_push_notification_action.py b/activitysmith_openapi/test/test_push_notification_action.py index 88bdba2..1746810 100644 --- a/activitysmith_openapi/test/test_push_notification_action.py +++ b/activitysmith_openapi/test/test_push_notification_action.py @@ -39,7 +39,7 @@ def make_instance(self, include_optional) -> PushNotificationAction: type = 'open_url', url = '', method = 'POST', - body = { } + body = None ) else: return PushNotificationAction( diff --git a/activitysmith_openapi/test/test_push_notification_request.py b/activitysmith_openapi/test/test_push_notification_request.py index e339292..52e38c8 100644 --- a/activitysmith_openapi/test/test_push_notification_request.py +++ b/activitysmith_openapi/test/test_push_notification_request.py @@ -45,10 +45,13 @@ def make_instance(self, include_optional) -> PushNotificationRequest: 'key' : null } ], - payload = { }, + payload = None, badge = 56, sound = '', - target = { } + target = activitysmith_openapi.models.channel_target.ChannelTarget( + channels = [ + '' + ], ) ) else: return PushNotificationRequest( diff --git a/activitysmith_openapi/test/test_stream_content_state.py b/activitysmith_openapi/test/test_stream_content_state.py index be39ec3..2b9c480 100644 --- a/activitysmith_openapi/test/test_stream_content_state.py +++ b/activitysmith_openapi/test/test_stream_content_state.py @@ -52,11 +52,19 @@ def make_instance(self, include_optional) -> StreamContentState: 'lime' ], metrics = [ - { } + activitysmith_openapi.models.activity_metric.ActivityMetric( + label = '0', + value = null, + unit = '', + color = 'lime', ) ], message = '0', - icon = { }, - badge = { }, + icon = activitysmith_openapi.models.live_activity_alert_icon.LiveActivityAlertIcon( + symbol = '0', + color = 'lime', ), + badge = activitysmith_openapi.models.live_activity_alert_badge.LiveActivityAlertBadge( + title = '0', + color = 'lime', ), auto_dismiss_seconds = 0, auto_dismiss_minutes = 0 ) From 93a7168b35cace14b9b845ab9dc5745abe4d704a Mon Sep 17 00:00:00 2001 From: bardonadam Date: Fri, 10 Jul 2026 20:36:16 +0700 Subject: [PATCH 2/4] feat: add badge count setter --- activitysmith/client.py | 8 ++++++++ tests/test_resources.py | 28 ++++++++++++++++++++++++++++ tests/test_smoke.py | 1 + 3 files changed, 37 insertions(+) diff --git a/activitysmith/client.py b/activitysmith/client.py index d7f75db..3f77380 100644 --- a/activitysmith/client.py +++ b/activitysmith/client.py @@ -9,6 +9,7 @@ from activitysmith_openapi.api.live_activities_api import LiveActivitiesApi from activitysmith_openapi.api.metrics_api import MetricsApi from activitysmith_openapi.api.push_notifications_api import PushNotificationsApi +from activitysmith_openapi.api.app_icon_badges_api import AppIconBadgesApi SDK_VERSION = "1.8.0" SDK_HEADER_NAME = "X-ActivitySmith-SDK" @@ -762,3 +763,10 @@ def __post_init__(self) -> None: self.notifications = NotificationsResource(PushNotificationsApi(api_client)) self.live_activities = LiveActivitiesResource(LiveActivitiesApi(api_client)) self.metrics = MetricsResource(MetricsApi(api_client)) + self._app_icon_badges = AppIconBadgesApi(api_client) + + def badge_count(self, value: int, *, channels: Any | None = None): + request = _compact_dict({"badge": value, "channels": channels}) + return self._app_icon_badges.update_app_icon_badge_count( + app_icon_badge_count_update_request=_normalize_channels_target(request) + ) diff --git a/tests/test_resources.py b/tests/test_resources.py index 03b6dfd..e5f948e 100644 --- a/tests/test_resources.py +++ b/tests/test_resources.py @@ -50,6 +50,16 @@ def update_metric_value(self, **kwargs): return kwargs +class FakeAppIconBadgesApi: + def __init__(self, _api_client): + self._api_client = _api_client + self.calls = [] + + def update_app_icon_badge_count(self, **kwargs): + self.calls.append(kwargs) + return kwargs + + def test_sdk_header_and_user_agent_are_configured(monkeypatch): monkeypatch.setattr(client_module, "PushNotificationsApi", FakePushNotificationsApi) monkeypatch.setattr(client_module, "LiveActivitiesApi", FakeLiveActivitiesApi) @@ -82,6 +92,24 @@ def test_notifications_short_and_legacy_alias(monkeypatch): ] +def test_badge_count_clears_and_targets_channels(monkeypatch): + monkeypatch.setattr(client_module, "AppIconBadgesApi", FakeAppIconBadgesApi) + + client = ActivitySmith(api_key="x") + + cleared = client.badge_count(0) + targeted = client.badge_count(3, channels="sales,customer-success") + + assert cleared == {"app_icon_badge_count_update_request": {"badge": 0}} + assert targeted == { + "app_icon_badge_count_update_request": { + "badge": 3, + "target": {"channels": ["sales", "customer-success"]}, + } + } + assert client._app_icon_badges.calls == [cleared, targeted] + + def test_notifications_named_fields(monkeypatch): monkeypatch.setattr(client_module, "PushNotificationsApi", FakePushNotificationsApi) monkeypatch.setattr(client_module, "LiveActivitiesApi", FakeLiveActivitiesApi) diff --git a/tests/test_smoke.py b/tests/test_smoke.py index f311dca..802deba 100644 --- a/tests/test_smoke.py +++ b/tests/test_smoke.py @@ -12,3 +12,4 @@ def test_client_constructs(): assert hasattr(client.live_activities, "end") assert hasattr(client.live_activities, "stream") assert hasattr(client.live_activities, "end_stream") + assert hasattr(client, "badge_count") From 148f6a52b87b2ec3198f0c99a0bd8b064030a2f7 Mon Sep 17 00:00:00 2001 From: bardonadam Date: Fri, 10 Jul 2026 21:19:31 +0700 Subject: [PATCH 3/4] docs: document app icon badge count --- README.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 39b28a0..80ddee1 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ See the [API reference](https://activitysmith.com/docs/api-reference/introductio - [Live Activity Colors](#live-activity-colors) - [Channels](#channels) - [Widgets](#widgets) +- [App Icon Badge Count](#app-icon-badge-count) ## Installation @@ -515,7 +516,7 @@ Choose from these colors for the Live Activity accent, including progress bars a ## Channels -Channels are used to target specific team members or devices. Can be used for both push notifications and live activities. +Use `channels` to target specific team members or devices ```python activitysmith.notifications.send( @@ -547,6 +548,30 @@ String metric values work too. activitysmith.metrics.update("prod.status", "healthy") ``` +## App Icon Badge Count + +

+ ActivitySmith app icon with an App Icon Badge Count +

+ +Show the number you care about on your ActivitySmith app icon. Track MRR, a customer count, a stock price, or any other value you want to keep in view. + +```python +activitysmith.badge_count(8333) +``` + +Pass `0` to clear the badge. + +```python +activitysmith.badge_count(0) +``` + +Use `channels` to target specific team members or devices + +```python +activitysmith.badge_count(3, channels=["sales", "customer-success"]) +``` + ## Error Handling ```python From 3ebc819dbd17b10842b0264539473657ec7277fe Mon Sep 17 00:00:00 2001 From: bardonadam Date: Sat, 11 Jul 2026 15:29:14 +0700 Subject: [PATCH 4/4] chore: prepare 1.9.0 release --- CHANGELOG.md | 5 +++++ README.md | 46 ++++++++++++++++++++++++++++------------- activitysmith/client.py | 2 +- pyproject.toml | 2 +- 4 files changed, 39 insertions(+), 16 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..9485214 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +## 1.9.0 + +### New Features + +- **New Feature: App Icon Badge Count** - Show MRR, user counts, stock prices, and more on your ActivitySmith app icon. diff --git a/README.md b/README.md index 80ddee1..9dc852a 100644 --- a/README.md +++ b/README.md @@ -20,9 +20,9 @@ See the [API reference](https://activitysmith.com/docs/api-reference/introductio - [Live Activity Action](#live-activity-action) - [Icons and Badges](#icons-and-badges) - [Live Activity Colors](#live-activity-colors) -- [Channels](#channels) - [Widgets](#widgets) - [App Icon Badge Count](#app-icon-badge-count) +- [Channels](#channels) ## Installation @@ -514,18 +514,6 @@ Choose from these colors for the Live Activity accent, including progress bars a `lime`, `green`, `cyan`, `blue`, `purple`, `magenta`, `red`, `orange`, `yellow`, `gray` -## Channels - -Use `channels` to target specific team members or devices - -```python -activitysmith.notifications.send( - title="New subscription 💸", - message="Customer upgraded to Pro plan", - channels=["sales", "customer-success"], # Optional -) -``` - ## Widgets

@@ -556,18 +544,48 @@ activitysmith.metrics.update("prod.status", "healthy") Show the number you care about on your ActivitySmith app icon. Track MRR, a customer count, a stock price, or any other value you want to keep in view. +Set or update the badge value. + ```python activitysmith.badge_count(8333) ``` -Pass `0` to clear the badge. +To clear the badge, set its value to 0. ```python activitysmith.badge_count(0) ``` +## Channels + Use `channels` to target specific team members or devices +### Push Notifications + +```python +activitysmith.notifications.send( + title="New subscription 💸", + message="Customer upgraded to Pro plan", + channels=["sales", "customer-success"], +) +``` + +### Live Activities + +```python +activitysmith.live_activities.start( + content_state=content_state( + title="Nightly Database Backup", + subtitle="verify restore", + type="progress", + percentage=62, + ), + channels=["sales", "customer-success"], +) +``` + +### App Icon Badge Count + ```python activitysmith.badge_count(3, channels=["sales", "customer-success"]) ``` diff --git a/activitysmith/client.py b/activitysmith/client.py index 3f77380..53891ec 100644 --- a/activitysmith/client.py +++ b/activitysmith/client.py @@ -11,7 +11,7 @@ from activitysmith_openapi.api.push_notifications_api import PushNotificationsApi from activitysmith_openapi.api.app_icon_badges_api import AppIconBadgesApi -SDK_VERSION = "1.8.0" +SDK_VERSION = "1.9.0" SDK_HEADER_NAME = "X-ActivitySmith-SDK" SDK_HEADER_VALUE = f"python-v{SDK_VERSION}" diff --git a/pyproject.toml b/pyproject.toml index 2713b76..f249411 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "activitysmith" -version = "1.8.0" +version = "1.9.0" description = "Official ActivitySmith Python SDK" readme = "README.md" requires-python = ">=3.9"