From 90f363e4e8cb5e3f6534ec8b7a39412bee1b3475 Mon Sep 17 00:00:00 2001 From: Sakina Date: Thu, 22 Oct 2026 17:58:09 -0400 Subject: [PATCH] chore(models): regenerate against pinned spec for media variants release/2026-08-25 picked up the media variant schemas in 87dd4b1, so regenerating against the pin produces 232 modules where 227 are committed, and the drift check in tests.yml fails. Regenerated with ./generate_models.sh 2026-08-25. Generated output only, nothing hand-edited. --- .../models/schemas/common/types/media.py | 50 +++++++++++++++-- .../common/types/media_external_video.py | 41 ++++++++++++++ .../schemas/common/types/media_image.py | 41 ++++++++++++++ .../schemas/common/types/media_model_3d.py | 49 +++++++++++++++++ .../schemas/common/types/media_source.py | 55 +++++++++++++++++++ .../schemas/common/types/media_video.py | 49 +++++++++++++++++ 6 files changed, 280 insertions(+), 5 deletions(-) create mode 100644 src/ucp_sdk/models/schemas/common/types/media_external_video.py create mode 100644 src/ucp_sdk/models/schemas/common/types/media_image.py create mode 100644 src/ucp_sdk/models/schemas/common/types/media_model_3d.py create mode 100644 src/ucp_sdk/models/schemas/common/types/media_source.py create mode 100644 src/ucp_sdk/models/schemas/common/types/media_video.py diff --git a/src/ucp_sdk/models/schemas/common/types/media.py b/src/ucp_sdk/models/schemas/common/types/media.py index b716792..7d40d94 100644 --- a/src/ucp_sdk/models/schemas/common/types/media.py +++ b/src/ucp_sdk/models/schemas/common/types/media.py @@ -20,10 +20,34 @@ from pydantic import AnyUrl, BaseModel, ConfigDict, Field +from . import media_source + + +class Preview(BaseModel): + """ + Poster/thumbnail still the Platform renders before or instead of the primary resource. A Business SHOULD provide it for `video`, `external_video`, and `model_3d` unless no suitable still exists, and MAY provide it for `image` as a low-resolution placeholder. + """ + + model_config = ConfigDict( + extra="allow", + ) + url: AnyUrl + """ + URL of the preview image. + """ + width: int | None = Field(None, ge=1) + """ + Pixel width of the preview image. + """ + height: int | None = Field(None, ge=1) + """ + Pixel height of the preview image. + """ + class Media(BaseModel): """ - Media item (image, video, etc.). + One logical media item — such as an image, a video, or a 3D model. `url` identifies the resource the Platform renders; `sources` lists alternate renditions; `preview` is a still. """ model_config = ConfigDict( @@ -31,11 +55,15 @@ class Media(BaseModel): ) type: str """ - Media type. Well-known values: `image`, `video`, `model_3d`. + Media type. Well-known values: `image`, `video`, `external_video`, `model_3d`. A Platform MUST NOT reject the containing object for an unrecognized value; it MAY present the item from `preview` and `name`, or omit it. """ url: AnyUrl """ - URL to the media resource. + URL of the media resource the Platform renders; interpretation is specialized per `type`. + """ + name: str | None = None + """ + Human-readable title or label for the media, distinct from `alt_text` (accessibility text). Often present for `video` and `model_3d`. """ alt_text: str | None = None """ @@ -43,9 +71,21 @@ class Media(BaseModel): """ width: int | None = Field(None, ge=1) """ - Width in pixels (for images/video). + Intrinsic pixel width of the media item, for image and video types; a rendition's own dimensions are on its `sources` entry. """ height: int | None = Field(None, ge=1) """ - Height in pixels (for images/video). + Intrinsic pixel height of the media item, for image and video types; a rendition's own dimensions are on its `sources` entry. + """ + duration: int | None = Field(None, ge=1) + """ + Duration in seconds, for time-based media such as `video` and `external_video`. + """ + preview: Preview | None = None + """ + Poster/thumbnail still the Platform renders before or instead of the primary resource. A Business SHOULD provide it for `video`, `external_video`, and `model_3d` unless no suitable still exists, and MAY provide it for `image` as a low-resolution placeholder. + """ + sources: list[media_source.MediaSource] | None = None + """ + Alternate renditions of the resource at `url`. The Business SHOULD include the rendition at `url`. """ diff --git a/src/ucp_sdk/models/schemas/common/types/media_external_video.py b/src/ucp_sdk/models/schemas/common/types/media_external_video.py new file mode 100644 index 0000000..7bb2c32 --- /dev/null +++ b/src/ucp_sdk/models/schemas/common/types/media_external_video.py @@ -0,0 +1,41 @@ +# Copyright 2026 UCP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# generated by datamodel-codegen +# pylint: disable=all +# pyformat: disable + +from __future__ import annotations + +from typing import Any + +from pydantic import BaseModel, ConfigDict + + +class MediaExternalVideo(BaseModel): + """ + Type-specific properties for a video presented through a third-party player. + """ + + model_config = ConfigDict( + extra="allow", + ) + url: Any | None = None + """ + The third-party player the Platform embeds. A video the Business serves as files from any origin, including a CDN, is `video`, not `external_video`. + """ + sources: Any | None = None + """ + Not used: a video presented through a player has no renditions. + """ diff --git a/src/ucp_sdk/models/schemas/common/types/media_image.py b/src/ucp_sdk/models/schemas/common/types/media_image.py new file mode 100644 index 0000000..7c6cd9e --- /dev/null +++ b/src/ucp_sdk/models/schemas/common/types/media_image.py @@ -0,0 +1,41 @@ +# Copyright 2026 UCP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# generated by datamodel-codegen +# pylint: disable=all +# pyformat: disable + +from __future__ import annotations + +from typing import Any + +from pydantic import BaseModel, ConfigDict + + +class MediaImage(BaseModel): + """ + Type-specific properties for image media. + """ + + model_config = ConfigDict( + extra="allow", + ) + url: Any | None = None + """ + A directly displayable image. + """ + sources: Any | None = None + """ + Alternate encodings and sizes of the image (e.g. `image/avif`, `image/webp`, `image/jpeg`; width variants for responsive layout). `url` SHOULD be the most broadly decodable rendition. + """ diff --git a/src/ucp_sdk/models/schemas/common/types/media_model_3d.py b/src/ucp_sdk/models/schemas/common/types/media_model_3d.py new file mode 100644 index 0000000..0754300 --- /dev/null +++ b/src/ucp_sdk/models/schemas/common/types/media_model_3d.py @@ -0,0 +1,49 @@ +# Copyright 2026 UCP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# generated by datamodel-codegen +# pylint: disable=all +# pyformat: disable + +from __future__ import annotations + +from typing import Any + +from pydantic import BaseModel, ConfigDict + + +class MediaModel3D(BaseModel): + """ + Type-specific properties for 3D model media. + """ + + model_config = ConfigDict( + extra="allow", + ) + url: Any | None = None + """ + The primary model file (e.g. GLB). + """ + width: Any | None = None + """ + Not applicable: a 3D model has no pixel dimensions. + """ + height: Any | None = None + """ + Not applicable: a 3D model has no pixel dimensions. + """ + sources: Any | None = None + """ + Alternate file formats of the model (glTF/GLB/USDZ). + """ diff --git a/src/ucp_sdk/models/schemas/common/types/media_source.py b/src/ucp_sdk/models/schemas/common/types/media_source.py new file mode 100644 index 0000000..0bf6491 --- /dev/null +++ b/src/ucp_sdk/models/schemas/common/types/media_source.py @@ -0,0 +1,55 @@ +# Copyright 2026 UCP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# generated by datamodel-codegen +# pylint: disable=all +# pyformat: disable + +from __future__ import annotations + +from pydantic import AnyUrl, BaseModel, ConfigDict, Field + + +class MediaSource(BaseModel): + """ + One encoded rendition of the parent media item: a format or resolution of an image or video, a streaming manifest, or a file format of a 3D model. The Platform selects a source by `mime_type` and dimensions. + """ + + model_config = ConfigDict( + extra="allow", + ) + url: AnyUrl + """ + URL to this rendition's file or streaming manifest. + """ + mime_type: str | None = None + """ + IANA media type of this source. A Platform MUST NOT reject the parent media item solely because this value is unknown, but MAY skip a source it cannot decode. Examples: `image/avif`, `image/webp`, `image/jpeg`, `video/mp4`, `video/webm`, `application/vnd.apple.mpegurl` (HLS), `application/dash+xml` (DASH), `model/gltf-binary` (GLB), `model/gltf+json` (glTF), `model/vnd.usdz+zip` (USDZ). + """ + format: str | None = None + """ + Short format token for display/selection. A Platform MUST NOT reject the parent media item solely because this value is unknown, but MAY skip a source it cannot decode. Examples: `avif`, `webp`, `jpg`, `mp4`, `webm`, `m3u8`, `mpd`, `glb`, `gltf`, `usdz`. + """ + width: int | None = Field(None, ge=1) + """ + Pixel width of this rendition. Omitted for adaptive manifests and 3D models. + """ + height: int | None = Field(None, ge=1) + """ + Pixel height of this rendition. Omitted for adaptive manifests and 3D models. + """ + filesize: int | None = Field(None, ge=1) + """ + File size in bytes. Lets the Platform decide whether to prefetch a large asset (e.g. a multi-megabyte 3D model). Omitted for adaptive-streaming manifests, whose total size is not fixed. + """ diff --git a/src/ucp_sdk/models/schemas/common/types/media_video.py b/src/ucp_sdk/models/schemas/common/types/media_video.py new file mode 100644 index 0000000..a463546 --- /dev/null +++ b/src/ucp_sdk/models/schemas/common/types/media_video.py @@ -0,0 +1,49 @@ +# Copyright 2026 UCP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# generated by datamodel-codegen +# pylint: disable=all +# pyformat: disable + +from __future__ import annotations + +from typing import Any + +from pydantic import BaseModel, ConfigDict + + +class MediaVideo(BaseModel): + """ + Type-specific properties for video media. + """ + + model_config = ConfigDict( + extra="allow", + ) + url: Any | None = None + """ + A playable rendition of the video: a progressive file or an adaptive-streaming manifest. + """ + width: Any | None = None + """ + Intrinsic pixel width of the video; a rendition's own dimensions are on its `sources` entry. + """ + height: Any | None = None + """ + Intrinsic pixel height of the video; a rendition's own dimensions are on its `sources` entry. + """ + sources: Any | None = None + """ + Alternate renditions (MP4/WebM) and adaptive manifests (HLS/DASH). + """