From 4260709c5a42b28a08b65df0abc16e9870fa3c78 Mon Sep 17 00:00:00 2001 From: activitysmith-bot Date: Sat, 9 May 2026 12:03:24 +0000 Subject: [PATCH] chore: regenerate SDK --- activitysmith_openapi/__init__.py | 2 +- .../api/live_activities_api.py | 18 +++++++++--------- activitysmith_openapi/api_client.py | 2 +- activitysmith_openapi/configuration.py | 2 +- activitysmith_openapi/docs/ContentStateEnd.md | 4 ++-- .../docs/ContentStateStart.md | 4 ++-- .../docs/ContentStateUpdate.md | 4 ++-- .../docs/LiveActivitiesApi.md | 6 +++--- .../docs/MetricValueUpdateRequest.md | 1 - activitysmith_openapi/docs/MetricsApi.md | 2 +- .../docs/StreamContentState.md | 4 ++-- .../models/content_state_end.py | 8 ++++---- .../models/content_state_start.py | 8 ++++---- .../models/content_state_update.py | 8 ++++---- .../models/metric_value_update_request.py | 11 ++++------- .../models/stream_content_state.py | 8 ++++---- .../test/test_metric_value_update_request.py | 3 +-- 17 files changed, 45 insertions(+), 50 deletions(-) diff --git a/activitysmith_openapi/__init__.py b/activitysmith_openapi/__init__.py index 52f25d7..955b471 100644 --- a/activitysmith_openapi/__init__.py +++ b/activitysmith_openapi/__init__.py @@ -14,7 +14,7 @@ """ # noqa: E501 -__version__ = "1.2.1" +__version__ = "1.2.2" # import apis into sdk package from activitysmith_openapi.api.live_activities_api import LiveActivitiesApi diff --git a/activitysmith_openapi/api/live_activities_api.py b/activitysmith_openapi/api/live_activities_api.py index d9d6b48..8e51373 100644 --- a/activitysmith_openapi/api/live_activities_api.py +++ b/activitysmith_openapi/api/live_activities_api.py @@ -67,7 +67,7 @@ def end_live_activity( ) -> LiveActivityEndResponse: """End a Live Activity - Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. + Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. :param live_activity_end_request: (required) :type live_activity_end_request: LiveActivityEndRequest @@ -136,7 +136,7 @@ def end_live_activity_with_http_info( ) -> ApiResponse[LiveActivityEndResponse]: """End a Live Activity - Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. + Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. :param live_activity_end_request: (required) :type live_activity_end_request: LiveActivityEndRequest @@ -205,7 +205,7 @@ def end_live_activity_without_preload_content( ) -> RESTResponseType: """End a Live Activity - Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. + Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. :param live_activity_end_request: (required) :type live_activity_end_request: LiveActivityEndRequest @@ -940,7 +940,7 @@ def start_live_activity( ) -> LiveActivityStartResponse: """Start a Live Activity - Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. + Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. :param live_activity_start_request: (required) :type live_activity_start_request: LiveActivityStartRequest @@ -1011,7 +1011,7 @@ def start_live_activity_with_http_info( ) -> ApiResponse[LiveActivityStartResponse]: """Start a Live Activity - Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. + Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. :param live_activity_start_request: (required) :type live_activity_start_request: LiveActivityStartRequest @@ -1082,7 +1082,7 @@ def start_live_activity_without_preload_content( ) -> RESTResponseType: """Start a Live Activity - Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. + Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. :param live_activity_start_request: (required) :type live_activity_start_request: LiveActivityStartRequest @@ -1224,7 +1224,7 @@ def update_live_activity( ) -> LiveActivityUpdateResponse: """Update a Live Activity - Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. + Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. :param live_activity_update_request: (required) :type live_activity_update_request: LiveActivityUpdateRequest @@ -1293,7 +1293,7 @@ def update_live_activity_with_http_info( ) -> ApiResponse[LiveActivityUpdateResponse]: """Update a Live Activity - Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. + Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. :param live_activity_update_request: (required) :type live_activity_update_request: LiveActivityUpdateRequest @@ -1362,7 +1362,7 @@ def update_live_activity_without_preload_content( ) -> RESTResponseType: """Update a Live Activity - Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. + Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. :param live_activity_update_request: (required) :type live_activity_update_request: LiveActivityUpdateRequest diff --git a/activitysmith_openapi/api_client.py b/activitysmith_openapi/api_client.py index 054f3dc..0919ec1 100644 --- a/activitysmith_openapi/api_client.py +++ b/activitysmith_openapi/api_client.py @@ -88,7 +88,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.2.0/python' + self.user_agent = 'OpenAPI-Generator/1.2.2/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/activitysmith_openapi/configuration.py b/activitysmith_openapi/configuration.py index ac53963..f89fc18 100644 --- a/activitysmith_openapi/configuration.py +++ b/activitysmith_openapi/configuration.py @@ -393,7 +393,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 1.0.0\n"\ - "SDK Package Version: 1.2.0".\ + "SDK Package Version: 1.2.2".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/activitysmith_openapi/docs/ContentStateEnd.md b/activitysmith_openapi/docs/ContentStateEnd.md index 09917e5..9523ee9 100644 --- a/activitysmith_openapi/docs/ContentStateEnd.md +++ b/activitysmith_openapi/docs/ContentStateEnd.md @@ -1,6 +1,6 @@ # ContentStateEnd -End payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics include a non-empty metrics array. Type is optional when ending an existing activity. You can send an updated number_of_steps here if the workflow changed after start. +End payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. Type is optional when ending an existing activity. You can send an updated number_of_steps here if the workflow changed after start. ## Properties @@ -13,7 +13,7 @@ Name | Type | Description | Notes **percentage** | **float** | Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided. | [optional] **value** | **float** | Current progress value. Use with upper_limit for type=progress. | [optional] **upper_limit** | **float** | Maximum progress value. Use with value for type=progress. | [optional] -**metrics** | [**List[ActivityMetric]**](ActivityMetric.md) | Use for type=metrics. | [optional] +**metrics** | [**List[ActivityMetric]**](ActivityMetric.md) | Use for type=metrics or type=stats. | [optional] **type** | **str** | Optional. When omitted, the API uses the existing Live Activity type. | [optional] **color** | **str** | Optional. Accent color for the Live Activity. Defaults to blue. | [optional] [default to 'blue'] **step_color** | **str** | Optional. Overrides color for the current step. Only applies to type=segmented_progress. | [optional] diff --git a/activitysmith_openapi/docs/ContentStateStart.md b/activitysmith_openapi/docs/ContentStateStart.md index bbc04a1..bf65f9b 100644 --- a/activitysmith_openapi/docs/ContentStateStart.md +++ b/activitysmith_openapi/docs/ContentStateStart.md @@ -1,6 +1,6 @@ # ContentStateStart -Start payload requires title and type. For segmented_progress include number_of_steps and current_step. For progress include percentage or value with upper_limit. For metrics include a non-empty metrics array. 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 segmented_progress, number_of_steps is not locked and can be changed in later update or end calls. ## Properties @@ -13,7 +13,7 @@ Name | Type | Description | Notes **percentage** | **float** | Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided. | [optional] **value** | **float** | Current progress value. Use with upper_limit for type=progress. | [optional] **upper_limit** | **float** | Maximum progress value. Use with value for type=progress. | [optional] -**metrics** | [**List[ActivityMetric]**](ActivityMetric.md) | Use for type=metrics. | [optional] +**metrics** | [**List[ActivityMetric]**](ActivityMetric.md) | Use for type=metrics or type=stats. | [optional] **type** | **str** | | **color** | **str** | Optional. Accent color for the Live Activity. Defaults to blue. | [optional] [default to 'blue'] **step_color** | **str** | Optional. Overrides color for the current step. Only applies to type=segmented_progress. | [optional] diff --git a/activitysmith_openapi/docs/ContentStateUpdate.md b/activitysmith_openapi/docs/ContentStateUpdate.md index fac4197..fc2f398 100644 --- a/activitysmith_openapi/docs/ContentStateUpdate.md +++ b/activitysmith_openapi/docs/ContentStateUpdate.md @@ -1,6 +1,6 @@ # ContentStateUpdate -Update payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics include a non-empty metrics array. Type is optional when updating an existing activity. You can increase or decrease number_of_steps during updates. +Update payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. Type is optional when updating an existing activity. You can increase or decrease number_of_steps during updates. ## Properties @@ -13,7 +13,7 @@ Name | Type | Description | Notes **percentage** | **float** | Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided. | [optional] **value** | **float** | Current progress value. Use with upper_limit for type=progress. | [optional] **upper_limit** | **float** | Maximum progress value. Use with value for type=progress. | [optional] -**metrics** | [**List[ActivityMetric]**](ActivityMetric.md) | Use for type=metrics. | [optional] +**metrics** | [**List[ActivityMetric]**](ActivityMetric.md) | Use for type=metrics or type=stats. | [optional] **type** | **str** | Optional. When omitted, the API uses the existing Live Activity type. | [optional] **color** | **str** | Optional. Accent color for the Live Activity. Defaults to blue. | [optional] [default to 'blue'] **step_color** | **str** | Optional. Overrides color for the current step. Only applies to type=segmented_progress. | [optional] diff --git a/activitysmith_openapi/docs/LiveActivitiesApi.md b/activitysmith_openapi/docs/LiveActivitiesApi.md index baea488..423e2a2 100644 --- a/activitysmith_openapi/docs/LiveActivitiesApi.md +++ b/activitysmith_openapi/docs/LiveActivitiesApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description End a Live Activity -Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. +Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. ### Example @@ -266,7 +266,7 @@ Name | Type | Description | Notes Start a Live Activity -Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. +Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. ### Example @@ -349,7 +349,7 @@ Name | Type | Description | Notes Update a Live Activity -Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. +Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. ### Example diff --git a/activitysmith_openapi/docs/MetricValueUpdateRequest.md b/activitysmith_openapi/docs/MetricValueUpdateRequest.md index 70290f1..663f4f2 100644 --- a/activitysmith_openapi/docs/MetricValueUpdateRequest.md +++ b/activitysmith_openapi/docs/MetricValueUpdateRequest.md @@ -7,7 +7,6 @@ Latest metric value to display in widgets. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | [**MetricValueUpdateRequestValue**](MetricValueUpdateRequestValue.md) | | -**timestamp** | **datetime** | Optional ISO timestamp for when the metric value was measured. Defaults to the server receive time. | [optional] ## Example diff --git a/activitysmith_openapi/docs/MetricsApi.md b/activitysmith_openapi/docs/MetricsApi.md index 81cf084..3a31509 100644 --- a/activitysmith_openapi/docs/MetricsApi.md +++ b/activitysmith_openapi/docs/MetricsApi.md @@ -85,7 +85,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Metric value updated | - | -**400** | Bad request (invalid key, value, or timestamp) | - | +**400** | Bad request (invalid key or value) | - | **404** | Metric not found | - | **429** | Rate limit exceeded | - | diff --git a/activitysmith_openapi/docs/StreamContentState.md b/activitysmith_openapi/docs/StreamContentState.md index ec02902..1175334 100644 --- a/activitysmith_openapi/docs/StreamContentState.md +++ b/activitysmith_openapi/docs/StreamContentState.md @@ -1,6 +1,6 @@ # StreamContentState -Current state for a managed Live Activity stream. Include type on the first PUT, and whenever the stream may need to start a fresh activity. Supports segmented_progress, progress, and metrics types. +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, and stats types. ## Properties @@ -17,7 +17,7 @@ Name | Type | Description | Notes **color** | **str** | Optional. Accent color for the Live Activity. Defaults to blue. | [optional] [default to 'blue'] **step_color** | **str** | Optional. Overrides color for the current step. Only applies to segmented_progress. | [optional] **step_colors** | **List[str]** | Optional. Colors for completed steps. When used with segmented_progress, the array length should match current_step. | [optional] -**metrics** | [**List[ActivityMetric]**](ActivityMetric.md) | Use for metrics activities. | [optional] +**metrics** | [**List[ActivityMetric]**](ActivityMetric.md) | Use for metrics and stats activities. | [optional] **auto_dismiss_seconds** | **int** | Optional. Seconds before the ended Live Activity is dismissed. | [optional] **auto_dismiss_minutes** | **int** | Optional. Minutes before the ended Live Activity is dismissed. | [optional] diff --git a/activitysmith_openapi/models/content_state_end.py b/activitysmith_openapi/models/content_state_end.py index 7c17aa7..078baaf 100644 --- a/activitysmith_openapi/models/content_state_end.py +++ b/activitysmith_openapi/models/content_state_end.py @@ -26,7 +26,7 @@ class ContentStateEnd(BaseModel): """ - End payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics include a non-empty metrics array. Type is optional when ending an existing activity. You can send an updated number_of_steps here if the workflow changed after start. + End payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. Type is optional when ending an existing activity. You can send an updated number_of_steps here if the workflow changed after start. """ # noqa: E501 title: StrictStr subtitle: Optional[StrictStr] = None @@ -35,7 +35,7 @@ class ContentStateEnd(BaseModel): percentage: Optional[Union[Annotated[float, Field(le=100, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)]]] = Field(default=None, description="Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided.") value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Current progress value. Use with upper_limit for type=progress.") upper_limit: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Maximum progress value. Use with value for type=progress.") - metrics: Optional[Annotated[List[ActivityMetric], Field(min_length=1)]] = Field(default=None, description="Use for type=metrics.") + metrics: Optional[Annotated[List[ActivityMetric], Field(min_length=1, max_length=8)]] = Field(default=None, description="Use for type=metrics or type=stats.") type: Optional[StrictStr] = Field(default=None, description="Optional. When omitted, the API uses the existing Live Activity type.") color: Optional[StrictStr] = Field(default='blue', description="Optional. Accent color for the Live Activity. Defaults to blue.") step_color: Optional[StrictStr] = Field(default=None, description="Optional. Overrides color for the current step. Only applies to type=segmented_progress.") @@ -50,8 +50,8 @@ def type_validate_enum(cls, value): if value is None: return value - if value not in set(['segmented_progress', 'progress', 'metrics']): - raise ValueError("must be one of enum values ('segmented_progress', 'progress', 'metrics')") + if value not in set(['segmented_progress', 'progress', 'metrics', 'stats']): + raise ValueError("must be one of enum values ('segmented_progress', 'progress', 'metrics', 'stats')") return value @field_validator('color') diff --git a/activitysmith_openapi/models/content_state_start.py b/activitysmith_openapi/models/content_state_start.py index eabb4b6..dbf7886 100644 --- a/activitysmith_openapi/models/content_state_start.py +++ b/activitysmith_openapi/models/content_state_start.py @@ -26,7 +26,7 @@ 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 include a non-empty metrics array. 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 segmented_progress, number_of_steps is not locked and can be changed in later update or end calls. """ # noqa: E501 title: StrictStr subtitle: Optional[StrictStr] = None @@ -35,7 +35,7 @@ class ContentStateStart(BaseModel): percentage: Optional[Union[Annotated[float, Field(le=100, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)]]] = Field(default=None, description="Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided.") value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Current progress value. Use with upper_limit for type=progress.") upper_limit: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Maximum progress value. Use with value for type=progress.") - metrics: Optional[Annotated[List[ActivityMetric], Field(min_length=1)]] = Field(default=None, description="Use for type=metrics.") + metrics: Optional[Annotated[List[ActivityMetric], Field(min_length=1, max_length=8)]] = Field(default=None, description="Use for type=metrics or type=stats.") type: StrictStr color: Optional[StrictStr] = Field(default='blue', description="Optional. Accent color for the Live Activity. Defaults to blue.") step_color: Optional[StrictStr] = Field(default=None, description="Optional. Overrides color for the current step. Only applies to type=segmented_progress.") @@ -46,8 +46,8 @@ class ContentStateStart(BaseModel): @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in set(['segmented_progress', 'progress', 'metrics']): - raise ValueError("must be one of enum values ('segmented_progress', 'progress', 'metrics')") + if value not in set(['segmented_progress', 'progress', 'metrics', 'stats']): + raise ValueError("must be one of enum values ('segmented_progress', 'progress', 'metrics', 'stats')") return value @field_validator('color') diff --git a/activitysmith_openapi/models/content_state_update.py b/activitysmith_openapi/models/content_state_update.py index bb77a5c..1847774 100644 --- a/activitysmith_openapi/models/content_state_update.py +++ b/activitysmith_openapi/models/content_state_update.py @@ -26,7 +26,7 @@ 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 include a non-empty metrics array. Type is optional when updating an existing activity. You can increase or decrease number_of_steps during updates. + Update payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. Type is optional when updating an existing activity. You can increase or decrease number_of_steps during updates. """ # noqa: E501 title: StrictStr subtitle: Optional[StrictStr] = None @@ -35,7 +35,7 @@ class ContentStateUpdate(BaseModel): percentage: Optional[Union[Annotated[float, Field(le=100, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)]]] = Field(default=None, description="Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided.") value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Current progress value. Use with upper_limit for type=progress.") upper_limit: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Maximum progress value. Use with value for type=progress.") - metrics: Optional[Annotated[List[ActivityMetric], Field(min_length=1)]] = Field(default=None, description="Use for type=metrics.") + metrics: Optional[Annotated[List[ActivityMetric], Field(min_length=1, max_length=8)]] = Field(default=None, description="Use for type=metrics or type=stats.") type: Optional[StrictStr] = Field(default=None, description="Optional. When omitted, the API uses the existing Live Activity type.") color: Optional[StrictStr] = Field(default='blue', description="Optional. Accent color for the Live Activity. Defaults to blue.") step_color: Optional[StrictStr] = Field(default=None, description="Optional. Overrides color for the current step. Only applies to type=segmented_progress.") @@ -49,8 +49,8 @@ def type_validate_enum(cls, value): if value is None: return value - if value not in set(['segmented_progress', 'progress', 'metrics']): - raise ValueError("must be one of enum values ('segmented_progress', 'progress', 'metrics')") + if value not in set(['segmented_progress', 'progress', 'metrics', 'stats']): + raise ValueError("must be one of enum values ('segmented_progress', 'progress', 'metrics', 'stats')") return value @field_validator('color') diff --git a/activitysmith_openapi/models/metric_value_update_request.py b/activitysmith_openapi/models/metric_value_update_request.py index d90f96b..04a7510 100644 --- a/activitysmith_openapi/models/metric_value_update_request.py +++ b/activitysmith_openapi/models/metric_value_update_request.py @@ -17,9 +17,8 @@ import re # noqa: F401 import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List from activitysmith_openapi.models.metric_value_update_request_value import MetricValueUpdateRequestValue from typing import Optional, Set from typing_extensions import Self @@ -29,9 +28,8 @@ class MetricValueUpdateRequest(BaseModel): Latest metric value to display in widgets. """ # 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"] + __properties: ClassVar[List[str]] = ["value"] model_config = ConfigDict( populate_by_name=True, @@ -94,8 +92,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "value": MetricValueUpdateRequestValue.from_dict(obj["value"]) if obj.get("value") is not None else None, - "timestamp": obj.get("timestamp") + "value": MetricValueUpdateRequestValue.from_dict(obj["value"]) if obj.get("value") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/activitysmith_openapi/models/stream_content_state.py b/activitysmith_openapi/models/stream_content_state.py index be89634..d74f951 100644 --- a/activitysmith_openapi/models/stream_content_state.py +++ b/activitysmith_openapi/models/stream_content_state.py @@ -26,7 +26,7 @@ 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, and metrics types. + 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, and stats types. """ # noqa: E501 title: StrictStr subtitle: Optional[StrictStr] = None @@ -39,7 +39,7 @@ class StreamContentState(BaseModel): color: Optional[StrictStr] = Field(default='blue', description="Optional. Accent color for the Live Activity. Defaults to blue.") step_color: Optional[StrictStr] = Field(default=None, description="Optional. Overrides color for the current step. Only applies to segmented_progress.") step_colors: Optional[List[StrictStr]] = Field(default=None, description="Optional. Colors for completed steps. When used with segmented_progress, the array length should match current_step.") - metrics: Optional[Annotated[List[ActivityMetric], Field(min_length=1)]] = Field(default=None, description="Use for metrics activities.") + metrics: Optional[Annotated[List[ActivityMetric], Field(min_length=1, max_length=8)]] = Field(default=None, description="Use for metrics and stats activities.") 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] = {} @@ -51,8 +51,8 @@ def type_validate_enum(cls, value): if value is None: return value - if value not in set(['segmented_progress', 'progress', 'metrics']): - raise ValueError("must be one of enum values ('segmented_progress', 'progress', 'metrics')") + if value not in set(['segmented_progress', 'progress', 'metrics', 'stats']): + raise ValueError("must be one of enum values ('segmented_progress', 'progress', 'metrics', 'stats')") return value @field_validator('color') diff --git a/activitysmith_openapi/test/test_metric_value_update_request.py b/activitysmith_openapi/test/test_metric_value_update_request.py index 429e2fd..0877a7d 100644 --- a/activitysmith_openapi/test/test_metric_value_update_request.py +++ b/activitysmith_openapi/test/test_metric_value_update_request.py @@ -35,8 +35,7 @@ def make_instance(self, include_optional) -> MetricValueUpdateRequest: model = MetricValueUpdateRequest() if include_optional: return MetricValueUpdateRequest( - value = None, - timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + value = None ) else: return MetricValueUpdateRequest(