diff --git a/activitysmith_openapi/__init__.py b/activitysmith_openapi/__init__.py index f87021a..0805538 100644 --- a/activitysmith_openapi/__init__.py +++ b/activitysmith_openapi/__init__.py @@ -17,6 +17,7 @@ __version__ = "1.15.0" # import apis into sdk package +from activitysmith_openapi.api.account_api import AccountApi from activitysmith_openapi.api.app_icon_badges_api import AppIconBadgesApi from activitysmith_openapi.api.devices_api import DevicesApi from activitysmith_openapi.api.live_activities_api import LiveActivitiesApi @@ -38,6 +39,9 @@ from activitysmith_openapi.models.account_device import AccountDevice from activitysmith_openapi.models.account_device_list_response import AccountDeviceListResponse from activitysmith_openapi.models.account_device_list_response_meta import AccountDeviceListResponseMeta +from activitysmith_openapi.models.account_response import AccountResponse +from activitysmith_openapi.models.account_response_plan import AccountResponsePlan +from activitysmith_openapi.models.account_response_trial import AccountResponseTrial 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 diff --git a/activitysmith_openapi/api/__init__.py b/activitysmith_openapi/api/__init__.py index 4b47c17..9991d83 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.account_api import AccountApi from activitysmith_openapi.api.app_icon_badges_api import AppIconBadgesApi from activitysmith_openapi.api.devices_api import DevicesApi from activitysmith_openapi.api.live_activities_api import LiveActivitiesApi diff --git a/activitysmith_openapi/api/account_api.py b/activitysmith_openapi/api/account_api.py new file mode 100644 index 0000000..350e26b --- /dev/null +++ b/activitysmith_openapi/api/account_api.py @@ -0,0 +1,283 @@ +# 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.account_response import AccountResponse + +from activitysmith_openapi.api_client import ApiClient, RequestSerialized +from activitysmith_openapi.api_response import ApiResponse +from activitysmith_openapi.rest import RESTResponseType + + +class AccountApi: + """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 get_account( + self, + _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, + ) -> AccountResponse: + """Get account + + Returns the plan, the trial, and whether sends go through. Use it to check the trial before you send, or to explain a trial_expired or trial_exhausted error. API keys get no email or account owner flag. Channel-scoped API keys can read the account. + + :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._get_account_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountResponse", + '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 get_account_with_http_info( + self, + _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[AccountResponse]: + """Get account + + Returns the plan, the trial, and whether sends go through. Use it to check the trial before you send, or to explain a trial_expired or trial_exhausted error. API keys get no email or account owner flag. Channel-scoped API keys can read the account. + + :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._get_account_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountResponse", + '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 get_account_without_preload_content( + self, + _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: + """Get account + + Returns the plan, the trial, and whether sends go through. Use it to check the trial before you send, or to explain a trial_expired or trial_exhausted error. API keys get no email or account owner flag. Channel-scoped API keys can read the account. + + :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._get_account_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountResponse", + '429': "RateLimitError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_account_serialize( + self, + _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 + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'apiKeyAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/account', + 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/api/live_activities_api.py b/activitysmith_openapi/api/live_activities_api.py index 8b971ea..43b389f 100644 --- a/activitysmith_openapi/api/live_activities_api.py +++ b/activitysmith_openapi/api/live_activities_api.py @@ -642,7 +642,7 @@ def reconcile_live_activity_stream( ) -> LiveActivityStreamPutResponse: """Start a new Live Activity or update an existing one - Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them. + Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer, and timer_start_at when the timer started earlier, for example to show time already gone in the progress bar. Omit them on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them. :param stream_key: Stable identifier for one ongoing thing. Allowed characters: letters, numbers, underscores, and hyphens. (required) :type stream_key: str @@ -718,7 +718,7 @@ def reconcile_live_activity_stream_with_http_info( ) -> ApiResponse[LiveActivityStreamPutResponse]: """Start a new Live Activity or update an existing one - Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them. + Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer, and timer_start_at when the timer started earlier, for example to show time already gone in the progress bar. Omit them on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them. :param stream_key: Stable identifier for one ongoing thing. Allowed characters: letters, numbers, underscores, and hyphens. (required) :type stream_key: str @@ -794,7 +794,7 @@ def reconcile_live_activity_stream_without_preload_content( ) -> RESTResponseType: """Start a new Live Activity or update an existing one - Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them. + Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer, and timer_start_at when the timer started earlier, for example to show time already gone in the progress bar. Omit them on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them. :param stream_key: Stable identifier for one ongoing thing. Allowed characters: letters, numbers, underscores, and hyphens. (required) :type stream_key: str diff --git a/activitysmith_openapi/docs/AccountApi.md b/activitysmith_openapi/docs/AccountApi.md new file mode 100644 index 0000000..c6120f7 --- /dev/null +++ b/activitysmith_openapi/docs/AccountApi.md @@ -0,0 +1,84 @@ +# activitysmith_openapi.AccountApi + +All URIs are relative to *https://activitysmith.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_account**](AccountApi.md#get_account) | **GET** /account | Get account + + +# **get_account** +> AccountResponse get_account() + +Get account + +Returns the plan, the trial, and whether sends go through. Use it to check the trial before you send, or to explain a trial_expired or trial_exhausted error. API keys get no email or account owner flag. Channel-scoped API keys can read the account. + +### Example + +* Bearer (API Key) Authentication (apiKeyAuth): + +```python +import activitysmith_openapi +from activitysmith_openapi.models.account_response import AccountResponse +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.AccountApi(api_client) + + try: + # Get account + api_response = api_instance.get_account() + print("The response of AccountApi->get_account:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AccountApi->get_account: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**AccountResponse**](AccountResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Account plan and trial | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply.
* RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Listing devices has an IP limit of 600 requests and an account limit of 60 requests per 60 seconds.
| +**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/AccountResponse.md b/activitysmith_openapi/docs/AccountResponse.md new file mode 100644 index 0000000..ad67b6e --- /dev/null +++ b/activitysmith_openapi/docs/AccountResponse.md @@ -0,0 +1,36 @@ +# AccountResponse + +The account's plan and trial, and whether sends go through. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **str** | Email of the signed-in person. Null for API keys. | +**is_account_owner** | **bool** | True when the signed-in person owns the account. Null for API keys. | +**plan** | [**AccountResponsePlan**](AccountResponsePlan.md) | | +**trial** | [**AccountResponseTrial**](AccountResponseTrial.md) | | +**can_send** | **bool** | False when Push Notifications, Live Activities, App Icon Badge updates, and Lock Screen Widget values are paused until the account upgrades. | +**when_trial_ends** | **str** | What stops when the trial ends. Present only while a trial is running. | [optional] +**upgrade_url** | **str** | Where to upgrade. Set during a trial or without an active plan, otherwise null. | + +## Example + +```python +from activitysmith_openapi.models.account_response import AccountResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of AccountResponse from a JSON string +account_response_instance = AccountResponse.from_json(json) +# print the JSON string representation of the object +print(AccountResponse.to_json()) + +# convert the object into a dict +account_response_dict = account_response_instance.to_dict() +# create an instance of AccountResponse from a dict +account_response_from_dict = AccountResponse.from_dict(account_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/AccountResponsePlan.md b/activitysmith_openapi/docs/AccountResponsePlan.md new file mode 100644 index 0000000..3475af8 --- /dev/null +++ b/activitysmith_openapi/docs/AccountResponsePlan.md @@ -0,0 +1,33 @@ +# AccountResponsePlan + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **str** | trial: the free trial. subscription: a monthly or yearly plan. lifetime: a Lifetime Membership. grandfathered: an early account with free access. inactive: no trial and no active plan. | +**plan_id** | **str** | Plan ID, such as pro. Null during a trial or without a plan. | +**billing_interval** | **str** | month or year for subscriptions, otherwise null. | +**renews_at** | **datetime** | Next payment date of a subscription, otherwise null. | +**cancel_at_period_end** | **bool** | True when the subscription ends at the end of the current period. | + +## Example + +```python +from activitysmith_openapi.models.account_response_plan import AccountResponsePlan + +# TODO update the JSON string below +json = "{}" +# create an instance of AccountResponsePlan from a JSON string +account_response_plan_instance = AccountResponsePlan.from_json(json) +# print the JSON string representation of the object +print(AccountResponsePlan.to_json()) + +# convert the object into a dict +account_response_plan_dict = account_response_plan_instance.to_dict() +# create an instance of AccountResponsePlan from a dict +account_response_plan_from_dict = AccountResponsePlan.from_dict(account_response_plan_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/AccountResponseTrial.md b/activitysmith_openapi/docs/AccountResponseTrial.md new file mode 100644 index 0000000..a52227f --- /dev/null +++ b/activitysmith_openapi/docs/AccountResponseTrial.md @@ -0,0 +1,35 @@ +# AccountResponseTrial + +The trial while plan.status is trial, otherwise null. Time trials have ends_at and days_left. Older event trials have events_used and event_limit. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | +**ends_at** | **datetime** | When a time trial ends. | [optional] +**days_left** | **int** | Days left in a time trial. 0 after it ends. | [optional] +**events_used** | **int** | Events used in an event trial. | [optional] +**event_limit** | **int** | Events included in an event trial. | [optional] +**ended** | **bool** | True when the trial has ended or its events are used up. | + +## Example + +```python +from activitysmith_openapi.models.account_response_trial import AccountResponseTrial + +# TODO update the JSON string below +json = "{}" +# create an instance of AccountResponseTrial from a JSON string +account_response_trial_instance = AccountResponseTrial.from_json(json) +# print the JSON string representation of the object +print(AccountResponseTrial.to_json()) + +# convert the object into a dict +account_response_trial_dict = account_response_trial_instance.to_dict() +# create an instance of AccountResponseTrial from a dict +account_response_trial_from_dict = AccountResponseTrial.from_dict(account_response_trial_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/ContentStateStart.md b/activitysmith_openapi/docs/ContentStateStart.md index 2a8422f..baedd53 100644 --- a/activitysmith_openapi/docs/ContentStateStart.md +++ b/activitysmith_openapi/docs/ContentStateStart.md @@ -1,19 +1,21 @@ # ContentStateStart -Start payload requires title and type. For segmented_progress include number_of_steps and current_step. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For value include a string or number in value; strings preserve currency, units, and other formatting. For alert include message. For timer include duration_seconds for countdowns, or set counts_down false without duration_seconds for an open-ended elapsed timer. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, segmented_progress, and value. For segmented_progress, number_of_steps is not locked and can be changed in later update or end calls. +Start payload requires title and type. For segmented_progress include number_of_steps and current_step. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For value include a string or number in value; strings preserve currency, units, and other formatting. For alert include message. For timer include duration_seconds or timer_end_at for countdowns, or set counts_down false without them for an open-ended elapsed timer. Add timer_start_at for a timer that started earlier. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, segmented_progress, and value. For segmented_progress, number_of_steps is not locked and can be changed in later update or end calls. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**title** | **str** | | +**title** | **str** | Title shown on the Live Activity. Send an empty string to show no title. | **subtitle** | **str** | | [optional] **number_of_steps** | **int** | Total number of steps. Use for type=segmented_progress. This value can be increased or decreased later when updating or ending the same activity. | [optional] **current_step** | **int** | Current completed step count. Use for type=segmented_progress. Set 0 when the activity has started but no segment is complete yet. Must be less than or equal to number_of_steps. | [optional] **percentage** | **float** | Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided. | [optional] **value** | [**LiveActivityValue**](LiveActivityValue.md) | For type=value, the required prominent readout (string or finite number); strings preserve exact formatting. For type=progress, a numeric progress value used with upper_limit. | [optional] **upper_limit** | **float** | Maximum progress value. Use with value for type=progress. | [optional] -**duration_seconds** | **float** | Timer duration in seconds. For type=timer countdowns, required on start when counts_down is true or omitted. | [optional] +**duration_seconds** | **float** | Timer duration in seconds. For type=timer countdowns, required on start when counts_down is true or omitted, unless you send timer_end_at. Counts from timer_start_at when you send it. | [optional] +**timer_start_at** | **datetime** | Use with type=timer. ISO 8601 date and time when the timer started. It can be in the past, so a countdown that started earlier shows the time already gone in its progress bar. Defaults to the request time. Must not be in the future. | [optional] +**timer_end_at** | **datetime** | Use with type=timer. ISO 8601 date and time when the countdown ends. Must be after timer_start_at, or in the future when timer_start_at is omitted. Send duration_seconds or timer_end_at, not both. | [optional] **counts_down** | **bool** | Use with type=timer. When true or omitted, the timer counts down from duration_seconds. Set false for an elapsed timer; omit duration_seconds for an open-ended elapsed timer. | [optional] [default to True] **is_running** | **bool** | Use with type=timer. Defaults to true. Set false to pause/freeze via API; set true on a paused timer to resume. | [optional] [default to True] **metrics** | [**List[ActivityMetric]**](ActivityMetric.md) | Use for type=metrics or type=stats. | [optional] diff --git a/activitysmith_openapi/docs/ContentStateUpdate.md b/activitysmith_openapi/docs/ContentStateUpdate.md index 2eafb72..68accb8 100644 --- a/activitysmith_openapi/docs/ContentStateUpdate.md +++ b/activitysmith_openapi/docs/ContentStateUpdate.md @@ -6,14 +6,16 @@ Update payload requires title. For segmented_progress include current_step and o Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**title** | **str** | | +**title** | **str** | Title shown on the Live Activity. Send an empty string to show no title. | **subtitle** | **str** | | [optional] **number_of_steps** | **int** | Total number of steps. Use for type=segmented_progress. Optional on update, and safe to change if the workflow gains or loses steps. | [optional] **current_step** | **int** | Current completed step count. Use for type=segmented_progress. Set 0 when no segment is complete yet. Must be less than or equal to number_of_steps when number_of_steps is provided. | [optional] **percentage** | **float** | Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided. | [optional] **value** | [**LiveActivityValue**](LiveActivityValue.md) | For type=value, the required prominent readout (string or finite number); strings preserve exact formatting. For type=progress, a numeric progress value used with upper_limit. | [optional] **upper_limit** | **float** | Maximum progress value. Use with value for type=progress. | [optional] -**duration_seconds** | **float** | Timer duration in seconds. For type=timer, sending duration_seconds resets the timer window from the update request time; omit it to preserve the existing timer window. | [optional] +**duration_seconds** | **float** | Timer duration in seconds. For type=timer, sending duration_seconds resets the timer window from the update request time, or from timer_start_at when you send it. Omit it to preserve the existing timer window. | [optional] +**timer_start_at** | **datetime** | Use with type=timer. ISO 8601 date and time when the timer started. It can be in the past, so a countdown that started earlier shows the time already gone in its progress bar. Defaults to the request time. Must not be in the future. | [optional] +**timer_end_at** | **datetime** | Use with type=timer. ISO 8601 date and time when the countdown ends. Must be after timer_start_at, or in the future when timer_start_at is omitted. Send duration_seconds or timer_end_at, not both. Send timer_end_at alone to move the end and keep the current start. | [optional] **counts_down** | **bool** | Use with type=timer. When true or omitted, the timer counts down from duration_seconds. Set false for an elapsed timer; omit duration_seconds for an open-ended elapsed timer. | [optional] [default to True] **is_running** | **bool** | Use with type=timer. Defaults to true. Set false to pause/freeze via API; set true on a paused timer to resume. | [optional] [default to True] **metrics** | [**List[ActivityMetric]**](ActivityMetric.md) | Use for type=metrics or type=stats. | [optional] diff --git a/activitysmith_openapi/docs/LiveActivitiesApi.md b/activitysmith_openapi/docs/LiveActivitiesApi.md index 32004df..7e030f1 100644 --- a/activitysmith_openapi/docs/LiveActivitiesApi.md +++ b/activitysmith_openapi/docs/LiveActivitiesApi.md @@ -181,7 +181,7 @@ Name | Type | Description | Notes Start a new Live Activity or update an existing one -Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them. +Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer, and timer_start_at when the timer started earlier, for example to show time already gone in the progress bar. Omit them on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them. ### Example diff --git a/activitysmith_openapi/docs/StreamContentState.md b/activitysmith_openapi/docs/StreamContentState.md index 60730c6..4fc8e9f 100644 --- a/activitysmith_openapi/docs/StreamContentState.md +++ b/activitysmith_openapi/docs/StreamContentState.md @@ -1,19 +1,21 @@ # StreamContentState -Current state for a managed Live Activity stream. Include type on the first PUT, and whenever the stream may need to start a fresh activity. Supports segmented_progress, progress, metrics, stats, alert, timer, and value types. For timer, send duration_seconds to start or reset a bounded timer; omit duration_seconds on later updates to preserve the existing timer window. +Current state for a managed Live Activity stream. Include type on the first PUT, and whenever the stream may need to start a fresh activity. Supports segmented_progress, progress, metrics, stats, alert, timer, and value types. For timer, send duration_seconds or timer_end_at to start or reset a bounded timer, and timer_start_at for a timer that started earlier. Omit them on later updates to preserve the existing timer window. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**title** | **str** | | +**title** | **str** | Title shown on the Live Activity. Send an empty string to show no title. | **subtitle** | **str** | | [optional] **number_of_steps** | **int** | Use for segmented_progress. | [optional] **current_step** | **int** | Use for segmented_progress. Set 0 when no segment is complete yet. Must be less than or equal to number_of_steps when number_of_steps is provided. | [optional] **percentage** | **float** | Use for progress. Takes precedence over value/upper_limit if both are provided. | [optional] **value** | [**LiveActivityValue**](LiveActivityValue.md) | For type=value, the required prominent readout (string or finite number); strings preserve exact formatting. For progress, a numeric progress value used with upper_limit. | [optional] **upper_limit** | **float** | Maximum progress value. Use with value for progress. | [optional] -**duration_seconds** | **float** | Timer duration in seconds. For type=timer, send duration_seconds to start or reset the timer window; omit it on later stream updates to preserve the existing timer window. | [optional] +**duration_seconds** | **float** | Timer duration in seconds. For type=timer, send duration_seconds to start or reset the timer window, counted from timer_start_at when you send it. Omit it on later stream updates to preserve the existing timer window. | [optional] +**timer_start_at** | **datetime** | Use with type=timer. ISO 8601 date and time when the timer started. It can be in the past, so a countdown that started earlier shows the time already gone in its progress bar. Defaults to the request time. Must not be in the future. | [optional] +**timer_end_at** | **datetime** | Use with type=timer. ISO 8601 date and time when the countdown ends. Must be after timer_start_at, or in the future when timer_start_at is omitted. Send duration_seconds or timer_end_at, not both. On later stream updates, send timer_end_at alone to move the end and keep the current start. | [optional] **counts_down** | **bool** | Use with type=timer. When true or omitted, the timer counts down from duration_seconds. Set false for an elapsed timer; omit duration_seconds for an open-ended elapsed timer. | [optional] [default to True] **is_running** | **bool** | Use with type=timer. Defaults to true. Set false to pause/freeze via API; set true on a paused timer to resume. | [optional] [default to True] **type** | **str** | Required on the first PUT or whenever the stream cannot infer the current activity type. | [optional] diff --git a/activitysmith_openapi/models/__init__.py b/activitysmith_openapi/models/__init__.py index 8557384..62cf023 100644 --- a/activitysmith_openapi/models/__init__.py +++ b/activitysmith_openapi/models/__init__.py @@ -17,6 +17,9 @@ from activitysmith_openapi.models.account_device import AccountDevice from activitysmith_openapi.models.account_device_list_response import AccountDeviceListResponse from activitysmith_openapi.models.account_device_list_response_meta import AccountDeviceListResponseMeta +from activitysmith_openapi.models.account_response import AccountResponse +from activitysmith_openapi.models.account_response_plan import AccountResponsePlan +from activitysmith_openapi.models.account_response_trial import AccountResponseTrial 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 diff --git a/activitysmith_openapi/models/account_response.py b/activitysmith_openapi/models/account_response.py new file mode 100644 index 0000000..a9de7e7 --- /dev/null +++ b/activitysmith_openapi/models/account_response.py @@ -0,0 +1,122 @@ +# 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, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from activitysmith_openapi.models.account_response_plan import AccountResponsePlan +from activitysmith_openapi.models.account_response_trial import AccountResponseTrial +from typing import Optional, Set +from typing_extensions import Self + +class AccountResponse(BaseModel): + """ + The account's plan and trial, and whether sends go through. + """ # noqa: E501 + email: Optional[StrictStr] = Field(description="Email of the signed-in person. Null for API keys.") + is_account_owner: Optional[StrictBool] = Field(description="True when the signed-in person owns the account. Null for API keys.") + plan: AccountResponsePlan + trial: AccountResponseTrial + can_send: StrictBool = Field(description="False when Push Notifications, Live Activities, App Icon Badge updates, and Lock Screen Widget values are paused until the account upgrades.") + when_trial_ends: Optional[StrictStr] = Field(default=None, description="What stops when the trial ends. Present only while a trial is running.") + upgrade_url: Optional[StrictStr] = Field(description="Where to upgrade. Set during a trial or without an active plan, otherwise null.") + __properties: ClassVar[List[str]] = ["email", "is_account_owner", "plan", "trial", "can_send", "when_trial_ends", "upgrade_url"] + + 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 AccountResponse 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 plan + if self.plan: + _dict['plan'] = self.plan.to_dict() + # override the default output from pydantic by calling `to_dict()` of trial + if self.trial: + _dict['trial'] = self.trial.to_dict() + # set to None if email (nullable) is None + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: + _dict['email'] = None + + # set to None if is_account_owner (nullable) is None + # and model_fields_set contains the field + if self.is_account_owner is None and "is_account_owner" in self.model_fields_set: + _dict['is_account_owner'] = None + + # set to None if upgrade_url (nullable) is None + # and model_fields_set contains the field + if self.upgrade_url is None and "upgrade_url" in self.model_fields_set: + _dict['upgrade_url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AccountResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email": obj.get("email"), + "is_account_owner": obj.get("is_account_owner"), + "plan": AccountResponsePlan.from_dict(obj["plan"]) if obj.get("plan") is not None else None, + "trial": AccountResponseTrial.from_dict(obj["trial"]) if obj.get("trial") is not None else None, + "can_send": obj.get("can_send"), + "when_trial_ends": obj.get("when_trial_ends"), + "upgrade_url": obj.get("upgrade_url") + }) + return _obj + + diff --git a/activitysmith_openapi/models/account_response_plan.py b/activitysmith_openapi/models/account_response_plan.py new file mode 100644 index 0000000..2d277ad --- /dev/null +++ b/activitysmith_openapi/models/account_response_plan.py @@ -0,0 +1,118 @@ +# 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, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class AccountResponsePlan(BaseModel): + """ + AccountResponsePlan + """ # noqa: E501 + status: StrictStr = Field(description="trial: the free trial. subscription: a monthly or yearly plan. lifetime: a Lifetime Membership. grandfathered: an early account with free access. inactive: no trial and no active plan.") + plan_id: Optional[StrictStr] = Field(description="Plan ID, such as pro. Null during a trial or without a plan.") + billing_interval: Optional[StrictStr] = Field(description="month or year for subscriptions, otherwise null.") + renews_at: Optional[datetime] = Field(description="Next payment date of a subscription, otherwise null.") + cancel_at_period_end: StrictBool = Field(description="True when the subscription ends at the end of the current period.") + __properties: ClassVar[List[str]] = ["status", "plan_id", "billing_interval", "renews_at", "cancel_at_period_end"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['trial', 'subscription', 'lifetime', 'grandfathered', 'inactive']): + raise ValueError("must be one of enum values ('trial', 'subscription', 'lifetime', 'grandfathered', 'inactive')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AccountResponsePlan 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, + ) + # set to None if plan_id (nullable) is None + # and model_fields_set contains the field + if self.plan_id is None and "plan_id" in self.model_fields_set: + _dict['plan_id'] = None + + # set to None if billing_interval (nullable) is None + # and model_fields_set contains the field + if self.billing_interval is None and "billing_interval" in self.model_fields_set: + _dict['billing_interval'] = None + + # set to None if renews_at (nullable) is None + # and model_fields_set contains the field + if self.renews_at is None and "renews_at" in self.model_fields_set: + _dict['renews_at'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AccountResponsePlan from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status"), + "plan_id": obj.get("plan_id"), + "billing_interval": obj.get("billing_interval"), + "renews_at": obj.get("renews_at"), + "cancel_at_period_end": obj.get("cancel_at_period_end") + }) + return _obj + + diff --git a/activitysmith_openapi/models/account_response_trial.py b/activitysmith_openapi/models/account_response_trial.py new file mode 100644 index 0000000..a885e5c --- /dev/null +++ b/activitysmith_openapi/models/account_response_trial.py @@ -0,0 +1,106 @@ +# 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, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class AccountResponseTrial(BaseModel): + """ + The trial while plan.status is trial, otherwise null. Time trials have ends_at and days_left. Older event trials have events_used and event_limit. + """ # noqa: E501 + type: StrictStr + ends_at: Optional[datetime] = Field(default=None, description="When a time trial ends.") + days_left: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Days left in a time trial. 0 after it ends.") + events_used: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Events used in an event trial.") + event_limit: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Events included in an event trial.") + ended: StrictBool = Field(description="True when the trial has ended or its events are used up.") + __properties: ClassVar[List[str]] = ["type", "ends_at", "days_left", "events_used", "event_limit", "ended"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['time', 'events']): + raise ValueError("must be one of enum values ('time', 'events')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AccountResponseTrial 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 AccountResponseTrial from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "ends_at": obj.get("ends_at"), + "days_left": obj.get("days_left"), + "events_used": obj.get("events_used"), + "event_limit": obj.get("event_limit"), + "ended": obj.get("ended") + }) + return _obj + + diff --git a/activitysmith_openapi/models/content_state_start.py b/activitysmith_openapi/models/content_state_start.py index 568b5b3..f5ca440 100644 --- a/activitysmith_openapi/models/content_state_start.py +++ b/activitysmith_openapi/models/content_state_start.py @@ -17,6 +17,7 @@ import re # noqa: F401 import json +from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional, Union from typing_extensions import Annotated @@ -29,16 +30,18 @@ class ContentStateStart(BaseModel): """ - Start payload requires title and type. For segmented_progress include number_of_steps and current_step. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For value include a string or number in value; strings preserve currency, units, and other formatting. For alert include message. For timer include duration_seconds for countdowns, or set counts_down false without duration_seconds for an open-ended elapsed timer. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, segmented_progress, and value. For segmented_progress, number_of_steps is not locked and can be changed in later update or end calls. + Start payload requires title and type. For segmented_progress include number_of_steps and current_step. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For value include a string or number in value; strings preserve currency, units, and other formatting. For alert include message. For timer include duration_seconds or timer_end_at for countdowns, or set counts_down false without them for an open-ended elapsed timer. Add timer_start_at for a timer that started earlier. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, segmented_progress, and value. For segmented_progress, number_of_steps is not locked and can be changed in later update or end calls. """ # noqa: E501 - title: StrictStr + title: StrictStr = Field(description="Title shown on the Live Activity. Send an empty string to show no title.") subtitle: Optional[StrictStr] = None number_of_steps: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Total number of steps. Use for type=segmented_progress. This value can be increased or decreased later when updating or ending the same activity.") current_step: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Current completed step count. Use for type=segmented_progress. Set 0 when the activity has started but no segment is complete yet. Must be less than or equal to number_of_steps.") percentage: Optional[Union[Annotated[float, Field(le=100, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)]]] = Field(default=None, description="Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided.") value: Optional[LiveActivityValue] = Field(default=None, description="For type=value, the required prominent readout (string or finite number); strings preserve exact formatting. For type=progress, a numeric progress value used with upper_limit.") upper_limit: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Maximum progress value. Use with value for type=progress.") - duration_seconds: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Timer duration in seconds. For type=timer countdowns, required on start when counts_down is true or omitted.") + duration_seconds: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Timer duration in seconds. For type=timer countdowns, required on start when counts_down is true or omitted, unless you send timer_end_at. Counts from timer_start_at when you send it.") + timer_start_at: Optional[datetime] = Field(default=None, description="Use with type=timer. ISO 8601 date and time when the timer started. It can be in the past, so a countdown that started earlier shows the time already gone in its progress bar. Defaults to the request time. Must not be in the future.") + timer_end_at: Optional[datetime] = Field(default=None, description="Use with type=timer. ISO 8601 date and time when the countdown ends. Must be after timer_start_at, or in the future when timer_start_at is omitted. Send duration_seconds or timer_end_at, not both.") counts_down: Optional[StrictBool] = Field(default=True, description="Use with type=timer. When true or omitted, the timer counts down from duration_seconds. Set false for an elapsed timer; omit duration_seconds for an open-ended elapsed timer.") is_running: Optional[StrictBool] = Field(default=True, description="Use with type=timer. Defaults to true. Set false to pause/freeze via API; set true on a paused timer to resume.") metrics: Optional[Annotated[List[ActivityMetric], Field(min_length=1, max_length=8)]] = Field(default=None, description="Use for type=metrics or type=stats.") @@ -49,7 +52,7 @@ class ContentStateStart(BaseModel): color: Optional[StrictStr] = Field(default=None, description="Optional. Accent color for progress, segmented_progress, metrics, timer, and value Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included.") step_color: Optional[StrictStr] = Field(default=None, description="Optional. Overrides color for the current step. Only applies to type=segmented_progress.") step_colors: Optional[List[StrictStr]] = Field(default=None, description="Optional. Colors for completed steps. When used with segmented_progress, the array length should match current_step.") - __properties: ClassVar[List[str]] = ["title", "subtitle", "number_of_steps", "current_step", "percentage", "value", "upper_limit", "duration_seconds", "counts_down", "is_running", "metrics", "message", "icon", "badge", "type", "color", "step_color", "step_colors"] + __properties: ClassVar[List[str]] = ["title", "subtitle", "number_of_steps", "current_step", "percentage", "value", "upper_limit", "duration_seconds", "timer_start_at", "timer_end_at", "counts_down", "is_running", "metrics", "message", "icon", "badge", "type", "color", "step_color", "step_colors"] @field_validator('type') def type_validate_enum(cls, value): @@ -164,6 +167,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "value": LiveActivityValue.from_dict(obj["value"]) if obj.get("value") is not None else None, "upper_limit": obj.get("upper_limit"), "duration_seconds": obj.get("duration_seconds"), + "timer_start_at": obj.get("timer_start_at"), + "timer_end_at": obj.get("timer_end_at"), "counts_down": obj.get("counts_down") if obj.get("counts_down") is not None else True, "is_running": obj.get("is_running") if obj.get("is_running") is not None else True, "metrics": [ActivityMetric.from_dict(_item) for _item in obj["metrics"]] if obj.get("metrics") is not None else None, diff --git a/activitysmith_openapi/models/content_state_update.py b/activitysmith_openapi/models/content_state_update.py index 2b5ea94..805f881 100644 --- a/activitysmith_openapi/models/content_state_update.py +++ b/activitysmith_openapi/models/content_state_update.py @@ -17,6 +17,7 @@ import re # noqa: F401 import json +from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional, Union from typing_extensions import Annotated @@ -31,14 +32,16 @@ class ContentStateUpdate(BaseModel): """ Update payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For value include a string or number in value; strings preserve currency, units, and other formatting. For alert include message. For timer, omit duration_seconds to preserve the current timer window or send duration_seconds to reset the timer from the update request time. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, segmented_progress, and value. Type is optional when updating an existing activity. You can increase or decrease number_of_steps during updates. """ # noqa: E501 - title: StrictStr + title: StrictStr = Field(description="Title shown on the Live Activity. Send an empty string to show no title.") subtitle: Optional[StrictStr] = None number_of_steps: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Total number of steps. Use for type=segmented_progress. Optional on update, and safe to change if the workflow gains or loses steps.") current_step: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Current completed step count. Use for type=segmented_progress. Set 0 when no segment is complete yet. Must be less than or equal to number_of_steps when number_of_steps is provided.") percentage: Optional[Union[Annotated[float, Field(le=100, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)]]] = Field(default=None, description="Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided.") value: Optional[LiveActivityValue] = Field(default=None, description="For type=value, the required prominent readout (string or finite number); strings preserve exact formatting. For type=progress, a numeric progress value used with upper_limit.") upper_limit: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Maximum progress value. Use with value for type=progress.") - duration_seconds: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Timer duration in seconds. For type=timer, sending duration_seconds resets the timer window from the update request time; omit it to preserve the existing timer window.") + duration_seconds: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Timer duration in seconds. For type=timer, sending duration_seconds resets the timer window from the update request time, or from timer_start_at when you send it. Omit it to preserve the existing timer window.") + timer_start_at: Optional[datetime] = Field(default=None, description="Use with type=timer. ISO 8601 date and time when the timer started. It can be in the past, so a countdown that started earlier shows the time already gone in its progress bar. Defaults to the request time. Must not be in the future.") + timer_end_at: Optional[datetime] = Field(default=None, description="Use with type=timer. ISO 8601 date and time when the countdown ends. Must be after timer_start_at, or in the future when timer_start_at is omitted. Send duration_seconds or timer_end_at, not both. Send timer_end_at alone to move the end and keep the current start.") counts_down: Optional[StrictBool] = Field(default=True, description="Use with type=timer. When true or omitted, the timer counts down from duration_seconds. Set false for an elapsed timer; omit duration_seconds for an open-ended elapsed timer.") is_running: Optional[StrictBool] = Field(default=True, description="Use with type=timer. Defaults to true. Set false to pause/freeze via API; set true on a paused timer to resume.") metrics: Optional[Annotated[List[ActivityMetric], Field(min_length=1, max_length=8)]] = Field(default=None, description="Use for type=metrics or type=stats.") @@ -49,7 +52,7 @@ class ContentStateUpdate(BaseModel): color: Optional[StrictStr] = Field(default=None, description="Optional. Accent color for progress, segmented_progress, metrics, timer, and value Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included.") step_color: Optional[StrictStr] = Field(default=None, description="Optional. Overrides color for the current step. Only applies to type=segmented_progress.") step_colors: Optional[List[StrictStr]] = Field(default=None, description="Optional. Colors for completed steps. When used with segmented_progress, the array length should match current_step.") - __properties: ClassVar[List[str]] = ["title", "subtitle", "number_of_steps", "current_step", "percentage", "value", "upper_limit", "duration_seconds", "counts_down", "is_running", "metrics", "message", "icon", "badge", "type", "color", "step_color", "step_colors"] + __properties: ClassVar[List[str]] = ["title", "subtitle", "number_of_steps", "current_step", "percentage", "value", "upper_limit", "duration_seconds", "timer_start_at", "timer_end_at", "counts_down", "is_running", "metrics", "message", "icon", "badge", "type", "color", "step_color", "step_colors"] @field_validator('type') def type_validate_enum(cls, value): @@ -167,6 +170,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "value": LiveActivityValue.from_dict(obj["value"]) if obj.get("value") is not None else None, "upper_limit": obj.get("upper_limit"), "duration_seconds": obj.get("duration_seconds"), + "timer_start_at": obj.get("timer_start_at"), + "timer_end_at": obj.get("timer_end_at"), "counts_down": obj.get("counts_down") if obj.get("counts_down") is not None else True, "is_running": obj.get("is_running") if obj.get("is_running") is not None else True, "metrics": [ActivityMetric.from_dict(_item) for _item in obj["metrics"]] if obj.get("metrics") is not None else None, diff --git a/activitysmith_openapi/models/stream_content_state.py b/activitysmith_openapi/models/stream_content_state.py index e1e903a..47302fb 100644 --- a/activitysmith_openapi/models/stream_content_state.py +++ b/activitysmith_openapi/models/stream_content_state.py @@ -17,6 +17,7 @@ import re # noqa: F401 import json +from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional, Union from typing_extensions import Annotated @@ -29,16 +30,18 @@ class StreamContentState(BaseModel): """ - Current state for a managed Live Activity stream. Include type on the first PUT, and whenever the stream may need to start a fresh activity. Supports segmented_progress, progress, metrics, stats, alert, timer, and value types. For timer, send duration_seconds to start or reset a bounded timer; omit duration_seconds on later updates to preserve the existing timer window. + Current state for a managed Live Activity stream. Include type on the first PUT, and whenever the stream may need to start a fresh activity. Supports segmented_progress, progress, metrics, stats, alert, timer, and value types. For timer, send duration_seconds or timer_end_at to start or reset a bounded timer, and timer_start_at for a timer that started earlier. Omit them on later updates to preserve the existing timer window. """ # noqa: E501 - title: StrictStr + title: StrictStr = Field(description="Title shown on the Live Activity. Send an empty string to show no title.") subtitle: Optional[StrictStr] = None number_of_steps: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Use for segmented_progress.") current_step: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Use for segmented_progress. Set 0 when no segment is complete yet. Must be less than or equal to number_of_steps when number_of_steps is provided.") percentage: Optional[Union[Annotated[float, Field(le=100, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)]]] = Field(default=None, description="Use for progress. Takes precedence over value/upper_limit if both are provided.") value: Optional[LiveActivityValue] = Field(default=None, description="For type=value, the required prominent readout (string or finite number); strings preserve exact formatting. For progress, a numeric progress value used with upper_limit.") upper_limit: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Maximum progress value. Use with value for progress.") - duration_seconds: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Timer duration in seconds. For type=timer, send duration_seconds to start or reset the timer window; omit it on later stream updates to preserve the existing timer window.") + duration_seconds: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Timer duration in seconds. For type=timer, send duration_seconds to start or reset the timer window, counted from timer_start_at when you send it. Omit it on later stream updates to preserve the existing timer window.") + timer_start_at: Optional[datetime] = Field(default=None, description="Use with type=timer. ISO 8601 date and time when the timer started. It can be in the past, so a countdown that started earlier shows the time already gone in its progress bar. Defaults to the request time. Must not be in the future.") + timer_end_at: Optional[datetime] = Field(default=None, description="Use with type=timer. ISO 8601 date and time when the countdown ends. Must be after timer_start_at, or in the future when timer_start_at is omitted. Send duration_seconds or timer_end_at, not both. On later stream updates, send timer_end_at alone to move the end and keep the current start.") counts_down: Optional[StrictBool] = Field(default=True, description="Use with type=timer. When true or omitted, the timer counts down from duration_seconds. Set false for an elapsed timer; omit duration_seconds for an open-ended elapsed timer.") is_running: Optional[StrictBool] = Field(default=True, description="Use with type=timer. Defaults to true. Set false to pause/freeze via API; set true on a paused timer to resume.") type: Optional[StrictStr] = Field(default=None, description="Required on the first PUT or whenever the stream cannot infer the current activity type.") @@ -51,7 +54,7 @@ class StreamContentState(BaseModel): badge: Optional[LiveActivityAlertBadge] = Field(default=None, description="Optional badge. Supported by alert, progress, segmented_progress, and value.") auto_dismiss_seconds: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Optional. Seconds before the ended Live Activity is dismissed.") auto_dismiss_minutes: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Optional. Minutes before the ended Live Activity is dismissed.") - __properties: ClassVar[List[str]] = ["title", "subtitle", "number_of_steps", "current_step", "percentage", "value", "upper_limit", "duration_seconds", "counts_down", "is_running", "type", "color", "step_color", "step_colors", "metrics", "message", "icon", "badge", "auto_dismiss_seconds", "auto_dismiss_minutes"] + __properties: ClassVar[List[str]] = ["title", "subtitle", "number_of_steps", "current_step", "percentage", "value", "upper_limit", "duration_seconds", "timer_start_at", "timer_end_at", "counts_down", "is_running", "type", "color", "step_color", "step_colors", "metrics", "message", "icon", "badge", "auto_dismiss_seconds", "auto_dismiss_minutes"] @field_validator('type') def type_validate_enum(cls, value): @@ -169,6 +172,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "value": LiveActivityValue.from_dict(obj["value"]) if obj.get("value") is not None else None, "upper_limit": obj.get("upper_limit"), "duration_seconds": obj.get("duration_seconds"), + "timer_start_at": obj.get("timer_start_at"), + "timer_end_at": obj.get("timer_end_at"), "counts_down": obj.get("counts_down") if obj.get("counts_down") is not None else True, "is_running": obj.get("is_running") if obj.get("is_running") is not None else True, "type": obj.get("type"), diff --git a/activitysmith_openapi/openapi-source.json b/activitysmith_openapi/openapi-source.json index 6150a4d..2d9e351 100644 --- a/activitysmith_openapi/openapi-source.json +++ b/activitysmith_openapi/openapi-source.json @@ -1,6 +1,6 @@ { "repository": "ActivitySmithHQ/activitysmith-backend", - "commit": "15ba559268fc8a9faa46ac73ed6c5fdc96f7e4f7", + "commit": "ea70ae77f95de1abf300634bd2444d6a9f53a90c", "path": "openapi.json", - "sha256": "1964b1e64ee810e2dd4cadb41916e59b836720b8607ef60c298e3f990aeb9cb8" + "sha256": "9cdaf4d5ee7d1db109745b249951836237da02a25748cdc8baff89d54a0d3732" } diff --git a/activitysmith_openapi/test/test_account_api.py b/activitysmith_openapi/test/test_account_api.py new file mode 100644 index 0000000..faf227c --- /dev/null +++ b/activitysmith_openapi/test/test_account_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.account_api import AccountApi + + +class TestAccountApi(unittest.TestCase): + """AccountApi unit test stubs""" + + def setUp(self) -> None: + self.api = AccountApi() + + def tearDown(self) -> None: + pass + + def test_get_account(self) -> None: + """Test case for get_account + + Get account + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/activitysmith_openapi/test/test_account_response.py b/activitysmith_openapi/test/test_account_response.py new file mode 100644 index 0000000..8ff2720 --- /dev/null +++ b/activitysmith_openapi/test/test_account_response.py @@ -0,0 +1,85 @@ +# 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.account_response import AccountResponse + +class TestAccountResponse(unittest.TestCase): + """AccountResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AccountResponse: + """Test AccountResponse + 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 `AccountResponse` + """ + model = AccountResponse() + if include_optional: + return AccountResponse( + email = '', + is_account_owner = True, + plan = activitysmith_openapi.models.account_response_plan.AccountResponse_plan( + status = 'trial', + plan_id = '', + billing_interval = '', + renews_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + cancel_at_period_end = True, ), + trial = activitysmith_openapi.models.account_response_trial.AccountResponse_trial( + type = 'time', + ends_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + days_left = 0, + events_used = 0, + event_limit = 0, + ended = True, ), + can_send = True, + when_trial_ends = '', + upgrade_url = '' + ) + else: + return AccountResponse( + email = '', + is_account_owner = True, + plan = activitysmith_openapi.models.account_response_plan.AccountResponse_plan( + status = 'trial', + plan_id = '', + billing_interval = '', + renews_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + cancel_at_period_end = True, ), + trial = activitysmith_openapi.models.account_response_trial.AccountResponse_trial( + type = 'time', + ends_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + days_left = 0, + events_used = 0, + event_limit = 0, + ended = True, ), + can_send = True, + upgrade_url = '', + ) + """ + + def testAccountResponse(self): + """Test AccountResponse""" + # 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_account_response_plan.py b/activitysmith_openapi/test/test_account_response_plan.py new file mode 100644 index 0000000..fe65e11 --- /dev/null +++ b/activitysmith_openapi/test/test_account_response_plan.py @@ -0,0 +1,60 @@ +# 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.account_response_plan import AccountResponsePlan + +class TestAccountResponsePlan(unittest.TestCase): + """AccountResponsePlan unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AccountResponsePlan: + """Test AccountResponsePlan + 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 `AccountResponsePlan` + """ + model = AccountResponsePlan() + if include_optional: + return AccountResponsePlan( + status = 'trial', + plan_id = '', + billing_interval = '', + renews_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + cancel_at_period_end = True + ) + else: + return AccountResponsePlan( + status = 'trial', + plan_id = '', + billing_interval = '', + renews_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + cancel_at_period_end = True, + ) + """ + + def testAccountResponsePlan(self): + """Test AccountResponsePlan""" + # 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_account_response_trial.py b/activitysmith_openapi/test/test_account_response_trial.py new file mode 100644 index 0000000..124ce71 --- /dev/null +++ b/activitysmith_openapi/test/test_account_response_trial.py @@ -0,0 +1,58 @@ +# 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.account_response_trial import AccountResponseTrial + +class TestAccountResponseTrial(unittest.TestCase): + """AccountResponseTrial unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AccountResponseTrial: + """Test AccountResponseTrial + 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 `AccountResponseTrial` + """ + model = AccountResponseTrial() + if include_optional: + return AccountResponseTrial( + type = 'time', + ends_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + days_left = 0, + events_used = 0, + event_limit = 0, + ended = True + ) + else: + return AccountResponseTrial( + type = 'time', + ended = True, + ) + """ + + def testAccountResponseTrial(self): + """Test AccountResponseTrial""" + # 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_content_state_start.py b/activitysmith_openapi/test/test_content_state_start.py index 4a1a68c..e7adf88 100644 --- a/activitysmith_openapi/test/test_content_state_start.py +++ b/activitysmith_openapi/test/test_content_state_start.py @@ -43,6 +43,8 @@ def make_instance(self, include_optional) -> ContentStateStart: value = None, upper_limit = 1.337, duration_seconds = 1.337, + timer_start_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + timer_end_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), counts_down = True, is_running = True, metrics = [ diff --git a/activitysmith_openapi/test/test_content_state_update.py b/activitysmith_openapi/test/test_content_state_update.py index 11412f4..98125c1 100644 --- a/activitysmith_openapi/test/test_content_state_update.py +++ b/activitysmith_openapi/test/test_content_state_update.py @@ -43,6 +43,8 @@ def make_instance(self, include_optional) -> ContentStateUpdate: value = None, upper_limit = 1.337, duration_seconds = 1.337, + timer_start_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + timer_end_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), counts_down = True, is_running = True, metrics = [ diff --git a/activitysmith_openapi/test/test_live_activity_start_request.py b/activitysmith_openapi/test/test_live_activity_start_request.py index 9e3b610..3669bca 100644 --- a/activitysmith_openapi/test/test_live_activity_start_request.py +++ b/activitysmith_openapi/test/test_live_activity_start_request.py @@ -47,6 +47,8 @@ def make_instance(self, include_optional) -> LiveActivityStartRequest: value = null, upper_limit = 1.337, duration_seconds = 1.337, + timer_start_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + timer_end_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), counts_down = True, is_running = True, metrics = [ @@ -96,6 +98,8 @@ def make_instance(self, include_optional) -> LiveActivityStartRequest: value = null, upper_limit = 1.337, duration_seconds = 1.337, + timer_start_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + timer_end_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), counts_down = True, is_running = True, metrics = [ 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 fc63177..67e27eb 100644 --- a/activitysmith_openapi/test/test_live_activity_stream_delete_request.py +++ b/activitysmith_openapi/test/test_live_activity_stream_delete_request.py @@ -50,6 +50,8 @@ def make_instance(self, include_optional) -> LiveActivityStreamDeleteRequest: value = null, upper_limit = 1.337, duration_seconds = 1.337, + timer_start_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + timer_end_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), counts_down = True, is_running = True, type = 'segmented_progress', diff --git a/activitysmith_openapi/test/test_live_activity_stream_request.py b/activitysmith_openapi/test/test_live_activity_stream_request.py index 85398f6..ad343d4 100644 --- a/activitysmith_openapi/test/test_live_activity_stream_request.py +++ b/activitysmith_openapi/test/test_live_activity_stream_request.py @@ -47,6 +47,8 @@ def make_instance(self, include_optional) -> LiveActivityStreamRequest: value = null, upper_limit = 1.337, duration_seconds = 1.337, + timer_start_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + timer_end_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), counts_down = True, is_running = True, type = 'segmented_progress', @@ -101,6 +103,8 @@ def make_instance(self, include_optional) -> LiveActivityStreamRequest: value = null, upper_limit = 1.337, duration_seconds = 1.337, + timer_start_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + timer_end_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), counts_down = True, is_running = True, type = 'segmented_progress', diff --git a/activitysmith_openapi/test/test_live_activity_update_request.py b/activitysmith_openapi/test/test_live_activity_update_request.py index 88f37d6..160db36 100644 --- a/activitysmith_openapi/test/test_live_activity_update_request.py +++ b/activitysmith_openapi/test/test_live_activity_update_request.py @@ -51,6 +51,8 @@ def make_instance(self, include_optional) -> LiveActivityUpdateRequest: value = null, upper_limit = 1.337, duration_seconds = 1.337, + timer_start_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + timer_end_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), counts_down = True, is_running = True, metrics = [ @@ -91,6 +93,8 @@ def make_instance(self, include_optional) -> LiveActivityUpdateRequest: value = null, upper_limit = 1.337, duration_seconds = 1.337, + timer_start_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + timer_end_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), counts_down = True, is_running = True, metrics = [ diff --git a/activitysmith_openapi/test/test_stream_content_state.py b/activitysmith_openapi/test/test_stream_content_state.py index f36eb8b..f521f64 100644 --- a/activitysmith_openapi/test/test_stream_content_state.py +++ b/activitysmith_openapi/test/test_stream_content_state.py @@ -43,6 +43,8 @@ def make_instance(self, include_optional) -> StreamContentState: value = None, upper_limit = 1.337, duration_seconds = 1.337, + timer_start_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + timer_end_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), counts_down = True, is_running = True, type = 'segmented_progress',