diff --git a/flixpy/Makefile b/flixpy/Makefile index 11f227d..e7e098b 100644 --- a/flixpy/Makefile +++ b/flixpy/Makefile @@ -31,6 +31,8 @@ $(EXTENSION_API_OUT): .download $(addprefix $(EXTENSION_DIR),$(EXTENSION_API_OPE .PHONY: typecheck typecheck: .download + uv run ruff check + uv run ruff format --check uv run mypy .PHONY: build diff --git a/flixpy/flix/extension/client.py b/flixpy/flix/extension/client.py index f1df560..2a21fb8 100644 --- a/flixpy/flix/extension/client.py +++ b/flixpy/flix/extension/client.py @@ -6,7 +6,7 @@ import logging import warnings import weakref -from collections.abc import AsyncIterable, AsyncIterator, Coroutine +from collections.abc import AsyncIterable, AsyncIterator, Coroutine, Iterable, Mapping from http import HTTPStatus from typing import TYPE_CHECKING, Any, Self, TypeVar, cast @@ -47,6 +47,20 @@ def _assert_response(expect: type[T], resp: api_types.Response[U]) -> T: raise errors.FlixError(f"expected response type {expect}, got: {resp.content!r}") +def _query_ids(ids: Iterable[int] | None) -> str | api_types.Unset: + if ids is None: + return api_types.UNSET + + return ",".join(map(str, ids)) or api_types.UNSET + + +def _query_range(panel_range: tuple[int, int] | None) -> str | api_types.Unset: + if panel_range is None: + return api_types.UNSET + start, end = panel_range + return f"{start},{end}" + + _ET_co = TypeVar("_ET_co", bound=types.Event, covariant=True) @@ -155,13 +169,16 @@ class Extension: ``` """ - def __init__( + def __init__( # noqa: PLR0917 self, name: str, client_uid: str, log_paths: list[str] | None = None, version: str | None = None, base_url: str = BASE_URL, + actions: list[types.ActionRegistration] | None = None, + icon_svg: str | None = None, + short_name: str | None = None, ) -> None: """Initialise an Extension. @@ -172,6 +189,9 @@ def __init__( version: An optional version string for the extension base_url: The URL to use to connect to the Flix Client, if something other than the standard Flix Client port on localhost + actions: Actions to register with the Flix Client when the extension registers. + icon_svg: An SVG icon shown by default for the extension's actions in the UI. + short_name: A short name for the extension, used in the context menu. """ self.name = name @@ -179,6 +199,9 @@ def __init__( self.version = version self.base_url = base_url self.log_paths = log_paths + self.actions = actions or [] + self.icon_svg = icon_svg + self.short_name = short_name self.panel_browser_status = types.PanelBrowserStatus() self.project = types.ProjectDetails() self._online = False @@ -189,6 +212,7 @@ def __init__( self._register_events() self._queues = weakref.WeakSet[EventQueue[types.Event]]() self._connection_task: asyncio.Task[None] | None = None + self._pending_actions: list[types.ActionRegistration] | None = None def _reset_status(self) -> None: self.online = False @@ -199,6 +223,10 @@ async def _update_status(self) -> None: try: self.panel_browser_status = await self.get_status() self.project = await self.get_project_details() + + # update the client actions if any were set while the extension was disconnected + if self._pending_actions is not None: + await self.set_actions(self._pending_actions) except (errors.FlixError, httpx.HTTPError) as e: logger.warning("couldn't update Flix Client status on connect: %s", e) @@ -252,8 +280,12 @@ async def _on_connect(self) -> None: types.ClientEventType.PROJECT, types.ClientEventType.ACTION, types.ClientEventType.OPEN, + types.ClientEventType.PANEL_METADATA_UPDATE, + types.ClientEventType.PROJECT_METADATA_UPDATE, ], ) + + # skip the online check when emitting the subscriptions after the initial connection await self.sio.emit("subscribe", data=events.to_dict()) async def _on_disconnect(self) -> None: @@ -362,6 +394,9 @@ async def _get_registered_client(self) -> extension_api.AuthenticatedClient: from .extension_api.api.api_registration import registration_controller_register_client + # tegister the pending action list, if set_actions was called before registration + actions = self._pending_actions or self.actions + resp = _assert_response( models.RegistrationResponse, await registration_controller_register_client.asyncio_detailed( @@ -371,10 +406,18 @@ async def _get_registered_client(self) -> extension_api.AuthenticatedClient: client_uid=self.client_uid, version=self.version or api_types.UNSET, log_paths=self.log_paths or api_types.UNSET, + actions=[action.to_model() for action in actions] + if self.actions + else api_types.UNSET, + icon_svg=self.icon_svg or api_types.UNSET, + short_name=self.short_name or api_types.UNSET, ), ), ) + # clear any pending actions now that we've updated the action list during registration + self._pending_actions = None + self._registered_client = extension_api.AuthenticatedClient(self.base_url, resp.token) return self._registered_client @@ -453,13 +496,14 @@ async def get_current_versions(self) -> types.VersionResponse: return types.VersionResponse.from_model(resp) - async def import_panels( + async def import_panels( # noqa: PLR0917 self, paths: list[str], origin: str, source_file: types.SourceFile | None = None, start_index: int | None = None, replace_panels: bool = False, + skip_panel_reuse: bool | None = None, ) -> types.PanelRequestResponse: """Instructs the Flix Client to import the given files as panel revisions. @@ -470,13 +514,16 @@ async def import_panels( start_index: If specified, panels will be inserted at the given index. instead of the currently selected panel index. replace_panels: If True, version up existing panels instead of inserting new ones. + skip_panel_reuse: If set, will ignore the "Disable Panel Reuse" preference in the + Flix Client. When True, will always import panels as new panels. + When False, will always check for existing panels to reuse. """ from .extension_api.api.panel_management import ( panel_controller_create, panel_controller_update, ) - json_body = models.BulkPanelRequest( + body = models.BulkPanelRequest( paths=paths, origin=origin, source_file=models.PanelRequestSourceFile( @@ -487,20 +534,21 @@ async def import_panels( if source_file is not None else api_types.UNSET, start_index=start_index if start_index is not None else api_types.UNSET, + skip_panel_reuse=skip_panel_reuse if skip_panel_reuse is not None else api_types.UNSET, ) if not replace_panels: response = _assert_response( models.PanelRequestResponse, await panel_controller_create.asyncio_detailed( - client=await self._get_registered_client(), body=json_body + client=await self._get_registered_client(), body=body ), ) else: response = _assert_response( models.PanelRequestResponse, await panel_controller_update.asyncio_detailed( - client=await self._get_registered_client(), body=json_body + client=await self._get_registered_client(), body=body ), ) @@ -540,6 +588,204 @@ async def download( return types.DownloadResponse.from_dict(resp) + async def set_actions( + self, + actions: list[types.ActionRegistration], + ) -> list[types.ActionRegistration]: + """Update the list of custom actions registered for this extension. + + Requires Flix 9 or later. + + Args: + actions: The full list of actions this extension should have registered. + This replaces any previously registered actions. + + Returns: + The actions as registered by the Flix Client. + """ + from .extension_api.api.api_registration import ( + registration_controller_set_client_actions, + ) + + # cache the requested actions in a pending list in case the action update request fails + self._pending_actions = actions + + resp = _assert_response( + models.ActionsUpdateResponse, + await registration_controller_set_client_actions.asyncio_detailed( + client=await self._get_registered_client(), + body=models.ActionsUpdateRequest( + actions=[action.to_model() for action in actions], + ), + ), + ) + + # keep the stored actions in step, so that re-registering uses the latest list + self.actions = [types.ActionRegistration.from_dict(action) for action in resp.actions] + self._pending_actions = None + return self.actions + + async def get_panels( + self, + *, + selected: bool | None = None, + panel_ids: Iterable[int] | None = None, + panel_range: tuple[int, int] | None = None, + ) -> list[types.PanelRevisionDetails]: + """Get panels from the sequence revision currently open in the Panel Browser. + + With no arguments, all panels in the sequence revision are returned. The filters + can be combined; a panel must match every filter given to be returned. + + Requires Flix 9 or later. + + Args: + selected: If True, only return the currently selected panels. + panel_ids: If given, only return panels with these IDs. + panel_range: If given as `(start, end)`, only return panels placed between the + `start`th and `end`th panels (inclusive, 1-based). + + Returns: + The panel revisions that match the filters. + """ + from .extension_api.api.panel_management import panel_controller_get + + resp = _assert_response( + models.PanelDetailsResponse, + await panel_controller_get.asyncio_detailed( + client=await self._get_registered_client(), + selected=selected, + range_=_query_range(panel_range), + panel_ids=_query_ids(panel_ids), + ), + ) + + return [types.PanelRevisionDetails.from_dict(panel) for panel in resp.panels] + + async def update_panel_metadata( + self, + metadata: Mapping[str, str | None], + *, + selected: bool | None = None, + panel_ids: Iterable[int] | None = None, + panel_range: tuple[int, int] | None = None, + ) -> list[types.PanelMetadataUpdate]: + """Update metadata associated with panels in the current sequence revision. + + Adds new keys, updates the value for existing keys, removes keys set to None and leaves any + other keys unchanged. Recommendation: Use namespaced keys (for example, + `com.example.extension:status`) to avoid conflicts with other extensions. + + Requires Flix 9 or later. + + Args: + metadata: The key-value pairs to set on each matching panel. A value of None + deletes that key. + selected: If True, only update the currently selected panels. + panel_ids: If given, only update panels with these IDs. + panel_range: If given as `(start, end)`, only update panels placed between the + `start`th and `end`th panels (inclusive, 1-based). + + Returns: + The metadata of each panel after the update. + """ + from .extension_api.api.panel_management import panel_controller_update_metadata + + resp = _assert_response( + models.PanelUpdateMetadataResponse, + await panel_controller_update_metadata.asyncio_detailed( + client=await self._get_registered_client(), + body=models.PanelUpdateMetadataRequest( + metadata=models.PanelUpdateMetadataRequestMetadata.from_dict(dict(metadata)), + ), + selected=selected, + range_=_query_range(panel_range), + panel_ids=_query_ids(panel_ids), + ), + ) + + return [types.PanelMetadataUpdate.from_model(result) for result in resp.results] + + async def _emit_socket_message(self, event: str, data: dict[str, Any]) -> None: + if not self.online: + raise errors.FlixError("extension is not connected to the Flix Client") + + await self.sio.emit(event, data) + + async def track_panel(self, *, show_id: int, sequence_id: int, panel_id: int) -> None: + """Mark a panel as open in this extension. + + The request is sent as a `trackPanel` message over the websocket connection, + so the extension must be connected to the Flix Client. + + Raises: + errors.FlixError: If the extension is not connected to the Flix Client. + """ + await self._emit_socket_message( + "trackPanel", + models.PanelTrackRequest( + show_id=show_id, + sequence_id=sequence_id, + panel_id=panel_id, + ).to_dict(), + ) + + async def untrack_panel(self, *, show_id: int, sequence_id: int, panel_id: int) -> None: + """Mark a panel as no longer open in this extension. + + The request is sent as an `untrackPanel` message over the websocket connection, + so the extension must be connected to the Flix Client. + + Raises: + errors.FlixError: If the extension is not connected to the Flix Client. + """ + await self._emit_socket_message( + "untrackPanel", + models.PanelTrackRequest( + show_id=show_id, + sequence_id=sequence_id, + panel_id=panel_id, + ).to_dict(), + ) + + async def get_project_metadata(self) -> types.ProjectMetadata: + """Get the custom metadata of the show, episode, sequence and sequence revision. + + Requires Flix 9 or later. + """ + from .extension_api.api.project_metadata import project_metadata_controller_get + + resp = _assert_response( + models.ProjectDetailsMetadataDto, + await project_metadata_controller_get.asyncio_detailed( + client=await self._get_registered_client(), + ), + ) + + return types.ProjectMetadata.from_model(resp) + + async def update_project_metadata(self, metadata: types.ProjectMetadata) -> None: + """Merge custom metadata into the entities in the currently open project. + + Only entities whose field in `metadata` is not None are updated, and only the keys + provided are changed. A key set to None is deleted. The entities must exist in the + current project context. + + Requires Flix 9 or later. + + Args: + metadata: The metadata to merge into the current project. + """ + from .extension_api.api.project_metadata import ( + project_metadata_controller_update_metadata, + ) + + resp = await project_metadata_controller_update_metadata.asyncio_detailed( + client=await self._get_registered_client(), + body=metadata.to_model(), + ) + _assert_ok(resp) + async def _aclose(self) -> None: # convert set to list to avoid modifying set while iterating over it for queue in list(self._queues): diff --git a/flixpy/flix/extension/extension_api.yaml b/flixpy/flix/extension/extension_api.yaml index ce7e5a0..db13c7c 100644 --- a/flixpy/flix/extension/extension_api.yaml +++ b/flixpy/flix/extension/extension_api.yaml @@ -68,10 +68,11 @@ info: ### Step 5: All done That's it! You're now ready to interact with the Flix Client and ready to turn “My First Flix Extension” into the best thing ever. Although, maybe come up with a better name first. - version: v1.1.0 + version: v1.2.1 contact: - url: http://www.foundry.com - email: support@foundry.com + name: Foundry + url: https://www.foundry.com + email: https://support.foundry.com/hc license: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -116,23 +117,28 @@ tags: - name: Preferences description: | The preferences endpoint provides a lookup for the current Flix Client user preferences. A GET request to this endpoint will return the full list of preferences currently set in the client. This can optionally be filtered down by specifying a subset of properties via the `keys` query parameter. This can either be a comma separated string, or be specified multiple times for each desired preference. + - name: Events + description: | + The events endpoint provides an alternative way to listen to events from the Flix Client for clients that don't support websockets. + Instead, it uses Server-Sent Events over a regular HTTP request to provide multiple updates for one request. + Authorised requests to `/events` will return an initial response, followed by any additional events for the requesting client, + along with a regular PING event as a way to validate the connection. + + By default, only events for the requesting client will be sent, but additional events types can be requested by specifiying the `events` query parameter. This can be specified multiple times to include multiple types of events. For example, `/events?event=project&event=status` will include updates for the active project, and the status of the client. paths: /health: get: operationId: HealthCheckController_healthCheck - summary: Health Check - description: Basic health check endpoint. Always returns a 200 response. parameters: [] responses: '200': description: '' + summary: Health Check tags: - Health Check /info: get: operationId: InfoController_get - summary: Flix Client details - description: Provides details of current Flix Client and GRC API. Always returns a 200 response. parameters: [] responses: '200': @@ -141,13 +147,12 @@ paths: application/json: schema: $ref: '#/components/schemas/InfoResponse' + summary: Flix Client details tags: - Info /registration: post: operationId: RegistrationController_registerClient - summary: Register API consumer - description: Processes a registration request from a new API consumer. parameters: [] requestBody: required: true @@ -170,14 +175,11 @@ paths: $ref: '#/components/schemas/RegistrationResponse' '400': description: The incoming API consumer details could not be validated + summary: Register API consumer tags: - API Registration get: operationId: RegistrationController_getAll - summary: List API consumers - description: |- - Returns a list of registered API consumer details. - Details returned by the registration manager are mapped to a DTO to avoid exposing access tokens. parameters: [] responses: '200': @@ -188,14 +190,13 @@ paths: type: array items: $ref: '#/components/schemas/RegistrationDetails' - tags: - - API Registration security: - bearer: [] + summary: List API consumers + tags: + - API Registration delete: operationId: RegistrationController_unregisterClient - summary: Unregister API consumer - description: Removes the registration for the requesting API consumer. parameters: - name: authorization required: true @@ -207,22 +208,98 @@ paths: description: The API consumer has been unregistered from Flix '400': description: The provided bearer token could not be validated + security: + - bearer: [] + summary: Unregister API consumer tags: - API Registration + /registration/actions: + post: + operationId: RegistrationController_setClientActions + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ActionsUpdateRequest' + responses: + '200': + description: Actions for the API consumer have been set successfully + content: + application/json: + schema: + $ref: '#/components/schemas/ActionsUpdateResponse' + '400': + description: The incoming API consumer details could not be validated security: - bearer: [] + summary: Set actions for the API consumer + tags: + - API Registration /panels: + get: + description: |- + Returns panels from the sequence revision currently open in the Panel Browser. + + Query params can be used on their own or combined: + + - no params: all panels in the sequence revision + + - `selected=true`: only the currently selected panels + + - `range=2,5`: only the panels placed between 2nd and 5th panels (including 2nd and 5th) + + - `panel_ids=1,2,3`: only the panels with the given ids + + - `selected=true&panel_ids=1,2,3`: only the selected panels whose ids are in the list + + - `selected=true&range=2,5&panel_ids=1,2,3`: only the selected panels, positioned between 2nd and 5th panels whose ids are in the list + operationId: PanelController_get + parameters: + - name: selected + required: false + in: query + description: Takes either "true" or "false". If "selected=true" targets currently selected panels + schema: + example: selected=true + - name: range + required: false + in: query + description: A range of panels based on their positions. Targets panels at start position, end position and every panel in between them. Takes 2 numbers like "range=[start],[end]". Provided numbers should be 2 positive integers. + schema: + example: range=1,5 + - name: panel_ids + required: false + in: query + description: A list of panel ids to fetch. Provided ids must be positive integers. + schema: + example: panel_ids=1,2,3 + responses: + '200': + description: Returns the panels information from the currently loaded sequence revision. + content: + application/json: + schema: + $ref: '#/components/schemas/PanelDetailsResponse' + '400': + description: Flix Client is not currently in Panel Browser. + security: + - bearer: [] + summary: Get Panels from currently loaded Sequence Revision. + tags: + - Panel Management post: operationId: PanelController_create - summary: Create New Panels - description: Creates new panels in the active sequence revision from the list of provided file paths. parameters: [] requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/BulkPanelRequest' + oneOf: + - $ref: '#/components/schemas/BulkPanelRequest' + - $ref: '#/components/schemas/FullPanelRequest' responses: '201': description: The panel creation has been scheduled @@ -232,14 +309,13 @@ paths: $ref: '#/components/schemas/PanelRequestResponse' '400': description: No sequence revision is loaded, or the panel create request is invalid - tags: - - Panel Management security: - bearer: [] + summary: Create New Panels + tags: + - Panel Management patch: operationId: PanelController_update - summary: Update Existing Panels - description: Updates existing panels in the active sequence revision from the list of provided file paths. parameters: [] requestBody: required: true @@ -258,15 +334,78 @@ paths: $ref: '#/components/schemas/PanelRequestResponse' '400': description: No sequence revision is loaded, or the panel update request is invalid + security: + - bearer: [] + summary: Update Existing Panels tags: - Panel Management + /panels/metadata: + patch: + description: |- + Updates panels metadata from the sequence revision currently open in the Panel Browser. + + Takes object with `metadata` key, which must be an `object` with key-value pairs, where the value is a `string` or `null`. + + If the value of the provided metadata key is `null`, the existing metadata for this key will be deleted. + + Query params can be used on their own or combined: + + - no params: all panels in the sequence revision + + - `selected=true`: only the currently selected panels + + - `range=2,5`: only the panels placed between 2nd and 5th panels (including 2nd and 5th) + + - `panel_ids=1,2,3`: only the panels with the given ids + + - `selected=true&panel_ids=1,2,3`: only the selected panels whose ids are in the list + + - `selected=true&range=2,5&panel_ids=1,2,3`: only the selected panels, positioned between 2nd and 5th panels whose ids are in the list + + Returns list of update results, each including panel id and updated metadata. + operationId: PanelController_updateMetadata + parameters: + - name: selected + required: false + in: query + description: Takes either "true" or "false". If "selected=true" targets currently selected panels + schema: + example: selected=true + - name: range + required: false + in: query + description: A range of panels based on their positions. Targets panels at start position, end position and every panel in between them. Takes 2 numbers like "range=[start],[end]". Provided numbers should be 2 positive integers. + schema: + example: range=1,5 + - name: panel_ids + required: false + in: query + description: A list of panel ids to fetch. Provided ids must be positive integers. + schema: + example: panel_ids=1,2,3 + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PanelUpdateMetadataRequest' + responses: + '200': + description: Updates the metadata on the panels from the currently loaded sequence revision. + content: + application/json: + schema: + $ref: '#/components/schemas/PanelUpdateMetadataResponse' + '400': + description: Flix Client is not currently in Panel Browser. security: - bearer: [] + summary: Update the metadata on the Panel Revisions from the currently loaded Sequence Revision. + tags: + - Panel Management /panels/annotate: patch: operationId: PanelController_annotate - summary: Update Panel Annotations - description: Adds annotations to panels in the active sequence revision from the list of provided file paths. parameters: [] requestBody: required: true @@ -285,15 +424,53 @@ paths: $ref: '#/components/schemas/PanelRequestResponse' '400': description: No sequence revision is loaded, or the panel annotation request is invalid + security: + - bearer: [] + summary: Update Panel Annotations + tags: + - Panel Management + /panels/track: + post: + operationId: PanelController_trackPanel + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PanelTrackRequest' + responses: + '200': + description: The panel has been marked as open in the extension + '400': + description: No sequence revision is loaded, or the panel annotation request is invalid + security: + - bearer: [] + summary: Marks a panel as open in an extension tags: - Panel Management + delete: + operationId: PanelController_untrackPanel + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PanelTrackRequest' + responses: + '200': + description: The panel has been marked as not open in the extension + '400': + description: No sequence revision is loaded, or the panel annotation request is invalid security: - bearer: [] + summary: Marks a panel as not open in an extension + tags: + - Panel Management /download: post: operationId: DownloadController_downloadMediaObject - summary: Download Media Object - description: Downloads a specific artwork type for a given asset, to a target folder on the local machine. parameters: [] requestBody: required: true @@ -310,15 +487,14 @@ paths: $ref: '#/components/schemas/DownloadResponse' '400': description: The Flix Client is not logged in, or the request is invalid - tags: - - Media Object Download security: - bearer: [] + summary: Download Media Object + tags: + - Media Object Download /project: get: operationId: ProjectController_get - summary: Get Current Flix Project - description: Returns details of the currently opened show, episode, sequence and sequence revision. parameters: [] responses: '200': @@ -329,15 +505,14 @@ paths: $ref: '#/components/schemas/ProjectDetailsDto' '400': description: The Flix Client is not logged in to a server - tags: - - Project Details security: - bearer: [] + summary: Get Current Flix Project + tags: + - Project Details /status: get: operationId: StatusController_get - summary: Get Flix Status - description: Returns details of the current state of the Flix Client. parameters: [] responses: '200': @@ -348,14 +523,14 @@ paths: $ref: '#/components/schemas/StatusResponse' '400': description: The Flix Client is not logged in to a server - tags: - - Status security: - bearer: [] + summary: Get Flix Status + tags: + - Status /preferences: get: operationId: PreferencesController_lookupPreferences - summary: Get Flix Preferences Values parameters: - name: keys required: false @@ -379,10 +554,90 @@ paths: - type: boolean '400': description: The Flix Client is not logged in to a server + security: + - bearer: [] + summary: Get Flix Preferences Values tags: - Preferences + /events: + get: + operationId: EventController_handleConnection + parameters: + - name: event + required: false + in: query + description: An array of event types to subscribe to. If not provided, only client-specific events will be sent. + schema: + type: array + items: + type: string + enum: + - ping + - action + - open + - project + - status + - version + - preferences + - panel_metadata_update + - project_metadata_update + responses: + '200': + description: A stream of events from the Flix Client. + content: + text/event-stream: + schema: + $ref: '#/components/schemas/SSEEvent' + security: + - bearer: [] + summary: Subscribe to events from the Client. + tags: + - Events + /project/metadata: + get: + operationId: ProjectMetadataController_get + parameters: [] + responses: + '200': + description: Returns the current Flix project metadata + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectDetailsMetadataDto' + '400': + description: The Flix Client is not logged in to a server + security: + - bearer: [] + summary: Get Current Flix Project metadata + tags: + - Project Metadata + patch: + description: | + Merges custom metadata into the target entity (show, episode, sequence, or sequence-revision) within the active project context.Requested entities must exist in the current project context. + ### Convention & Best Practices: + - Prefix keys with your extension/plugin identifier (e.g. `com.vendor.plugin:key`) to avoid collisions. + - Only keys provided are updated; omitted keys remain untouched. + - If the key does not exist, it will be created unless its value is `null`. + - Set a key's value to `null` to delete it. + - If the key does not exist with the specified name and `null` is provided as its value, it will be ignored. + operationId: ProjectMetadataController_updateMetadata + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectDetailsMetadataDto' + responses: + '200': + description: Metadata successfully updated. + '400': + description: Invalid payload, missing entities in the current project context or Flix Client is not logged in. security: - bearer: [] + summary: Update Entity Metadata in Current Project + tags: + - Project Metadata components: securitySchemes: bearer: @@ -419,6 +674,8 @@ components: - STATUS - VERSION - PREFERENCES + - PANEL_METADATA_UPDATE + - PROJECT_METADATA_UPDATE required: - eventTypes WebsocketEvent: @@ -510,6 +767,28 @@ components: required: - type - data + - type: object + properties: + type: + type: string + enum: + - PANEL_METADATA_UPDATE + data: + $ref: '#/components/schemas/PanelMetadataUpdateEvent' + required: + - type + - data + - type: object + properties: + type: + type: string + enum: + - PROJECT_METADATA_UPDATE + data: + $ref: '#/components/schemas/ProjectMetadataUpdateEvent' + required: + - type + - data required: - data PingEvent: @@ -519,6 +798,26 @@ components: type: integer required: - apiClientId + ActionEventPanelResponse: + type: object + properties: + panelId: + type: integer + panelRevision: + type: integer + metadata: + type: object + additionalProperties: + type: string + description: Arbitrary key-value metadata for the panel. + example: + ftrack:sequence_id: 9402 + path: + type: string + required: + - panelId + - panelRevision + - path ActionEvent: type: object properties: @@ -540,6 +839,10 @@ components: - PANEL_CREATE - PANEL_UPDATE - PANEL_ANNOTATE + panels: + type: array + items: + $ref: '#/components/schemas/ActionEventPanelResponse' required: - apiClientId - actionId @@ -570,39 +873,170 @@ components: type: integer required: - assetId - OpenFilePanelData: + ViewportDto: type: object properties: - id: + width: type: integer - assetId: + description: Width is the width of the media in pixels, dictating the scale of horizontal camera movements. + height: type: integer - annotationAssetId: + description: Height is the height of the media in pixels, dictating the scale of vertical camera movements. + scale: type: integer - isAnimated: - type: boolean - sourceFile: - nullable: true - allOf: - - $ref: '#/components/schemas/OpenSourceFileData' + description: |- + Stretch (Scale in API) specifies how much the source artwork has been stretched within this media. + More specifically, it is the inverse stretch, such that if the source artwork has a width of 1000 + while the bounding box of the same artwork within this media has a width of 2000, the stretch will be + 1000 / 2000 = 0.5. + offsetX: + type: integer + description: |- + OffsetX is the horizontal offset of the source artwork within this media, if this media has been padded. + In particular, it is the horizontal distance from the centre of this media to the centre of the source artwork. + Specified in terms of the pixel space of the source artwork; calculate OffsetX / Stretch to get + the offset in pixels within this me. + offsetY: + type: integer + description: |- + OffsetY is the vertical offset of the source artwork within this media, if this media has been padded. + In particular, it is the vertical distance from the centre of this media to the centre of the source artwork. + Specified in terms of the pixel space of the source artwork; calculate OffsetY / Stretch to get + the offset in pixels within this media. required: - - id - - assetId - - isAnimated - - sourceFile - PsConfiguration: + - width + - height + - scale + - offsetX + - offsetY + KeyframeDto: type: object properties: - alwaysOpenSourceFile: - type: boolean - openBehaviour: - type: string + anchorPointHorizontal: + type: integer + description: |- + The horizontal value of the point that CenterHoriz, CenterVert and Rotation are applied to, + specified as an offset from the viewport centre in fractions of the horizontal viewport resolution. + A value of 0 is the centre of the viewport, while a value of -0.5 is the left edge of the viewport. + default: 0 + anchorPointVertical: + type: integer + description: |- + The vertical value of the point that CenterHoriz, CenterVert and Rotation are applied to, + specified as an offset from the viewport centre in fractions of the vertical viewport resolution. + A value of 0 is the centre of the viewport, while a value of -0.5 is the top edge of the viewport. + default: 0 + centerHorizontal: + type: integer + description: |- + The horizontal position of the camera in fractions of the viewport width, relative to the centre of the viewport. + A positive value means the camera is positioned to the left of the viewport centre. + default: 0 + centerVertical: + type: integer + description: |- + The vertical position of the camera in fractions of the viewport height, relative to the centre of the viewport. + A positive value means the camera is positioned above the viewport centre. + default: 0 + rotation: + type: integer + description: How much to rotate the image clockwise in degrees. + default: 0 + scale: + type: integer + description: A vertical and horizontal scale, 100 meaning no scaling. + default: 0 + startKey: + type: integer + description: The frame of the panel revision that the information of this keyframe relates to, starting at 0. + default: 0 + viewport: + description: |- + Describes the media a keyframe applies to. + In the event that the media is a padded or stretched version of some source artwork, + it will contain information about the nature of the padding/stretch to facilitate comparison of + the keyframes associated with this descriptor and the keyframes of the source panel. + default: null + allOf: + - $ref: '#/components/schemas/ViewportDto' + required: + - anchorPointHorizontal + - anchorPointVertical + - centerHorizontal + - centerVertical + - rotation + - scale + - startKey + OpenFilePanelData: + type: object + properties: + id: + type: integer + index: + type: integer + revisionId: + type: integer + assetId: + type: integer + sourceFile: + nullable: true + type: object + allOf: + - $ref: '#/components/schemas/OpenSourceFileData' + annotationAssetId: + type: integer + shotId: + type: integer + isAnimated: + type: boolean + dialogue: + type: string + originSbp: + type: object + keyframes: + type: array + items: + $ref: '#/components/schemas/KeyframeDto' + shotName: + type: string + required: + - id + - index + - revisionId + - assetId + - isAnimated + PsConfiguration: + type: object + properties: + alwaysOpenSourceFile: + type: boolean + openBehaviour: + type: string sendAnnotationAsLayer: type: boolean required: - alwaysOpenSourceFile - openBehaviour - sendAnnotationAsLayer + OpenFileShotData: + type: object + properties: + id: + type: integer + index: + type: integer + startPanelIndex: + type: integer + endPanelIndex: + type: integer + name: + type: string + required: + - id + - index + - startPanelIndex + - endPanelIndex + - name OpenFileEvent: type: object properties: @@ -614,9 +1048,16 @@ components: $ref: '#/components/schemas/OpenFilePanelData' sketchingToolConfiguration: $ref: '#/components/schemas/PsConfiguration' + shots: + type: array + items: + $ref: '#/components/schemas/OpenFileShotData' + actionId: + type: string required: - project - panels + - shots OpenSourceFileEvent: type: object properties: @@ -624,6 +1065,244 @@ components: $ref: '#/components/schemas/OpenSourceFileData' required: - sourceFile + UpdatedPanelMetadataDto: + type: object + properties: + id: + type: integer + metadata: + type: object + additionalProperties: + type: string + description: Arbitrary key-value metadata for the panel. + example: + ftrack:sequence_id: '9402' + required: + - id + - metadata + PanelMetadataUpdateEvent: + type: object + properties: + panels: + type: array + items: + $ref: '#/components/schemas/UpdatedPanelMetadataDto' + required: + - panels + ShowDetailsDto: + type: object + properties: + id: + type: integer + description: The Flix identifier for the show. + metadata: + type: object + additionalProperties: + type: string + description: |- + Arbitrary key-value metadata to merge into the entity. Each value must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + example: + com.myextension:status: inprogress + com.myextension:tag: null + trackingCode: + type: string + description: The show's tracking code. + title: + type: string + nullable: true + description: The show's display title. + aspectRatio: + type: number + description: The configured aspect ratio for the active sequence or show. + deprecated: true + defaultAspectRatio: + type: number + description: The configured default aspect ratio for the sequence. + required: + - id + - trackingCode + - title + - aspectRatio + - defaultAspectRatio + EpisodeDetailsDto: + type: object + properties: + id: + type: integer + description: The Flix identifier for the episode. + metadata: + type: object + additionalProperties: + type: string + description: |- + Arbitrary key-value metadata to merge into the entity. Each value must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + example: + com.myextension:status: inprogress + com.myextension:tag: null + trackingCode: + type: string + description: The episode's tracking code. + createdDate: + format: date-time + type: string + description: The date the episode was created. + owner: + type: string + description: The user that created the episode. + title: + type: string + nullable: true + description: The episode's display title. + required: + - id + - trackingCode + - createdDate + - owner + - title + SequenceDetailsDto: + type: object + properties: + id: + type: integer + description: The Flix identifier for the sequence. + metadata: + type: object + additionalProperties: + type: string + description: |- + Arbitrary key-value metadata to merge into the entity. Each value must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + example: + com.myextension:status: inprogress + com.myextension:tag: null + trackingCode: + type: string + description: The sequence's tracking code. + createdDate: + format: date-time + type: string + description: The date the sequence was created. + owner: + type: string + description: The user that created the sequence. + title: + type: string + nullable: true + description: The sequence's display title. + aspectRatio: + type: number + description: The aspect ratio used by the sequence. + required: + - id + - trackingCode + - createdDate + - owner + - title + - aspectRatio + SequenceRevisionDetailsDto: + type: object + properties: + id: + type: integer + description: The Flix identifier for the sequence revision. + metadata: + type: object + additionalProperties: + type: string + description: |- + Arbitrary key-value metadata to merge into the entity. Each value must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + example: + com.myextension:status: inprogress + com.myextension:tag: null + createdDate: + format: date-time + type: string + nullable: true + description: The date the sequence revision was created. + owner: + type: string + description: The user that created the sequence revision. + published: + type: boolean + description: Whether this sequence revision has been published to editorial. + comment: + type: string + description: Any comment added to the sequence revision when saving. + shotNames: + description: The list of shot names included in the sequence revision, derived from the named shots of the panels in the sequence revision. + type: array + items: + type: string + required: + - id + - createdDate + - owner + - published + - comment + - shotNames + ProjectMetadataUpdateEvent: + type: object + properties: + success: + type: boolean + show: + $ref: '#/components/schemas/ShowDetailsDto' + episode: + $ref: '#/components/schemas/EpisodeDetailsDto' + sequence: + $ref: '#/components/schemas/SequenceDetailsDto' + sequenceRevision: + $ref: '#/components/schemas/SequenceRevisionDetailsDto' + required: + - success + ActionRegistrationType: + type: string + enum: + - PanelBrowserAction + description: |- + Context/location of the action within the application. + For now only PanelBrowserAction is supported and will be set regardless of provided value. + ActionRegistration: + type: object + properties: + type: + description: |- + Context/location of the action within the application. + For now only PanelBrowserAction is supported and will be set regardless of provided value. + allOf: + - $ref: '#/components/schemas/ActionRegistrationType' + id: + type: string + description: Unique identifier for this action. + name: + type: string + description: The user-friendly name for this action to be displayed in the UI. + description: + type: string + description: The user-friendly description for this action to be displayed in the UI. + iconSvg: + type: string + description: |- + A simple SVG icon for this specific action when displayed in the UI. + This value will be processed upon registration and may display incorrectly if unsupported SVG features are used. + required: + - id + - name RegistrationRequest: type: object properties: @@ -641,6 +1320,19 @@ components: type: array items: type: string + actions: + description: List of actions available for this extension. + type: array + items: + $ref: '#/components/schemas/ActionRegistration' + iconSvg: + type: string + description: |- + A simple SVG icon to be displayed by default for extension actions when displayed in the UI. + This value will be processed upon registration and may display incorrectly if unsupported SVG features are used. + shortName: + type: string + description: Short name for extension to be used in context menu. required: - name - clientUid @@ -676,10 +1368,41 @@ components: type: array items: type: string + actions: + description: List of actions available for this extension. + type: array + items: + type: object + iconSvg: + type: string + description: SVG icon for the default extension button. + shortName: + type: string + description: Short name for extension to be used in context menu. required: - flixId - name - clientUid + ActionsUpdateRequest: + type: object + properties: + actions: + description: List of actions to be updated for this API client. + type: array + items: + $ref: '#/components/schemas/ActionRegistration' + required: + - actions + ActionsUpdateResponse: + type: object + properties: + actions: + description: The list of actions registered for this API consumer's extension. + type: array + items: + $ref: '#/components/schemas/ActionRegistration' + required: + - actions PanelRequestItem: type: object properties: @@ -687,10 +1410,61 @@ components: type: integer description: The ID of the panel that should be updated. example: 15 + duration: + type: integer + description: Duration is the number of frames this instance of [PanelRevision] has, within this [Shot]. + trimInFrame: + type: integer + description: TrimInFrame is the trim in of this panel revision in a given sequence revision if this is an animated panel. + trimOutFrame: + type: integer + description: TrimOutFrame is the trim out of this panel revision in a given sequence revision if this is an animated panel. + metadata: + type: object + additionalProperties: + type: string + description: |- + Arbitrary key-value metadata to merge into the entity. Each value must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + example: + com.myextension:status: inprogress + com.myextension:tag: null path: type: string description: The file path to upload. example: /path/to/file/1.psd + keyframes: + description: The camera move keyframes on this panel revisions. + type: array + items: + $ref: '#/components/schemas/KeyframeDto' + originSbp: + type: object + additionalProperties: + type: string + description: |- + Contains information about panel revisions imported from Storyboard Pro. + This is for internal use by the Storyboard Pro extension and might be removed in the future without notice. + sourceMedia: + type: string + description: This is used to upload a MOV file that will be used as the source media for the panel preview. + dialogue: + type: string + description: This is dialogue text that will be associated with the panel. + layerTransform: + type: boolean + description: This indicates whether panel has layer transform. + shotName: + type: string + description: |- + The name of the shot this panel belongs to. + When specified, a shot with the given name will be created and this panel will be added to it. + If the name already exists within the sequence, the request will be rejected with a 400 Bad Request response. + If not provided, the panel will be added to an existing shot based on the target insert index. + example: Shot 001 required: - path PanelRequestSourceFile: @@ -702,7 +1476,9 @@ components: example: /path/to/source/file.psd previewMode: type: string - description: The mode to use to generate the source file preview. + description: |- + The mode to use to generate the source file preview. + @default 'first_panel' example: source_file enum: - first_panel @@ -757,7 +1533,9 @@ components: example: 3 paths: description: The file paths to be uploaded as panel annotations. - example: '[''/path/to/file/1.psd'',''/path/to/file/2.psd'']' + example: + - /path/to/file/1.psd + - /path/to/file/2.psd type: array items: type: string @@ -798,7 +1576,9 @@ components: example: 3 paths: description: The file paths to upload as new panel artwork. - example: '[''/path/to/file/1.psd'',''/path/to/file/2.psd'']' + example: + - /path/to/file/1.psd + - /path/to/file/2.psd type: array items: type: string @@ -817,18 +1597,203 @@ components: required: - paths - origin - PanelRequestResponse: + PanelRevisionDetailsDto: type: object properties: - actionId: + panelId: type: integer - description: The ID of the action scheduled by the panel request. - message: - type: string - description: A summary message of the scheduled panel action. - required: + description: The identifier of this panel. + revisionId: + type: integer + description: The panel revision of this panel instance. + panelPosition: + type: integer + description: The position of the panel in the sequence revision it belongs to. + assetId: + type: integer + description: The identifier for the asset associated with this panel. + showId: + type: integer + description: The show this panel belongs to. + sequenceId: + type: integer + description: The sequence this panel belongs to. + trimInFrame: + type: integer + description: TrimInFrame is the trim in of this panel revision in a given sequence revision if this is an animated panel. + trimOutFrame: + type: integer + description: TrimOutFrame is the trim out of this panel revision in a given sequence revision if this is an animated panel. + originSbp: + type: object + additionalProperties: + type: string + nullable: true + description: |- + Contains information about panel revisions imported from Storyboard Pro. + This is for internal use by the Storyboard Pro extension and might be removed in the future without notice. + metadata: + type: object + additionalProperties: + type: string + description: |- + Arbitrary key-value metadata to merge into the entity. Each value must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + example: + com.myextension:status: inprogress + com.myextension:tag: null + createdDate: + format: date-time + type: string + description: The date the panel was created. + revisionDate: + format: date-time + type: string + description: The date at which this panel revision was created. + owner: + type: string + description: The user that originally created this "panel revision". + hidden: + type: boolean + description: Flag that indicates if a panel has been hidden in a sequence revision. + duration: + type: number + description: The duration of the panel in frames. + layerTransform: + type: boolean + description: Whether the panel revision had a layer transform applied to it in Storyboard Pro. + dialogue: + type: string + description: This dialogue associated with this panel. + keyframes: + description: The camera move keyframes on this panel revisions. + type: array + items: + $ref: '#/components/schemas/KeyframeDto' + origin: + type: string + description: Where the panel comes from e.g. "manual import". + shotName: + type: string + description: Sequence Revision shot this panel belongs to. + required: + - panelId + - revisionId + - panelPosition + - assetId + - showId + - sequenceId + - trimInFrame + - trimOutFrame + - metadata + - createdDate + - revisionDate + - owner + - hidden + - duration + - layerTransform + - dialogue + - keyframes + - origin + - shotName + PanelDetailsResponse: + type: object + properties: + panels: + description: Requested panels. + type: array + items: + $ref: '#/components/schemas/PanelRevisionDetailsDto' + required: + - panels + PanelRequestResponse: + type: object + properties: + actionId: + type: integer + description: The ID of the action scheduled by the panel request. + message: + type: string + description: A summary message of the scheduled panel action. + required: - actionId - message + PanelUpdateMetadataRequest: + type: object + properties: + metadata: + type: object + additionalProperties: + type: string + description: |- + Arbitrary key-value metadata to merge into the entity. Each value must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + example: + com.myextension:status: inprogress + com.myextension:tag: null + required: + - metadata + PanelUpdateMetadataResponseItem: + type: object + properties: + id: + type: integer + description: The panel ID against which this metadata item is associated. + metadata: + type: object + additionalProperties: + type: string + description: |- + Arbitrary key-value metadata to merge into the entity. Each value must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + example: + com.myextension:status: inprogress + com.myextension:tag: null + required: + - id + - metadata + PanelUpdateMetadataResponse: + type: object + properties: + results: + description: List of metadata update results. Each includes panel id and updated metadata. + example: + - id: '1' + metadata: + com.myextension:status: inprogress + type: array + items: + $ref: '#/components/schemas/PanelUpdateMetadataResponseItem' + required: + - results + PanelTrackRequest: + type: object + properties: + showId: + type: integer + description: The ID of the show the tracked panel belongs to. + example: 1 + sequenceId: + type: integer + description: The ID of the sequence the tracked panel belongs to. + example: 12 + panelId: + type: integer + description: The ID of the panel that is being tracked. + example: 1234 + required: + - showId + - sequenceId + - panelId DownloadRequest: type: object properties: @@ -851,10 +1816,18 @@ components: - dnxhd - extension - fullres + - import_log + - import_log_bundle - logo - xml - publish - publish_fullsized + - profile_original + - profile_image_64x64 + - profile_image_128x128 + - profile_image_256x256 + - profile_image_512x512 + - sboard - scaled - show-thumbnail - source_media @@ -888,133 +1861,33 @@ components: - mediaObjectId - fileName - filePath - ShowDetailsDto: - type: object - properties: - id: - type: integer - description: The Flix identifier for the show. - trackingCode: - type: string - description: The show's tracking code. - title: - type: string - nullable: true - description: The show's display title. - aspectRatio: - type: number - description: The configured aspect ratio for the show. - required: - - id - - trackingCode - - title - - aspectRatio - EpisodeDetailsDto: - type: object - properties: - id: - type: integer - description: The Flix identifier for the episode. - trackingCode: - type: string - description: The episode's tracking code. - createdDate: - format: date-time - type: string - description: The date the episode was created. - owner: - type: string - description: The user that created the episode. - title: - type: string - nullable: true - description: The episode's display title. - required: - - id - - trackingCode - - createdDate - - owner - - title - SequenceDetailsDto: - type: object - properties: - id: - type: integer - description: The Flix identifier for the sequence. - trackingCode: - type: string - description: The sequence's tracking code. - createdDate: - format: date-time - type: string - description: The date the sequence was created. - owner: - type: string - description: The user that created the sequence. - title: - type: string - nullable: true - description: The sequence's display title. - required: - - id - - trackingCode - - createdDate - - owner - - title - SequenceRevisionDetailsDto: - type: object - properties: - id: - type: integer - description: The Flix identifier for the sequence revision. - createdDate: - format: date-time - type: string - nullable: true - description: The date the sequence revision was created. - owner: - type: string - description: The user that created the sequence revision. - published: - type: boolean - description: Whether this sequence revision has been published to editorial. - comment: - type: string - description: Any comment added to the sequence revision when saving. - required: - - id - - createdDate - - owner - - published - - comment ProjectDetailsDto: type: object properties: show: nullable: true description: Details of the currently opened show. + type: object allOf: - $ref: '#/components/schemas/ShowDetailsDto' episode: nullable: true description: Details of the currently opened episode, if in an episodic show. + type: object allOf: - $ref: '#/components/schemas/EpisodeDetailsDto' sequence: nullable: true description: Details of the currently opened sequence. + type: object allOf: - $ref: '#/components/schemas/SequenceDetailsDto' sequenceRevision: nullable: true description: Details of the currently opened sequence revision. + type: object allOf: - $ref: '#/components/schemas/SequenceRevisionDetailsDto' - required: - - show - - episode - - sequence - - sequenceRevision PanelSelectionResponse: type: object properties: @@ -1059,6 +1932,7 @@ components: - canSave - canPublish - canExport + - panelSelection ActionsInProgressResponse: type: object properties: @@ -1093,3 +1967,171 @@ components: - canCreate - revisionStatus - actionsInProgress + SSEEvent: + type: object + properties: + data: + oneOf: + - type: object + properties: + type: + type: string + enum: + - PING + data: + $ref: '#/components/schemas/PingEvent' + required: + - type + - data + - type: object + properties: + type: + type: string + enum: + - STATUS + data: + $ref: '#/components/schemas/StatusResponse' + required: + - type + - data + - type: object + properties: + type: + type: string + enum: + - PROJECT + data: + $ref: '#/components/schemas/ProjectDetailsDto' + required: + - type + - data + - type: object + properties: + type: + type: string + enum: + - ACTION + data: + $ref: '#/components/schemas/ActionEvent' + required: + - type + - data + - type: object + properties: + type: + type: string + enum: + - OPEN + data: + oneOf: + - $ref: '#/components/schemas/OpenFileEvent' + - $ref: '#/components/schemas/OpenSourceFileEvent' + required: + - type + - data + - type: object + properties: + type: + type: string + enum: + - VERSION + data: + $ref: '#/components/schemas/VersionEvent' + required: + - type + - data + - type: object + properties: + type: + type: string + enum: + - PREFERENCES + data: + type: object + additionalProperties: + oneOf: + - type: string + - type: integer + - type: boolean + required: + - type + - data + - type: object + properties: + type: + type: string + enum: + - PANEL_METADATA_UPDATE + data: + $ref: '#/components/schemas/PanelMetadataUpdateEvent' + required: + - type + - data + - type: object + properties: + type: + type: string + enum: + - PROJECT_METADATA_UPDATE + data: + $ref: '#/components/schemas/ProjectMetadataUpdateEvent' + required: + - type + - data + required: + - data + ProjectDetailsMetadataDto: + type: object + properties: + show: + type: object + additionalProperties: + type: string + description: |- + Arbitrary key-value metadata to merge into the entity. Each value must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + example: + com.myextension:status: inprogress + com.myextension:tag: null + episode: + type: object + additionalProperties: + type: string + description: |- + Arbitrary key-value metadata to merge into the entity. Each value must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + example: + com.myextension:status: inprogress + com.myextension:tag: null + sequence: + type: object + additionalProperties: + type: string + description: |- + Arbitrary key-value metadata to merge into the entity. Each value must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + example: + com.myextension:status: inprogress + com.myextension:tag: null + sequenceRevision: + type: object + additionalProperties: + type: string + description: |- + Arbitrary key-value metadata to merge into the entity. Each value must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + example: + com.myextension:status: inprogress + com.myextension:tag: null diff --git a/flixpy/flix/extension/extension_api/api/api_registration/registration_controller_get_all.py b/flixpy/flix/extension/extension_api/api/api_registration/registration_controller_get_all.py index c69b6fe..9e0cb91 100644 --- a/flixpy/flix/extension/extension_api/api/api_registration/registration_controller_get_all.py +++ b/flixpy/flix/extension/extension_api/api/api_registration/registration_controller_get_all.py @@ -67,9 +67,6 @@ def sync_detailed( ) -> Response[list[RegistrationDetails]]: """ List API consumers - Returns a list of registered API consumer details. - Details returned by the registration manager are mapped to a DTO to avoid exposing access tokens. - Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx2.TimeoutException: If the request takes longer than Client.timeout. @@ -96,9 +93,6 @@ def sync( ) -> list[RegistrationDetails] | None: """ List API consumers - Returns a list of registered API consumer details. - Details returned by the registration manager are mapped to a DTO to avoid exposing access tokens. - Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx2.TimeoutException: If the request takes longer than Client.timeout. @@ -120,9 +114,6 @@ async def asyncio_detailed( ) -> Response[list[RegistrationDetails]]: """ List API consumers - Returns a list of registered API consumer details. - Details returned by the registration manager are mapped to a DTO to avoid exposing access tokens. - Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx2.TimeoutException: If the request takes longer than Client.timeout. @@ -149,9 +140,6 @@ async def asyncio( ) -> list[RegistrationDetails] | None: """ List API consumers - Returns a list of registered API consumer details. - Details returned by the registration manager are mapped to a DTO to avoid exposing access tokens. - Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx2.TimeoutException: If the request takes longer than Client.timeout. diff --git a/flixpy/flix/extension/extension_api/api/api_registration/registration_controller_register_client.py b/flixpy/flix/extension/extension_api/api/api_registration/registration_controller_register_client.py index c260448..8265244 100644 --- a/flixpy/flix/extension/extension_api/api/api_registration/registration_controller_register_client.py +++ b/flixpy/flix/extension/extension_api/api/api_registration/registration_controller_register_client.py @@ -82,8 +82,6 @@ def sync_detailed( ) -> Response[Any | RegistrationResponse]: """ Register API consumer - Processes a registration request from a new API consumer. - Args: body (RegistrationRequest): @@ -115,8 +113,6 @@ def sync( ) -> Any | RegistrationResponse | None: """ Register API consumer - Processes a registration request from a new API consumer. - Args: body (RegistrationRequest): @@ -143,8 +139,6 @@ async def asyncio_detailed( ) -> Response[Any | RegistrationResponse]: """ Register API consumer - Processes a registration request from a new API consumer. - Args: body (RegistrationRequest): @@ -176,8 +170,6 @@ async def asyncio( ) -> Any | RegistrationResponse | None: """ Register API consumer - Processes a registration request from a new API consumer. - Args: body (RegistrationRequest): diff --git a/flixpy/flix/extension/extension_api/api/api_registration/registration_controller_set_client_actions.py b/flixpy/flix/extension/extension_api/api/api_registration/registration_controller_set_client_actions.py new file mode 100644 index 0000000..f88bb09 --- /dev/null +++ b/flixpy/flix/extension/extension_api/api/api_registration/registration_controller_set_client_actions.py @@ -0,0 +1,182 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx2 + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.actions_update_request import ActionsUpdateRequest +from ...models.actions_update_response import ActionsUpdateResponse +from typing import cast + + + +def _get_kwargs( + *, + body: ActionsUpdateRequest, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/registration/actions", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx2.Response) -> ActionsUpdateResponse | Any | None: + if response.status_code == 200: + response_200 = ActionsUpdateResponse.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = cast(Any, None) + return response_400 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx2.Response) -> Response[ActionsUpdateResponse | Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: ActionsUpdateRequest, + +) -> Response[ActionsUpdateResponse | Any]: + """ Set actions for the API consumer + + Args: + body (ActionsUpdateRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx2.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ActionsUpdateResponse | Any] + """ + + + kwargs = _get_kwargs( + body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + body: ActionsUpdateRequest, + +) -> ActionsUpdateResponse | Any | None: + """ Set actions for the API consumer + + Args: + body (ActionsUpdateRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx2.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ActionsUpdateResponse | Any + """ + + + return sync_detailed( + client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: ActionsUpdateRequest, + +) -> Response[ActionsUpdateResponse | Any]: + """ Set actions for the API consumer + + Args: + body (ActionsUpdateRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx2.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ActionsUpdateResponse | Any] + """ + + + kwargs = _get_kwargs( + body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + body: ActionsUpdateRequest, + +) -> ActionsUpdateResponse | Any | None: + """ Set actions for the API consumer + + Args: + body (ActionsUpdateRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx2.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ActionsUpdateResponse | Any + """ + + + return (await asyncio_detailed( + client=client, +body=body, + + )).parsed diff --git a/flixpy/flix/extension/extension_api/api/api_registration/registration_controller_unregister_client.py b/flixpy/flix/extension/extension_api/api/api_registration/registration_controller_unregister_client.py index 4431954..3e3d097 100644 --- a/flixpy/flix/extension/extension_api/api/api_registration/registration_controller_unregister_client.py +++ b/flixpy/flix/extension/extension_api/api/api_registration/registration_controller_unregister_client.py @@ -66,8 +66,6 @@ def sync_detailed( ) -> Response[Any]: """ Unregister API consumer - Removes the registration for the requesting API consumer. - Args: authorization (str): @@ -100,8 +98,6 @@ async def asyncio_detailed( ) -> Response[Any]: """ Unregister API consumer - Removes the registration for the requesting API consumer. - Args: authorization (str): diff --git a/flixpy/flix/extension/extension_api/api/events/__init__.py b/flixpy/flix/extension/extension_api/api/events/__init__.py new file mode 100644 index 0000000..c9921b5 --- /dev/null +++ b/flixpy/flix/extension/extension_api/api/events/__init__.py @@ -0,0 +1 @@ +""" Contains endpoint functions for accessing the API """ diff --git a/flixpy/flix/extension/extension_api/api/events/event_controller_handle_connection.py b/flixpy/flix/extension/extension_api/api/events/event_controller_handle_connection.py new file mode 100644 index 0000000..079f502 --- /dev/null +++ b/flixpy/flix/extension/extension_api/api/events/event_controller_handle_connection.py @@ -0,0 +1,189 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx2 + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.event_controller_handle_connection_event_item import EventControllerHandleConnectionEventItem +from ...models.sse_event import SSEEvent +from ...types import UNSET, Unset +from typing import cast + + + +def _get_kwargs( + *, + event: list[EventControllerHandleConnectionEventItem] | Unset = UNSET, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_event: list[str] | Unset = UNSET + if not isinstance(event, Unset): + json_event = [] + for event_item_data in event: + event_item = event_item_data.value + json_event.append(event_item) + + + params["event"] = json_event + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/events", + "params": params, + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx2.Response) -> SSEEvent | None: + if response.status_code == 200: + response_200 = SSEEvent.from_dict(response.json()) + + + + return response_200 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx2.Response) -> Response[SSEEvent]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event: list[EventControllerHandleConnectionEventItem] | Unset = UNSET, + +) -> Response[SSEEvent]: + """ Subscribe to events from the Client. + + Args: + event (list[EventControllerHandleConnectionEventItem] | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx2.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SSEEvent] + """ + + + kwargs = _get_kwargs( + event=event, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + event: list[EventControllerHandleConnectionEventItem] | Unset = UNSET, + +) -> SSEEvent | None: + """ Subscribe to events from the Client. + + Args: + event (list[EventControllerHandleConnectionEventItem] | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx2.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SSEEvent + """ + + + return sync_detailed( + client=client, +event=event, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event: list[EventControllerHandleConnectionEventItem] | Unset = UNSET, + +) -> Response[SSEEvent]: + """ Subscribe to events from the Client. + + Args: + event (list[EventControllerHandleConnectionEventItem] | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx2.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SSEEvent] + """ + + + kwargs = _get_kwargs( + event=event, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + event: list[EventControllerHandleConnectionEventItem] | Unset = UNSET, + +) -> SSEEvent | None: + """ Subscribe to events from the Client. + + Args: + event (list[EventControllerHandleConnectionEventItem] | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx2.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SSEEvent + """ + + + return (await asyncio_detailed( + client=client, +event=event, + + )).parsed diff --git a/flixpy/flix/extension/extension_api/api/health_check/health_check_controller_health_check.py b/flixpy/flix/extension/extension_api/api/health_check/health_check_controller_health_check.py index 60c167a..35682c5 100644 --- a/flixpy/flix/extension/extension_api/api/health_check/health_check_controller_health_check.py +++ b/flixpy/flix/extension/extension_api/api/health_check/health_check_controller_health_check.py @@ -56,8 +56,6 @@ def sync_detailed( ) -> Response[Any]: """ Health Check - Basic health check endpoint. Always returns a 200 response. - Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx2.TimeoutException: If the request takes longer than Client.timeout. @@ -85,8 +83,6 @@ async def asyncio_detailed( ) -> Response[Any]: """ Health Check - Basic health check endpoint. Always returns a 200 response. - Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx2.TimeoutException: If the request takes longer than Client.timeout. diff --git a/flixpy/flix/extension/extension_api/api/info/info_controller_get.py b/flixpy/flix/extension/extension_api/api/info/info_controller_get.py index b0a8175..7502de6 100644 --- a/flixpy/flix/extension/extension_api/api/info/info_controller_get.py +++ b/flixpy/flix/extension/extension_api/api/info/info_controller_get.py @@ -62,8 +62,6 @@ def sync_detailed( ) -> Response[InfoResponse]: """ Flix Client details - Provides details of current Flix Client and GRC API. Always returns a 200 response. - Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx2.TimeoutException: If the request takes longer than Client.timeout. @@ -90,8 +88,6 @@ def sync( ) -> InfoResponse | None: """ Flix Client details - Provides details of current Flix Client and GRC API. Always returns a 200 response. - Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx2.TimeoutException: If the request takes longer than Client.timeout. @@ -113,8 +109,6 @@ async def asyncio_detailed( ) -> Response[InfoResponse]: """ Flix Client details - Provides details of current Flix Client and GRC API. Always returns a 200 response. - Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx2.TimeoutException: If the request takes longer than Client.timeout. @@ -141,8 +135,6 @@ async def asyncio( ) -> InfoResponse | None: """ Flix Client details - Provides details of current Flix Client and GRC API. Always returns a 200 response. - Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx2.TimeoutException: If the request takes longer than Client.timeout. diff --git a/flixpy/flix/extension/extension_api/api/media_object_download/download_controller_download_media_object.py b/flixpy/flix/extension/extension_api/api/media_object_download/download_controller_download_media_object.py index b860ad8..8d73acf 100644 --- a/flixpy/flix/extension/extension_api/api/media_object_download/download_controller_download_media_object.py +++ b/flixpy/flix/extension/extension_api/api/media_object_download/download_controller_download_media_object.py @@ -75,8 +75,6 @@ def sync_detailed( ) -> Response[Any | DownloadResponse]: """ Download Media Object - Downloads a specific artwork type for a given asset, to a target folder on the local machine. - Args: body (DownloadRequest): @@ -108,8 +106,6 @@ def sync( ) -> Any | DownloadResponse | None: """ Download Media Object - Downloads a specific artwork type for a given asset, to a target folder on the local machine. - Args: body (DownloadRequest): @@ -136,8 +132,6 @@ async def asyncio_detailed( ) -> Response[Any | DownloadResponse]: """ Download Media Object - Downloads a specific artwork type for a given asset, to a target folder on the local machine. - Args: body (DownloadRequest): @@ -169,8 +163,6 @@ async def asyncio( ) -> Any | DownloadResponse | None: """ Download Media Object - Downloads a specific artwork type for a given asset, to a target folder on the local machine. - Args: body (DownloadRequest): diff --git a/flixpy/flix/extension/extension_api/api/panel_management/panel_controller_annotate.py b/flixpy/flix/extension/extension_api/api/panel_management/panel_controller_annotate.py index bb3969c..2e519c4 100644 --- a/flixpy/flix/extension/extension_api/api/panel_management/panel_controller_annotate.py +++ b/flixpy/flix/extension/extension_api/api/panel_management/panel_controller_annotate.py @@ -81,8 +81,6 @@ def sync_detailed( ) -> Response[Any | PanelRequestResponse]: """ Update Panel Annotations - Adds annotations to panels in the active sequence revision from the list of provided file paths. - Args: body (BulkPanelAnnotateRequest | FullPanelAnnotateRequest): @@ -114,8 +112,6 @@ def sync( ) -> Any | PanelRequestResponse | None: """ Update Panel Annotations - Adds annotations to panels in the active sequence revision from the list of provided file paths. - Args: body (BulkPanelAnnotateRequest | FullPanelAnnotateRequest): @@ -142,8 +138,6 @@ async def asyncio_detailed( ) -> Response[Any | PanelRequestResponse]: """ Update Panel Annotations - Adds annotations to panels in the active sequence revision from the list of provided file paths. - Args: body (BulkPanelAnnotateRequest | FullPanelAnnotateRequest): @@ -175,8 +169,6 @@ async def asyncio( ) -> Any | PanelRequestResponse | None: """ Update Panel Annotations - Adds annotations to panels in the active sequence revision from the list of provided file paths. - Args: body (BulkPanelAnnotateRequest | FullPanelAnnotateRequest): diff --git a/flixpy/flix/extension/extension_api/api/panel_management/panel_controller_create.py b/flixpy/flix/extension/extension_api/api/panel_management/panel_controller_create.py index d1e67ba..7508937 100644 --- a/flixpy/flix/extension/extension_api/api/panel_management/panel_controller_create.py +++ b/flixpy/flix/extension/extension_api/api/panel_management/panel_controller_create.py @@ -9,6 +9,7 @@ from ... import errors from ...models.bulk_panel_request import BulkPanelRequest +from ...models.full_panel_request import FullPanelRequest from ...models.panel_request_response import PanelRequestResponse from typing import cast @@ -16,7 +17,7 @@ def _get_kwargs( *, - body: BulkPanelRequest, + body: BulkPanelRequest | FullPanelRequest, ) -> dict[str, Any]: headers: dict[str, Any] = {} @@ -31,7 +32,12 @@ def _get_kwargs( "url": "/panels", } - _kwargs["json"] = body.to_dict() + + if isinstance(body, BulkPanelRequest): + _kwargs["json"] = body.to_dict() + else: + _kwargs["json"] = body.to_dict() + headers["Content-Type"] = "application/json" @@ -70,15 +76,13 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx2.Re def sync_detailed( *, client: AuthenticatedClient, - body: BulkPanelRequest, + body: BulkPanelRequest | FullPanelRequest, ) -> Response[Any | PanelRequestResponse]: """ Create New Panels - Creates new panels in the active sequence revision from the list of provided file paths. - Args: - body (BulkPanelRequest): + body (BulkPanelRequest | FullPanelRequest): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -103,15 +107,13 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - body: BulkPanelRequest, + body: BulkPanelRequest | FullPanelRequest, ) -> Any | PanelRequestResponse | None: """ Create New Panels - Creates new panels in the active sequence revision from the list of provided file paths. - Args: - body (BulkPanelRequest): + body (BulkPanelRequest | FullPanelRequest): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -131,15 +133,13 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - body: BulkPanelRequest, + body: BulkPanelRequest | FullPanelRequest, ) -> Response[Any | PanelRequestResponse]: """ Create New Panels - Creates new panels in the active sequence revision from the list of provided file paths. - Args: - body (BulkPanelRequest): + body (BulkPanelRequest | FullPanelRequest): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -164,15 +164,13 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - body: BulkPanelRequest, + body: BulkPanelRequest | FullPanelRequest, ) -> Any | PanelRequestResponse | None: """ Create New Panels - Creates new panels in the active sequence revision from the list of provided file paths. - Args: - body (BulkPanelRequest): + body (BulkPanelRequest | FullPanelRequest): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/flixpy/flix/extension/extension_api/api/panel_management/panel_controller_get.py b/flixpy/flix/extension/extension_api/api/panel_management/panel_controller_get.py new file mode 100644 index 0000000..5472ceb --- /dev/null +++ b/flixpy/flix/extension/extension_api/api/panel_management/panel_controller_get.py @@ -0,0 +1,282 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx2 + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.panel_details_response import PanelDetailsResponse +from ...types import UNSET, Unset +from typing import cast + + + +def _get_kwargs( + *, + selected: Any | Unset = UNSET, + range_: Any | Unset = UNSET, + panel_ids: Any | Unset = UNSET, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["selected"] = selected + + params["range"] = range_ + + params["panel_ids"] = panel_ids + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/panels", + "params": params, + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx2.Response) -> Any | PanelDetailsResponse | None: + if response.status_code == 200: + response_200 = PanelDetailsResponse.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = cast(Any, None) + return response_400 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx2.Response) -> Response[Any | PanelDetailsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + selected: Any | Unset = UNSET, + range_: Any | Unset = UNSET, + panel_ids: Any | Unset = UNSET, + +) -> Response[Any | PanelDetailsResponse]: + """ Get Panels from currently loaded Sequence Revision. + + Returns panels from the sequence revision currently open in the Panel Browser. + + Query params can be used on their own or combined: + + - no params: all panels in the sequence revision + + - `selected=true`: only the currently selected panels + + - `range=2,5`: only the panels placed between 2nd and 5th panels (including 2nd and 5th) + + - `panel_ids=1,2,3`: only the panels with the given ids + + - `selected=true&panel_ids=1,2,3`: only the selected panels whose ids are in the list + + - `selected=true&range=2,5&panel_ids=1,2,3`: only the selected panels, positioned between 2nd and + 5th panels whose ids are in the list + + Args: + selected (Any | Unset): Example: selected=true. + range_ (Any | Unset): Example: range=1,5. + panel_ids (Any | Unset): Example: panel_ids=1,2,3. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx2.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | PanelDetailsResponse] + """ + + + kwargs = _get_kwargs( + selected=selected, +range_=range_, +panel_ids=panel_ids, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + selected: Any | Unset = UNSET, + range_: Any | Unset = UNSET, + panel_ids: Any | Unset = UNSET, + +) -> Any | PanelDetailsResponse | None: + """ Get Panels from currently loaded Sequence Revision. + + Returns panels from the sequence revision currently open in the Panel Browser. + + Query params can be used on their own or combined: + + - no params: all panels in the sequence revision + + - `selected=true`: only the currently selected panels + + - `range=2,5`: only the panels placed between 2nd and 5th panels (including 2nd and 5th) + + - `panel_ids=1,2,3`: only the panels with the given ids + + - `selected=true&panel_ids=1,2,3`: only the selected panels whose ids are in the list + + - `selected=true&range=2,5&panel_ids=1,2,3`: only the selected panels, positioned between 2nd and + 5th panels whose ids are in the list + + Args: + selected (Any | Unset): Example: selected=true. + range_ (Any | Unset): Example: range=1,5. + panel_ids (Any | Unset): Example: panel_ids=1,2,3. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx2.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | PanelDetailsResponse + """ + + + return sync_detailed( + client=client, +selected=selected, +range_=range_, +panel_ids=panel_ids, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + selected: Any | Unset = UNSET, + range_: Any | Unset = UNSET, + panel_ids: Any | Unset = UNSET, + +) -> Response[Any | PanelDetailsResponse]: + """ Get Panels from currently loaded Sequence Revision. + + Returns panels from the sequence revision currently open in the Panel Browser. + + Query params can be used on their own or combined: + + - no params: all panels in the sequence revision + + - `selected=true`: only the currently selected panels + + - `range=2,5`: only the panels placed between 2nd and 5th panels (including 2nd and 5th) + + - `panel_ids=1,2,3`: only the panels with the given ids + + - `selected=true&panel_ids=1,2,3`: only the selected panels whose ids are in the list + + - `selected=true&range=2,5&panel_ids=1,2,3`: only the selected panels, positioned between 2nd and + 5th panels whose ids are in the list + + Args: + selected (Any | Unset): Example: selected=true. + range_ (Any | Unset): Example: range=1,5. + panel_ids (Any | Unset): Example: panel_ids=1,2,3. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx2.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | PanelDetailsResponse] + """ + + + kwargs = _get_kwargs( + selected=selected, +range_=range_, +panel_ids=panel_ids, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + selected: Any | Unset = UNSET, + range_: Any | Unset = UNSET, + panel_ids: Any | Unset = UNSET, + +) -> Any | PanelDetailsResponse | None: + """ Get Panels from currently loaded Sequence Revision. + + Returns panels from the sequence revision currently open in the Panel Browser. + + Query params can be used on their own or combined: + + - no params: all panels in the sequence revision + + - `selected=true`: only the currently selected panels + + - `range=2,5`: only the panels placed between 2nd and 5th panels (including 2nd and 5th) + + - `panel_ids=1,2,3`: only the panels with the given ids + + - `selected=true&panel_ids=1,2,3`: only the selected panels whose ids are in the list + + - `selected=true&range=2,5&panel_ids=1,2,3`: only the selected panels, positioned between 2nd and + 5th panels whose ids are in the list + + Args: + selected (Any | Unset): Example: selected=true. + range_ (Any | Unset): Example: range=1,5. + panel_ids (Any | Unset): Example: panel_ids=1,2,3. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx2.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | PanelDetailsResponse + """ + + + return (await asyncio_detailed( + client=client, +selected=selected, +range_=range_, +panel_ids=panel_ids, + + )).parsed diff --git a/flixpy/flix/extension/extension_api/api/panel_management/panel_controller_track_panel.py b/flixpy/flix/extension/extension_api/api/panel_management/panel_controller_track_panel.py new file mode 100644 index 0000000..cd6ae8d --- /dev/null +++ b/flixpy/flix/extension/extension_api/api/panel_management/panel_controller_track_panel.py @@ -0,0 +1,126 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx2 + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.panel_track_request import PanelTrackRequest +from typing import cast + + + +def _get_kwargs( + *, + body: PanelTrackRequest, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/panels/track", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx2.Response) -> Any | None: + if response.status_code == 200: + return None + + if response.status_code == 400: + return None + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx2.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: PanelTrackRequest, + +) -> Response[Any]: + """ Marks a panel as open in an extension + + Args: + body (PanelTrackRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx2.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + + kwargs = _get_kwargs( + body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: PanelTrackRequest, + +) -> Response[Any]: + """ Marks a panel as open in an extension + + Args: + body (PanelTrackRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx2.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + + kwargs = _get_kwargs( + body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + diff --git a/flixpy/flix/extension/extension_api/api/panel_management/panel_controller_untrack_panel.py b/flixpy/flix/extension/extension_api/api/panel_management/panel_controller_untrack_panel.py new file mode 100644 index 0000000..9289f64 --- /dev/null +++ b/flixpy/flix/extension/extension_api/api/panel_management/panel_controller_untrack_panel.py @@ -0,0 +1,126 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx2 + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.panel_track_request import PanelTrackRequest +from typing import cast + + + +def _get_kwargs( + *, + body: PanelTrackRequest, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/panels/track", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx2.Response) -> Any | None: + if response.status_code == 200: + return None + + if response.status_code == 400: + return None + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx2.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: PanelTrackRequest, + +) -> Response[Any]: + """ Marks a panel as not open in an extension + + Args: + body (PanelTrackRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx2.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + + kwargs = _get_kwargs( + body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: PanelTrackRequest, + +) -> Response[Any]: + """ Marks a panel as not open in an extension + + Args: + body (PanelTrackRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx2.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + + kwargs = _get_kwargs( + body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + diff --git a/flixpy/flix/extension/extension_api/api/panel_management/panel_controller_update.py b/flixpy/flix/extension/extension_api/api/panel_management/panel_controller_update.py index 967a782..f45fca0 100644 --- a/flixpy/flix/extension/extension_api/api/panel_management/panel_controller_update.py +++ b/flixpy/flix/extension/extension_api/api/panel_management/panel_controller_update.py @@ -81,8 +81,6 @@ def sync_detailed( ) -> Response[Any | PanelRequestResponse]: """ Update Existing Panels - Updates existing panels in the active sequence revision from the list of provided file paths. - Args: body (BulkPanelRequest | FullPanelRequest): @@ -114,8 +112,6 @@ def sync( ) -> Any | PanelRequestResponse | None: """ Update Existing Panels - Updates existing panels in the active sequence revision from the list of provided file paths. - Args: body (BulkPanelRequest | FullPanelRequest): @@ -142,8 +138,6 @@ async def asyncio_detailed( ) -> Response[Any | PanelRequestResponse]: """ Update Existing Panels - Updates existing panels in the active sequence revision from the list of provided file paths. - Args: body (BulkPanelRequest | FullPanelRequest): @@ -175,8 +169,6 @@ async def asyncio( ) -> Any | PanelRequestResponse | None: """ Update Existing Panels - Updates existing panels in the active sequence revision from the list of provided file paths. - Args: body (BulkPanelRequest | FullPanelRequest): diff --git a/flixpy/flix/extension/extension_api/api/panel_management/panel_controller_update_metadata.py b/flixpy/flix/extension/extension_api/api/panel_management/panel_controller_update_metadata.py new file mode 100644 index 0000000..07b11b2 --- /dev/null +++ b/flixpy/flix/extension/extension_api/api/panel_management/panel_controller_update_metadata.py @@ -0,0 +1,333 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx2 + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.panel_update_metadata_request import PanelUpdateMetadataRequest +from ...models.panel_update_metadata_response import PanelUpdateMetadataResponse +from ...types import UNSET, Unset +from typing import cast + + + +def _get_kwargs( + *, + body: PanelUpdateMetadataRequest, + selected: Any | Unset = UNSET, + range_: Any | Unset = UNSET, + panel_ids: Any | Unset = UNSET, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + params: dict[str, Any] = {} + + params["selected"] = selected + + params["range"] = range_ + + params["panel_ids"] = panel_ids + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/panels/metadata", + "params": params, + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx2.Response) -> Any | PanelUpdateMetadataResponse | None: + if response.status_code == 200: + response_200 = PanelUpdateMetadataResponse.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = cast(Any, None) + return response_400 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx2.Response) -> Response[Any | PanelUpdateMetadataResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: PanelUpdateMetadataRequest, + selected: Any | Unset = UNSET, + range_: Any | Unset = UNSET, + panel_ids: Any | Unset = UNSET, + +) -> Response[Any | PanelUpdateMetadataResponse]: + """ Update the metadata on the Panel Revisions from the currently loaded Sequence Revision. + + Updates panels metadata from the sequence revision currently open in the Panel Browser. + + Takes object with `metadata` key, which must be an `object` with key-value pairs, where the value is + a `string` or `null`. + + If the value of the provided metadata key is `null`, the existing metadata for this key will be + deleted. + + Query params can be used on their own or combined: + + - no params: all panels in the sequence revision + + - `selected=true`: only the currently selected panels + + - `range=2,5`: only the panels placed between 2nd and 5th panels (including 2nd and 5th) + + - `panel_ids=1,2,3`: only the panels with the given ids + + - `selected=true&panel_ids=1,2,3`: only the selected panels whose ids are in the list + + - `selected=true&range=2,5&panel_ids=1,2,3`: only the selected panels, positioned between 2nd and + 5th panels whose ids are in the list + + Returns list of update results, each including panel id and updated metadata. + + Args: + selected (Any | Unset): Example: selected=true. + range_ (Any | Unset): Example: range=1,5. + panel_ids (Any | Unset): Example: panel_ids=1,2,3. + body (PanelUpdateMetadataRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx2.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | PanelUpdateMetadataResponse] + """ + + + kwargs = _get_kwargs( + body=body, +selected=selected, +range_=range_, +panel_ids=panel_ids, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + body: PanelUpdateMetadataRequest, + selected: Any | Unset = UNSET, + range_: Any | Unset = UNSET, + panel_ids: Any | Unset = UNSET, + +) -> Any | PanelUpdateMetadataResponse | None: + """ Update the metadata on the Panel Revisions from the currently loaded Sequence Revision. + + Updates panels metadata from the sequence revision currently open in the Panel Browser. + + Takes object with `metadata` key, which must be an `object` with key-value pairs, where the value is + a `string` or `null`. + + If the value of the provided metadata key is `null`, the existing metadata for this key will be + deleted. + + Query params can be used on their own or combined: + + - no params: all panels in the sequence revision + + - `selected=true`: only the currently selected panels + + - `range=2,5`: only the panels placed between 2nd and 5th panels (including 2nd and 5th) + + - `panel_ids=1,2,3`: only the panels with the given ids + + - `selected=true&panel_ids=1,2,3`: only the selected panels whose ids are in the list + + - `selected=true&range=2,5&panel_ids=1,2,3`: only the selected panels, positioned between 2nd and + 5th panels whose ids are in the list + + Returns list of update results, each including panel id and updated metadata. + + Args: + selected (Any | Unset): Example: selected=true. + range_ (Any | Unset): Example: range=1,5. + panel_ids (Any | Unset): Example: panel_ids=1,2,3. + body (PanelUpdateMetadataRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx2.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | PanelUpdateMetadataResponse + """ + + + return sync_detailed( + client=client, +body=body, +selected=selected, +range_=range_, +panel_ids=panel_ids, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: PanelUpdateMetadataRequest, + selected: Any | Unset = UNSET, + range_: Any | Unset = UNSET, + panel_ids: Any | Unset = UNSET, + +) -> Response[Any | PanelUpdateMetadataResponse]: + """ Update the metadata on the Panel Revisions from the currently loaded Sequence Revision. + + Updates panels metadata from the sequence revision currently open in the Panel Browser. + + Takes object with `metadata` key, which must be an `object` with key-value pairs, where the value is + a `string` or `null`. + + If the value of the provided metadata key is `null`, the existing metadata for this key will be + deleted. + + Query params can be used on their own or combined: + + - no params: all panels in the sequence revision + + - `selected=true`: only the currently selected panels + + - `range=2,5`: only the panels placed between 2nd and 5th panels (including 2nd and 5th) + + - `panel_ids=1,2,3`: only the panels with the given ids + + - `selected=true&panel_ids=1,2,3`: only the selected panels whose ids are in the list + + - `selected=true&range=2,5&panel_ids=1,2,3`: only the selected panels, positioned between 2nd and + 5th panels whose ids are in the list + + Returns list of update results, each including panel id and updated metadata. + + Args: + selected (Any | Unset): Example: selected=true. + range_ (Any | Unset): Example: range=1,5. + panel_ids (Any | Unset): Example: panel_ids=1,2,3. + body (PanelUpdateMetadataRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx2.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | PanelUpdateMetadataResponse] + """ + + + kwargs = _get_kwargs( + body=body, +selected=selected, +range_=range_, +panel_ids=panel_ids, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + body: PanelUpdateMetadataRequest, + selected: Any | Unset = UNSET, + range_: Any | Unset = UNSET, + panel_ids: Any | Unset = UNSET, + +) -> Any | PanelUpdateMetadataResponse | None: + """ Update the metadata on the Panel Revisions from the currently loaded Sequence Revision. + + Updates panels metadata from the sequence revision currently open in the Panel Browser. + + Takes object with `metadata` key, which must be an `object` with key-value pairs, where the value is + a `string` or `null`. + + If the value of the provided metadata key is `null`, the existing metadata for this key will be + deleted. + + Query params can be used on their own or combined: + + - no params: all panels in the sequence revision + + - `selected=true`: only the currently selected panels + + - `range=2,5`: only the panels placed between 2nd and 5th panels (including 2nd and 5th) + + - `panel_ids=1,2,3`: only the panels with the given ids + + - `selected=true&panel_ids=1,2,3`: only the selected panels whose ids are in the list + + - `selected=true&range=2,5&panel_ids=1,2,3`: only the selected panels, positioned between 2nd and + 5th panels whose ids are in the list + + Returns list of update results, each including panel id and updated metadata. + + Args: + selected (Any | Unset): Example: selected=true. + range_ (Any | Unset): Example: range=1,5. + panel_ids (Any | Unset): Example: panel_ids=1,2,3. + body (PanelUpdateMetadataRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx2.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | PanelUpdateMetadataResponse + """ + + + return (await asyncio_detailed( + client=client, +body=body, +selected=selected, +range_=range_, +panel_ids=panel_ids, + + )).parsed diff --git a/flixpy/flix/extension/extension_api/api/project_details/project_controller_get.py b/flixpy/flix/extension/extension_api/api/project_details/project_controller_get.py index 4e6c1a4..880b57a 100644 --- a/flixpy/flix/extension/extension_api/api/project_details/project_controller_get.py +++ b/flixpy/flix/extension/extension_api/api/project_details/project_controller_get.py @@ -66,8 +66,6 @@ def sync_detailed( ) -> Response[Any | ProjectDetailsDto]: """ Get Current Flix Project - Returns details of the currently opened show, episode, sequence and sequence revision. - Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx2.TimeoutException: If the request takes longer than Client.timeout. @@ -94,8 +92,6 @@ def sync( ) -> Any | ProjectDetailsDto | None: """ Get Current Flix Project - Returns details of the currently opened show, episode, sequence and sequence revision. - Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx2.TimeoutException: If the request takes longer than Client.timeout. @@ -117,8 +113,6 @@ async def asyncio_detailed( ) -> Response[Any | ProjectDetailsDto]: """ Get Current Flix Project - Returns details of the currently opened show, episode, sequence and sequence revision. - Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx2.TimeoutException: If the request takes longer than Client.timeout. @@ -145,8 +139,6 @@ async def asyncio( ) -> Any | ProjectDetailsDto | None: """ Get Current Flix Project - Returns details of the currently opened show, episode, sequence and sequence revision. - Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx2.TimeoutException: If the request takes longer than Client.timeout. diff --git a/flixpy/flix/extension/extension_api/api/project_metadata/__init__.py b/flixpy/flix/extension/extension_api/api/project_metadata/__init__.py new file mode 100644 index 0000000..c9921b5 --- /dev/null +++ b/flixpy/flix/extension/extension_api/api/project_metadata/__init__.py @@ -0,0 +1 @@ +""" Contains endpoint functions for accessing the API """ diff --git a/flixpy/flix/extension/extension_api/api/project_metadata/project_metadata_controller_get.py b/flixpy/flix/extension/extension_api/api/project_metadata/project_metadata_controller_get.py new file mode 100644 index 0000000..bf04f08 --- /dev/null +++ b/flixpy/flix/extension/extension_api/api/project_metadata/project_metadata_controller_get.py @@ -0,0 +1,154 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx2 + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.project_details_metadata_dto import ProjectDetailsMetadataDto +from typing import cast + + + +def _get_kwargs( + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/project/metadata", + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx2.Response) -> Any | ProjectDetailsMetadataDto | None: + if response.status_code == 200: + response_200 = ProjectDetailsMetadataDto.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = cast(Any, None) + return response_400 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx2.Response) -> Response[Any | ProjectDetailsMetadataDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + +) -> Response[Any | ProjectDetailsMetadataDto]: + """ Get Current Flix Project metadata + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx2.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | ProjectDetailsMetadataDto] + """ + + + kwargs = _get_kwargs( + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + +) -> Any | ProjectDetailsMetadataDto | None: + """ Get Current Flix Project metadata + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx2.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | ProjectDetailsMetadataDto + """ + + + return sync_detailed( + client=client, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + +) -> Response[Any | ProjectDetailsMetadataDto]: + """ Get Current Flix Project metadata + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx2.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | ProjectDetailsMetadataDto] + """ + + + kwargs = _get_kwargs( + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + +) -> Any | ProjectDetailsMetadataDto | None: + """ Get Current Flix Project metadata + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx2.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | ProjectDetailsMetadataDto + """ + + + return (await asyncio_detailed( + client=client, + + )).parsed diff --git a/flixpy/flix/extension/extension_api/api/project_metadata/project_metadata_controller_update_metadata.py b/flixpy/flix/extension/extension_api/api/project_metadata/project_metadata_controller_update_metadata.py new file mode 100644 index 0000000..480d017 --- /dev/null +++ b/flixpy/flix/extension/extension_api/api/project_metadata/project_metadata_controller_update_metadata.py @@ -0,0 +1,148 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx2 + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.project_details_metadata_dto import ProjectDetailsMetadataDto +from typing import cast + + + +def _get_kwargs( + *, + body: ProjectDetailsMetadataDto, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/project/metadata", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx2.Response) -> Any | None: + if response.status_code == 200: + return None + + if response.status_code == 400: + return None + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx2.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: ProjectDetailsMetadataDto, + +) -> Response[Any]: + """ Update Entity Metadata in Current Project + + Merges custom metadata into the target entity (show, episode, sequence, or sequence-revision) within + the active project context.Requested entities must exist in the current project context. + ### Convention & Best Practices: + - Prefix keys with your extension/plugin identifier (e.g. `com.vendor.plugin:key`) to avoid + collisions. + - Only keys provided are updated; omitted keys remain untouched. + - If the key does not exist, it will be created unless its value is `null`. + - Set a key's value to `null` to delete it. + - If the key does not exist with the specified name and `null` is provided as its value, it will be + ignored. + + Args: + body (ProjectDetailsMetadataDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx2.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + + kwargs = _get_kwargs( + body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: ProjectDetailsMetadataDto, + +) -> Response[Any]: + """ Update Entity Metadata in Current Project + + Merges custom metadata into the target entity (show, episode, sequence, or sequence-revision) within + the active project context.Requested entities must exist in the current project context. + ### Convention & Best Practices: + - Prefix keys with your extension/plugin identifier (e.g. `com.vendor.plugin:key`) to avoid + collisions. + - Only keys provided are updated; omitted keys remain untouched. + - If the key does not exist, it will be created unless its value is `null`. + - Set a key's value to `null` to delete it. + - If the key does not exist with the specified name and `null` is provided as its value, it will be + ignored. + + Args: + body (ProjectDetailsMetadataDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx2.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + + kwargs = _get_kwargs( + body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + diff --git a/flixpy/flix/extension/extension_api/api/status/status_controller_get.py b/flixpy/flix/extension/extension_api/api/status/status_controller_get.py index ba60beb..79d11ea 100644 --- a/flixpy/flix/extension/extension_api/api/status/status_controller_get.py +++ b/flixpy/flix/extension/extension_api/api/status/status_controller_get.py @@ -66,8 +66,6 @@ def sync_detailed( ) -> Response[Any | StatusResponse]: """ Get Flix Status - Returns details of the current state of the Flix Client. - Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx2.TimeoutException: If the request takes longer than Client.timeout. @@ -94,8 +92,6 @@ def sync( ) -> Any | StatusResponse | None: """ Get Flix Status - Returns details of the current state of the Flix Client. - Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx2.TimeoutException: If the request takes longer than Client.timeout. @@ -117,8 +113,6 @@ async def asyncio_detailed( ) -> Response[Any | StatusResponse]: """ Get Flix Status - Returns details of the current state of the Flix Client. - Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx2.TimeoutException: If the request takes longer than Client.timeout. @@ -145,8 +139,6 @@ async def asyncio( ) -> Any | StatusResponse | None: """ Get Flix Status - Returns details of the current state of the Flix Client. - Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx2.TimeoutException: If the request takes longer than Client.timeout. diff --git a/flixpy/flix/extension/extension_api/models/__init__.py b/flixpy/flix/extension/extension_api/models/__init__.py index c49050b..8e6cbe2 100644 --- a/flixpy/flix/extension/extension_api/models/__init__.py +++ b/flixpy/flix/extension/extension_api/models/__init__.py @@ -1,9 +1,15 @@ """ Contains all the data models used in inputs/outputs """ from .action_event import ActionEvent +from .action_event_panel_response import ActionEventPanelResponse +from .action_event_panel_response_metadata import ActionEventPanelResponseMetadata +from .action_registration import ActionRegistration +from .action_registration_type import ActionRegistrationType from .action_state import ActionState from .action_type import ActionType from .actions_in_progress_response import ActionsInProgressResponse +from .actions_update_request import ActionsUpdateRequest +from .actions_update_response import ActionsUpdateResponse from .asset_type import AssetType from .bulk_panel_annotate_request import BulkPanelAnnotateRequest from .bulk_panel_request import BulkPanelRequest @@ -11,34 +17,85 @@ from .download_request import DownloadRequest from .download_response import DownloadResponse from .episode_details_dto import EpisodeDetailsDto +from .episode_details_dto_metadata import EpisodeDetailsDtoMetadata +from .event_controller_handle_connection_event_item import EventControllerHandleConnectionEventItem from .full_panel_annotate_request import FullPanelAnnotateRequest from .full_panel_request import FullPanelRequest from .info_response import InfoResponse +from .keyframe_dto import KeyframeDto from .open_file_event import OpenFileEvent from .open_file_panel_data import OpenFilePanelData +from .open_file_panel_data_origin_sbp import OpenFilePanelDataOriginSbp +from .open_file_shot_data import OpenFileShotData from .open_source_file_data import OpenSourceFileData from .open_source_file_event import OpenSourceFileEvent +from .panel_details_response import PanelDetailsResponse +from .panel_metadata_update_event import PanelMetadataUpdateEvent from .panel_request_item import PanelRequestItem +from .panel_request_item_metadata import PanelRequestItemMetadata +from .panel_request_item_origin_sbp import PanelRequestItemOriginSbp from .panel_request_response import PanelRequestResponse from .panel_request_source_file import PanelRequestSourceFile +from .panel_revision_details_dto import PanelRevisionDetailsDto +from .panel_revision_details_dto_metadata import PanelRevisionDetailsDtoMetadata +from .panel_revision_details_dto_origin_sbp_type_0 import PanelRevisionDetailsDtoOriginSbpType0 from .panel_selection_response import PanelSelectionResponse +from .panel_track_request import PanelTrackRequest +from .panel_update_metadata_request import PanelUpdateMetadataRequest +from .panel_update_metadata_request_metadata import PanelUpdateMetadataRequestMetadata +from .panel_update_metadata_response import PanelUpdateMetadataResponse +from .panel_update_metadata_response_item import PanelUpdateMetadataResponseItem +from .panel_update_metadata_response_item_metadata import PanelUpdateMetadataResponseItemMetadata from .ping_event import PingEvent from .preferences_controller_lookup_preferences_response_200 import PreferencesControllerLookupPreferencesResponse200 from .project_details_dto import ProjectDetailsDto +from .project_details_metadata_dto import ProjectDetailsMetadataDto +from .project_details_metadata_dto_episode import ProjectDetailsMetadataDtoEpisode +from .project_details_metadata_dto_sequence import ProjectDetailsMetadataDtoSequence +from .project_details_metadata_dto_sequence_revision import ProjectDetailsMetadataDtoSequenceRevision +from .project_details_metadata_dto_show import ProjectDetailsMetadataDtoShow from .project_ids_dto import ProjectIdsDto +from .project_metadata_update_event import ProjectMetadataUpdateEvent from .ps_configuration import PsConfiguration from .registration_details import RegistrationDetails +from .registration_details_actions_item import RegistrationDetailsActionsItem from .registration_request import RegistrationRequest from .registration_response import RegistrationResponse from .revision_status_response import RevisionStatusResponse from .sequence_details_dto import SequenceDetailsDto +from .sequence_details_dto_metadata import SequenceDetailsDtoMetadata from .sequence_revision_details_dto import SequenceRevisionDetailsDto +from .sequence_revision_details_dto_metadata import SequenceRevisionDetailsDtoMetadata from .show_details_dto import ShowDetailsDto +from .show_details_dto_metadata import ShowDetailsDtoMetadata from .source_file_preview_mode import SourceFilePreviewMode from .source_file_type import SourceFileType +from .sse_event import SSEEvent +from .sse_event_data_type_0 import SSEEventDataType0 +from .sse_event_data_type_0_type import SSEEventDataType0Type +from .sse_event_data_type_1 import SSEEventDataType1 +from .sse_event_data_type_1_type import SSEEventDataType1Type +from .sse_event_data_type_2 import SSEEventDataType2 +from .sse_event_data_type_2_type import SSEEventDataType2Type +from .sse_event_data_type_3 import SSEEventDataType3 +from .sse_event_data_type_3_type import SSEEventDataType3Type +from .sse_event_data_type_4 import SSEEventDataType4 +from .sse_event_data_type_4_type import SSEEventDataType4Type +from .sse_event_data_type_5 import SSEEventDataType5 +from .sse_event_data_type_5_type import SSEEventDataType5Type +from .sse_event_data_type_6 import SSEEventDataType6 +from .sse_event_data_type_6_data import SSEEventDataType6Data +from .sse_event_data_type_6_type import SSEEventDataType6Type +from .sse_event_data_type_7 import SSEEventDataType7 +from .sse_event_data_type_7_type import SSEEventDataType7Type +from .sse_event_data_type_8 import SSEEventDataType8 +from .sse_event_data_type_8_type import SSEEventDataType8Type from .status_response import StatusResponse from .subscribe_request import SubscribeRequest +from .updated_panel_metadata_dto import UpdatedPanelMetadataDto +from .updated_panel_metadata_dto_metadata import UpdatedPanelMetadataDtoMetadata from .version_event import VersionEvent +from .viewport_dto import ViewportDto from .websocket_event import WebsocketEvent from .websocket_event_data_type_0 import WebsocketEventDataType0 from .websocket_event_data_type_0_type import WebsocketEventDataType0Type @@ -55,11 +112,21 @@ from .websocket_event_data_type_6 import WebsocketEventDataType6 from .websocket_event_data_type_6_data import WebsocketEventDataType6Data from .websocket_event_data_type_6_type import WebsocketEventDataType6Type +from .websocket_event_data_type_7 import WebsocketEventDataType7 +from .websocket_event_data_type_7_type import WebsocketEventDataType7Type +from .websocket_event_data_type_8 import WebsocketEventDataType8 +from .websocket_event_data_type_8_type import WebsocketEventDataType8Type __all__ = ( "ActionEvent", + "ActionEventPanelResponse", + "ActionEventPanelResponseMetadata", + "ActionRegistration", + "ActionRegistrationType", "ActionsInProgressResponse", "ActionState", + "ActionsUpdateRequest", + "ActionsUpdateResponse", "ActionType", "AssetType", "BulkPanelAnnotateRequest", @@ -68,34 +135,85 @@ "DownloadRequest", "DownloadResponse", "EpisodeDetailsDto", + "EpisodeDetailsDtoMetadata", + "EventControllerHandleConnectionEventItem", "FullPanelAnnotateRequest", "FullPanelRequest", "InfoResponse", + "KeyframeDto", "OpenFileEvent", "OpenFilePanelData", + "OpenFilePanelDataOriginSbp", + "OpenFileShotData", "OpenSourceFileData", "OpenSourceFileEvent", + "PanelDetailsResponse", + "PanelMetadataUpdateEvent", "PanelRequestItem", + "PanelRequestItemMetadata", + "PanelRequestItemOriginSbp", "PanelRequestResponse", "PanelRequestSourceFile", + "PanelRevisionDetailsDto", + "PanelRevisionDetailsDtoMetadata", + "PanelRevisionDetailsDtoOriginSbpType0", "PanelSelectionResponse", + "PanelTrackRequest", + "PanelUpdateMetadataRequest", + "PanelUpdateMetadataRequestMetadata", + "PanelUpdateMetadataResponse", + "PanelUpdateMetadataResponseItem", + "PanelUpdateMetadataResponseItemMetadata", "PingEvent", "PreferencesControllerLookupPreferencesResponse200", "ProjectDetailsDto", + "ProjectDetailsMetadataDto", + "ProjectDetailsMetadataDtoEpisode", + "ProjectDetailsMetadataDtoSequence", + "ProjectDetailsMetadataDtoSequenceRevision", + "ProjectDetailsMetadataDtoShow", "ProjectIdsDto", + "ProjectMetadataUpdateEvent", "PsConfiguration", "RegistrationDetails", + "RegistrationDetailsActionsItem", "RegistrationRequest", "RegistrationResponse", "RevisionStatusResponse", "SequenceDetailsDto", + "SequenceDetailsDtoMetadata", "SequenceRevisionDetailsDto", + "SequenceRevisionDetailsDtoMetadata", "ShowDetailsDto", + "ShowDetailsDtoMetadata", "SourceFilePreviewMode", "SourceFileType", + "SSEEvent", + "SSEEventDataType0", + "SSEEventDataType0Type", + "SSEEventDataType1", + "SSEEventDataType1Type", + "SSEEventDataType2", + "SSEEventDataType2Type", + "SSEEventDataType3", + "SSEEventDataType3Type", + "SSEEventDataType4", + "SSEEventDataType4Type", + "SSEEventDataType5", + "SSEEventDataType5Type", + "SSEEventDataType6", + "SSEEventDataType6Data", + "SSEEventDataType6Type", + "SSEEventDataType7", + "SSEEventDataType7Type", + "SSEEventDataType8", + "SSEEventDataType8Type", "StatusResponse", "SubscribeRequest", + "UpdatedPanelMetadataDto", + "UpdatedPanelMetadataDtoMetadata", "VersionEvent", + "ViewportDto", "WebsocketEvent", "WebsocketEventDataType0", "WebsocketEventDataType0Type", @@ -112,4 +230,8 @@ "WebsocketEventDataType6", "WebsocketEventDataType6Data", "WebsocketEventDataType6Type", + "WebsocketEventDataType7", + "WebsocketEventDataType7Type", + "WebsocketEventDataType8", + "WebsocketEventDataType8Type", ) diff --git a/flixpy/flix/extension/extension_api/models/action_event.py b/flixpy/flix/extension/extension_api/models/action_event.py index c7e1b3f..47d9a17 100644 --- a/flixpy/flix/extension/extension_api/models/action_event.py +++ b/flixpy/flix/extension/extension_api/models/action_event.py @@ -10,8 +10,11 @@ from ..models.action_state import ActionState from ..models.action_type import ActionType +from ..types import UNSET, Unset from typing import cast +if TYPE_CHECKING: + from ..models.action_event_panel_response import ActionEventPanelResponse @@ -29,12 +32,14 @@ class ActionEvent: action_id (int): state (ActionState): action (ActionType): + panels (list[ActionEventPanelResponse] | Unset): """ api_client_id: int | None action_id: int state: ActionState action: ActionType + panels: list[ActionEventPanelResponse] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -42,6 +47,7 @@ class ActionEvent: def to_dict(self) -> dict[str, Any]: + from ..models.action_event_panel_response import ActionEventPanelResponse # noqa: PLC0415 api_client_id: int | None api_client_id = self.api_client_id @@ -51,6 +57,15 @@ def to_dict(self) -> dict[str, Any]: action = self.action.value + panels: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.panels, Unset): + panels = [] + for panels_item_data in self.panels: + panels_item = panels_item_data.to_dict() + panels.append(panels_item) + + + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -60,6 +75,8 @@ def to_dict(self) -> dict[str, Any]: "state": state, "action": action, }) + if panels is not UNSET: + field_dict["panels"] = panels return field_dict @@ -67,6 +84,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.action_event_panel_response import ActionEventPanelResponse # noqa: PLC0415 d = dict(src_dict) def _parse_api_client_id(data: object) -> int | None: if data is None: @@ -88,11 +106,24 @@ def _parse_api_client_id(data: object) -> int | None: + _panels = d.pop("panels", UNSET) + panels: list[ActionEventPanelResponse] | Unset = UNSET + if _panels is not UNSET: + panels = [] + for panels_item_data in _panels: + panels_item = ActionEventPanelResponse.from_dict(panels_item_data) + + + + panels.append(panels_item) + + action_event = cls( api_client_id=api_client_id, action_id=action_id, state=state, action=action, + panels=panels, ) diff --git a/flixpy/flix/extension/extension_api/models/action_event_panel_response.py b/flixpy/flix/extension/extension_api/models/action_event_panel_response.py new file mode 100644 index 0000000..4b868ca --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/action_event_panel_response.py @@ -0,0 +1,118 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.action_event_panel_response_metadata import ActionEventPanelResponseMetadata + + + + + +T = TypeVar("T", bound="ActionEventPanelResponse") + + + +@_attrs_define +class ActionEventPanelResponse: + """ + Attributes: + panel_id (int): + panel_revision (int): + path (str): + metadata (ActionEventPanelResponseMetadata | Unset): Arbitrary key-value metadata for the panel. Example: + {'ftrack:sequence_id': 9402}. + """ + + panel_id: int + panel_revision: int + path: str + metadata: ActionEventPanelResponseMetadata | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.action_event_panel_response_metadata import ActionEventPanelResponseMetadata # noqa: PLC0415 + panel_id = self.panel_id + + panel_revision = self.panel_revision + + path = self.path + + metadata: dict[str, Any] | Unset = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "panelId": panel_id, + "panelRevision": panel_revision, + "path": path, + }) + if metadata is not UNSET: + field_dict["metadata"] = metadata + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.action_event_panel_response_metadata import ActionEventPanelResponseMetadata # noqa: PLC0415 + d = dict(src_dict) + panel_id = d.pop("panelId") + + panel_revision = d.pop("panelRevision") + + path = d.pop("path") + + _metadata = d.pop("metadata", UNSET) + metadata: ActionEventPanelResponseMetadata | Unset + if isinstance(_metadata, Unset) or _metadata is None: + metadata = UNSET + else: + metadata = ActionEventPanelResponseMetadata.from_dict(_metadata) + + + + + action_event_panel_response = cls( + panel_id=panel_id, + panel_revision=panel_revision, + path=path, + metadata=metadata, + ) + + + action_event_panel_response.additional_properties = d + return action_event_panel_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/action_event_panel_response_metadata.py b/flixpy/flix/extension/extension_api/models/action_event_panel_response_metadata.py new file mode 100644 index 0000000..28bea2a --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/action_event_panel_response_metadata.py @@ -0,0 +1,69 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="ActionEventPanelResponseMetadata") + + + +@_attrs_define +class ActionEventPanelResponseMetadata: + """ Arbitrary key-value metadata for the panel. + + Example: + {'ftrack:sequence_id': 9402} + + """ + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + action_event_panel_response_metadata = cls( + ) + + + action_event_panel_response_metadata.additional_properties = d + return action_event_panel_response_metadata + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/action_registration.py b/flixpy/flix/extension/extension_api/models/action_registration.py new file mode 100644 index 0000000..ad55008 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/action_registration.py @@ -0,0 +1,126 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.action_registration_type import ActionRegistrationType +from ..types import UNSET, Unset + + + + + + +T = TypeVar("T", bound="ActionRegistration") + + + +@_attrs_define +class ActionRegistration: + """ + Attributes: + id (str): Unique identifier for this action. + name (str): The user-friendly name for this action to be displayed in the UI. + type_ (ActionRegistrationType | Unset): Context/location of the action within the application. + For now only PanelBrowserAction is supported and will be set regardless of provided value. + description (str | Unset): The user-friendly description for this action to be displayed in the UI. + icon_svg (str | Unset): A simple SVG icon for this specific action when displayed in the UI. + This value will be processed upon registration and may display incorrectly if unsupported SVG features are used. + """ + + id: str + name: str + type_: ActionRegistrationType | Unset = UNSET + description: str | Unset = UNSET + icon_svg: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + type_: str | Unset = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + + description = self.description + + icon_svg = self.icon_svg + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "name": name, + }) + if type_ is not UNSET: + field_dict["type"] = type_ + if description is not UNSET: + field_dict["description"] = description + if icon_svg is not UNSET: + field_dict["iconSvg"] = icon_svg + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name") + + _type_ = d.pop("type", UNSET) + type_: ActionRegistrationType | Unset + if isinstance(_type_, Unset) or _type_ is None: + type_ = UNSET + else: + type_ = ActionRegistrationType(_type_) + + + + + description = d.pop("description", UNSET) + + icon_svg = d.pop("iconSvg", UNSET) + + action_registration = cls( + id=id, + name=name, + type_=type_, + description=description, + icon_svg=icon_svg, + ) + + + action_registration.additional_properties = d + return action_registration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/action_registration_type.py b/flixpy/flix/extension/extension_api/models/action_registration_type.py new file mode 100644 index 0000000..a91e307 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/action_registration_type.py @@ -0,0 +1,8 @@ +from enum import Enum + + +class ActionRegistrationType(str, Enum): + PANEL_BROWSER_ACTION = "PanelBrowserAction" + + def __str__(self) -> str: + return str(self.value) diff --git a/flixpy/flix/extension/extension_api/models/actions_update_request.py b/flixpy/flix/extension/extension_api/models/actions_update_request.py new file mode 100644 index 0000000..a4d47d0 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/actions_update_request.py @@ -0,0 +1,94 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.action_registration import ActionRegistration + + + + + +T = TypeVar("T", bound="ActionsUpdateRequest") + + + +@_attrs_define +class ActionsUpdateRequest: + """ + Attributes: + actions (list[ActionRegistration]): List of actions to be updated for this API client. + """ + + actions: list[ActionRegistration] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.action_registration import ActionRegistration # noqa: PLC0415 + actions = [] + for actions_item_data in self.actions: + actions_item = actions_item_data.to_dict() + actions.append(actions_item) + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "actions": actions, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.action_registration import ActionRegistration # noqa: PLC0415 + d = dict(src_dict) + actions = [] + _actions = d.pop("actions") + for actions_item_data in (_actions): + actions_item = ActionRegistration.from_dict(actions_item_data) + + + + actions.append(actions_item) + + + actions_update_request = cls( + actions=actions, + ) + + + actions_update_request.additional_properties = d + return actions_update_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/actions_update_response.py b/flixpy/flix/extension/extension_api/models/actions_update_response.py new file mode 100644 index 0000000..5362bcf --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/actions_update_response.py @@ -0,0 +1,94 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.action_registration import ActionRegistration + + + + + +T = TypeVar("T", bound="ActionsUpdateResponse") + + + +@_attrs_define +class ActionsUpdateResponse: + """ + Attributes: + actions (list[ActionRegistration]): The list of actions registered for this API consumer's extension. + """ + + actions: list[ActionRegistration] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.action_registration import ActionRegistration # noqa: PLC0415 + actions = [] + for actions_item_data in self.actions: + actions_item = actions_item_data.to_dict() + actions.append(actions_item) + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "actions": actions, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.action_registration import ActionRegistration # noqa: PLC0415 + d = dict(src_dict) + actions = [] + _actions = d.pop("actions") + for actions_item_data in (_actions): + actions_item = ActionRegistration.from_dict(actions_item_data) + + + + actions.append(actions_item) + + + actions_update_response = cls( + actions=actions, + ) + + + actions_update_response.additional_properties = d + return actions_update_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/asset_type.py b/flixpy/flix/extension/extension_api/models/asset_type.py index ce82123..b356bac 100644 --- a/flixpy/flix/extension/extension_api/models/asset_type.py +++ b/flixpy/flix/extension/extension_api/models/asset_type.py @@ -11,9 +11,17 @@ class AssetType(str, Enum): DNXHD = "dnxhd" EXTENSION = "extension" FULLRES = "fullres" + IMPORT_LOG = "import_log" + IMPORT_LOG_BUNDLE = "import_log_bundle" LOGO = "logo" + PROFILE_IMAGE_128X128 = "profile_image_128x128" + PROFILE_IMAGE_256X256 = "profile_image_256x256" + PROFILE_IMAGE_512X512 = "profile_image_512x512" + PROFILE_IMAGE_64X64 = "profile_image_64x64" + PROFILE_ORIGINAL = "profile_original" PUBLISH = "publish" PUBLISH_FULLSIZED = "publish_fullsized" + SBOARD = "sboard" SCALED = "scaled" SHOW_THUMBNAIL = "show-thumbnail" SOURCE_FILE = "source_file" diff --git a/flixpy/flix/extension/extension_api/models/bulk_panel_annotate_request.py b/flixpy/flix/extension/extension_api/models/bulk_panel_annotate_request.py index 2c30913..fe67e14 100644 --- a/flixpy/flix/extension/extension_api/models/bulk_panel_annotate_request.py +++ b/flixpy/flix/extension/extension_api/models/bulk_panel_annotate_request.py @@ -25,8 +25,8 @@ class BulkPanelAnnotateRequest: Attributes: start_index (int): (Optional) The index from which to annotate panels. Defaults to currently selected panel. Example: 3. - paths (list[str]): The file paths to be uploaded as panel annotations. Example: - ['/path/to/file/1.psd','/path/to/file/2.psd']. + paths (list[str]): The file paths to be uploaded as panel annotations. Example: ['/path/to/file/1.psd', + '/path/to/file/2.psd']. origin (str): The origin of the incoming annotation. Example: Photoshop. """ diff --git a/flixpy/flix/extension/extension_api/models/bulk_panel_request.py b/flixpy/flix/extension/extension_api/models/bulk_panel_request.py index be946b6..72089d2 100644 --- a/flixpy/flix/extension/extension_api/models/bulk_panel_request.py +++ b/flixpy/flix/extension/extension_api/models/bulk_panel_request.py @@ -26,8 +26,8 @@ class BulkPanelRequest: """ Attributes: - paths (list[str]): The file paths to upload as new panel artwork. Example: - ['/path/to/file/1.psd','/path/to/file/2.psd']. + paths (list[str]): The file paths to upload as new panel artwork. Example: ['/path/to/file/1.psd', + '/path/to/file/2.psd']. origin (str): The origin of the incoming panel artwork. Example: Photoshop. start_index (int | Unset): (Optional) The index from which to insert or update panels. Defaults to currently selected panel. Example: 3. @@ -94,7 +94,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _source_file = d.pop("sourceFile", UNSET) source_file: PanelRequestSourceFile | Unset - if isinstance(_source_file, Unset): + if isinstance(_source_file, Unset) or _source_file is None: source_file = UNSET else: source_file = PanelRequestSourceFile.from_dict(_source_file) diff --git a/flixpy/flix/extension/extension_api/models/client_event_type.py b/flixpy/flix/extension/extension_api/models/client_event_type.py index a33332d..e79f52c 100644 --- a/flixpy/flix/extension/extension_api/models/client_event_type.py +++ b/flixpy/flix/extension/extension_api/models/client_event_type.py @@ -4,9 +4,11 @@ class ClientEventType(str, Enum): ACTION = "ACTION" OPEN = "OPEN" + PANEL_METADATA_UPDATE = "PANEL_METADATA_UPDATE" PING = "PING" PREFERENCES = "PREFERENCES" PROJECT = "PROJECT" + PROJECT_METADATA_UPDATE = "PROJECT_METADATA_UPDATE" STATUS = "STATUS" VERSION = "VERSION" diff --git a/flixpy/flix/extension/extension_api/models/episode_details_dto.py b/flixpy/flix/extension/extension_api/models/episode_details_dto.py index 5435c44..0277c61 100644 --- a/flixpy/flix/extension/extension_api/models/episode_details_dto.py +++ b/flixpy/flix/extension/extension_api/models/episode_details_dto.py @@ -8,9 +8,12 @@ from ..types import UNSET, Unset +from ..types import UNSET, Unset from typing import cast import datetime +if TYPE_CHECKING: + from ..models.episode_details_dto_metadata import EpisodeDetailsDtoMetadata @@ -29,6 +32,13 @@ class EpisodeDetailsDto: created_date (datetime.datetime): The date the episode was created. owner (str): The user that created the episode. title (None | str): The episode's display title. + metadata (EpisodeDetailsDtoMetadata | Unset): Arbitrary key-value metadata to merge into the entity. Each value + must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + Example: {'com.myextension:status': 'inprogress', 'com.myextension:tag': None}. """ id: int @@ -36,6 +46,7 @@ class EpisodeDetailsDto: created_date: datetime.datetime owner: str title: None | str + metadata: EpisodeDetailsDtoMetadata | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -43,6 +54,7 @@ class EpisodeDetailsDto: def to_dict(self) -> dict[str, Any]: + from ..models.episode_details_dto_metadata import EpisodeDetailsDtoMetadata # noqa: PLC0415 id = self.id tracking_code = self.tracking_code @@ -54,6 +66,10 @@ def to_dict(self) -> dict[str, Any]: title: None | str title = self.title + metadata: dict[str, Any] | Unset = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -64,6 +80,8 @@ def to_dict(self) -> dict[str, Any]: "owner": owner, "title": title, }) + if metadata is not UNSET: + field_dict["metadata"] = metadata return field_dict @@ -71,6 +89,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.episode_details_dto_metadata import EpisodeDetailsDtoMetadata # noqa: PLC0415 d = dict(src_dict) id = d.pop("id") @@ -91,12 +110,23 @@ def _parse_title(data: object) -> None | str: title = _parse_title(d.pop("title")) + _metadata = d.pop("metadata", UNSET) + metadata: EpisodeDetailsDtoMetadata | Unset + if isinstance(_metadata, Unset) or _metadata is None: + metadata = UNSET + else: + metadata = EpisodeDetailsDtoMetadata.from_dict(_metadata) + + + + episode_details_dto = cls( id=id, tracking_code=tracking_code, created_date=created_date, owner=owner, title=title, + metadata=metadata, ) diff --git a/flixpy/flix/extension/extension_api/models/episode_details_dto_metadata.py b/flixpy/flix/extension/extension_api/models/episode_details_dto_metadata.py new file mode 100644 index 0000000..5d0f089 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/episode_details_dto_metadata.py @@ -0,0 +1,73 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="EpisodeDetailsDtoMetadata") + + + +@_attrs_define +class EpisodeDetailsDtoMetadata: + """ Arbitrary key-value metadata to merge into the entity. Each value must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + + Example: + {'com.myextension:status': 'inprogress', 'com.myextension:tag': None} + + """ + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + episode_details_dto_metadata = cls( + ) + + + episode_details_dto_metadata.additional_properties = d + return episode_details_dto_metadata + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/event_controller_handle_connection_event_item.py b/flixpy/flix/extension/extension_api/models/event_controller_handle_connection_event_item.py new file mode 100644 index 0000000..065b63c --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/event_controller_handle_connection_event_item.py @@ -0,0 +1,16 @@ +from enum import Enum + + +class EventControllerHandleConnectionEventItem(str, Enum): + ACTION = "action" + OPEN = "open" + PANEL_METADATA_UPDATE = "panel_metadata_update" + PING = "ping" + PREFERENCES = "preferences" + PROJECT = "project" + PROJECT_METADATA_UPDATE = "project_metadata_update" + STATUS = "status" + VERSION = "version" + + def __str__(self) -> str: + return str(self.value) diff --git a/flixpy/flix/extension/extension_api/models/full_panel_request.py b/flixpy/flix/extension/extension_api/models/full_panel_request.py index d040b2f..59fc94d 100644 --- a/flixpy/flix/extension/extension_api/models/full_panel_request.py +++ b/flixpy/flix/extension/extension_api/models/full_panel_request.py @@ -106,7 +106,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _source_file = d.pop("sourceFile", UNSET) source_file: PanelRequestSourceFile | Unset - if isinstance(_source_file, Unset): + if isinstance(_source_file, Unset) or _source_file is None: source_file = UNSET else: source_file = PanelRequestSourceFile.from_dict(_source_file) diff --git a/flixpy/flix/extension/extension_api/models/keyframe_dto.py b/flixpy/flix/extension/extension_api/models/keyframe_dto.py new file mode 100644 index 0000000..9e2e3bd --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/keyframe_dto.py @@ -0,0 +1,160 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.viewport_dto import ViewportDto + + + + + +T = TypeVar("T", bound="KeyframeDto") + + + +@_attrs_define +class KeyframeDto: + """ + Attributes: + anchor_point_horizontal (int): The horizontal value of the point that CenterHoriz, CenterVert and Rotation are + applied to, + specified as an offset from the viewport centre in fractions of the horizontal viewport resolution. + A value of 0 is the centre of the viewport, while a value of -0.5 is the left edge of the viewport. Default: 0. + anchor_point_vertical (int): The vertical value of the point that CenterHoriz, CenterVert and Rotation are + applied to, + specified as an offset from the viewport centre in fractions of the vertical viewport resolution. + A value of 0 is the centre of the viewport, while a value of -0.5 is the top edge of the viewport. Default: 0. + center_horizontal (int): The horizontal position of the camera in fractions of the viewport width, relative to + the centre of the viewport. + A positive value means the camera is positioned to the left of the viewport centre. Default: 0. + center_vertical (int): The vertical position of the camera in fractions of the viewport height, relative to the + centre of the viewport. + A positive value means the camera is positioned above the viewport centre. Default: 0. + rotation (int): How much to rotate the image clockwise in degrees. Default: 0. + scale (int): A vertical and horizontal scale, 100 meaning no scaling. Default: 0. + start_key (int): The frame of the panel revision that the information of this keyframe relates to, starting at + 0. Default: 0. + viewport (ViewportDto | Unset): + """ + + anchor_point_horizontal: int = 0 + anchor_point_vertical: int = 0 + center_horizontal: int = 0 + center_vertical: int = 0 + rotation: int = 0 + scale: int = 0 + start_key: int = 0 + viewport: ViewportDto | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.viewport_dto import ViewportDto # noqa: PLC0415 + anchor_point_horizontal = self.anchor_point_horizontal + + anchor_point_vertical = self.anchor_point_vertical + + center_horizontal = self.center_horizontal + + center_vertical = self.center_vertical + + rotation = self.rotation + + scale = self.scale + + start_key = self.start_key + + viewport: dict[str, Any] | Unset = UNSET + if not isinstance(self.viewport, Unset): + viewport = self.viewport.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "anchorPointHorizontal": anchor_point_horizontal, + "anchorPointVertical": anchor_point_vertical, + "centerHorizontal": center_horizontal, + "centerVertical": center_vertical, + "rotation": rotation, + "scale": scale, + "startKey": start_key, + }) + if viewport is not UNSET: + field_dict["viewport"] = viewport + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.viewport_dto import ViewportDto # noqa: PLC0415 + d = dict(src_dict) + anchor_point_horizontal = d.pop("anchorPointHorizontal") + + anchor_point_vertical = d.pop("anchorPointVertical") + + center_horizontal = d.pop("centerHorizontal") + + center_vertical = d.pop("centerVertical") + + rotation = d.pop("rotation") + + scale = d.pop("scale") + + start_key = d.pop("startKey") + + _viewport = d.pop("viewport", UNSET) + viewport: ViewportDto | Unset + if isinstance(_viewport, Unset) or _viewport is None: + viewport = UNSET + else: + viewport = ViewportDto.from_dict(_viewport) + + + + + keyframe_dto = cls( + anchor_point_horizontal=anchor_point_horizontal, + anchor_point_vertical=anchor_point_vertical, + center_horizontal=center_horizontal, + center_vertical=center_vertical, + rotation=rotation, + scale=scale, + start_key=start_key, + viewport=viewport, + ) + + + keyframe_dto.additional_properties = d + return keyframe_dto + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/open_file_event.py b/flixpy/flix/extension/extension_api/models/open_file_event.py index 800a373..35d375b 100644 --- a/flixpy/flix/extension/extension_api/models/open_file_event.py +++ b/flixpy/flix/extension/extension_api/models/open_file_event.py @@ -13,6 +13,7 @@ if TYPE_CHECKING: from ..models.open_file_panel_data import OpenFilePanelData + from ..models.open_file_shot_data import OpenFileShotData from ..models.project_ids_dto import ProjectIdsDto from ..models.ps_configuration import PsConfiguration @@ -30,12 +31,16 @@ class OpenFileEvent: Attributes: project (ProjectIdsDto): panels (list[OpenFilePanelData]): + shots (list[OpenFileShotData]): sketching_tool_configuration (PsConfiguration | Unset): + action_id (str | Unset): """ project: ProjectIdsDto panels: list[OpenFilePanelData] + shots: list[OpenFileShotData] sketching_tool_configuration: PsConfiguration | Unset = UNSET + action_id: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -44,6 +49,7 @@ class OpenFileEvent: def to_dict(self) -> dict[str, Any]: from ..models.open_file_panel_data import OpenFilePanelData # noqa: PLC0415 + from ..models.open_file_shot_data import OpenFileShotData # noqa: PLC0415 from ..models.project_ids_dto import ProjectIdsDto # noqa: PLC0415 from ..models.ps_configuration import PsConfiguration # noqa: PLC0415 project = self.project.to_dict() @@ -55,19 +61,31 @@ def to_dict(self) -> dict[str, Any]: + shots = [] + for shots_item_data in self.shots: + shots_item = shots_item_data.to_dict() + shots.append(shots_item) + + + sketching_tool_configuration: dict[str, Any] | Unset = UNSET if not isinstance(self.sketching_tool_configuration, Unset): sketching_tool_configuration = self.sketching_tool_configuration.to_dict() + action_id = self.action_id + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({ "project": project, "panels": panels, + "shots": shots, }) if sketching_tool_configuration is not UNSET: field_dict["sketchingToolConfiguration"] = sketching_tool_configuration + if action_id is not UNSET: + field_dict["actionId"] = action_id return field_dict @@ -76,6 +94,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.open_file_panel_data import OpenFilePanelData # noqa: PLC0415 + from ..models.open_file_shot_data import OpenFileShotData # noqa: PLC0415 from ..models.project_ids_dto import ProjectIdsDto # noqa: PLC0415 from ..models.ps_configuration import PsConfiguration # noqa: PLC0415 d = dict(src_dict) @@ -94,9 +113,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: panels.append(panels_item) + shots = [] + _shots = d.pop("shots") + for shots_item_data in (_shots): + shots_item = OpenFileShotData.from_dict(shots_item_data) + + + + shots.append(shots_item) + + _sketching_tool_configuration = d.pop("sketchingToolConfiguration", UNSET) sketching_tool_configuration: PsConfiguration | Unset - if isinstance(_sketching_tool_configuration, Unset): + if isinstance(_sketching_tool_configuration, Unset) or _sketching_tool_configuration is None: sketching_tool_configuration = UNSET else: sketching_tool_configuration = PsConfiguration.from_dict(_sketching_tool_configuration) @@ -104,10 +133,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + action_id = d.pop("actionId", UNSET) + open_file_event = cls( project=project, panels=panels, + shots=shots, sketching_tool_configuration=sketching_tool_configuration, + action_id=action_id, ) diff --git a/flixpy/flix/extension/extension_api/models/open_file_panel_data.py b/flixpy/flix/extension/extension_api/models/open_file_panel_data.py index 54074b3..97257a9 100644 --- a/flixpy/flix/extension/extension_api/models/open_file_panel_data.py +++ b/flixpy/flix/extension/extension_api/models/open_file_panel_data.py @@ -12,6 +12,8 @@ from typing import cast if TYPE_CHECKING: + from ..models.keyframe_dto import KeyframeDto + from ..models.open_file_panel_data_origin_sbp import OpenFilePanelDataOriginSbp from ..models.open_source_file_data import OpenSourceFileData @@ -27,17 +29,31 @@ class OpenFilePanelData: """ Attributes: id (int): + index (int): + revision_id (int): asset_id (int): is_animated (bool): - source_file (None | OpenSourceFileData): + source_file (OpenSourceFileData | Unset): annotation_asset_id (int | Unset): + shot_id (int | Unset): + dialogue (str | Unset): + origin_sbp (OpenFilePanelDataOriginSbp | Unset): + keyframes (list[KeyframeDto] | Unset): + shot_name (str | Unset): """ id: int + index: int + revision_id: int asset_id: int is_animated: bool - source_file: None | OpenSourceFileData + source_file: OpenSourceFileData | Unset = UNSET annotation_asset_id: int | Unset = UNSET + shot_id: int | Unset = UNSET + dialogue: str | Unset = UNSET + origin_sbp: OpenFilePanelDataOriginSbp | Unset = UNSET + keyframes: list[KeyframeDto] | Unset = UNSET + shot_name: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -45,32 +61,68 @@ class OpenFilePanelData: def to_dict(self) -> dict[str, Any]: + from ..models.keyframe_dto import KeyframeDto # noqa: PLC0415 + from ..models.open_file_panel_data_origin_sbp import OpenFilePanelDataOriginSbp # noqa: PLC0415 from ..models.open_source_file_data import OpenSourceFileData # noqa: PLC0415 id = self.id + index = self.index + + revision_id = self.revision_id + asset_id = self.asset_id is_animated = self.is_animated - source_file: dict[str, Any] | None - if isinstance(self.source_file, OpenSourceFileData): + source_file: dict[str, Any] | Unset = UNSET + if not isinstance(self.source_file, Unset): source_file = self.source_file.to_dict() - else: - source_file = self.source_file annotation_asset_id = self.annotation_asset_id + shot_id = self.shot_id + + dialogue = self.dialogue + + origin_sbp: dict[str, Any] | Unset = UNSET + if not isinstance(self.origin_sbp, Unset): + origin_sbp = self.origin_sbp.to_dict() + + keyframes: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.keyframes, Unset): + keyframes = [] + for keyframes_item_data in self.keyframes: + keyframes_item = keyframes_item_data.to_dict() + keyframes.append(keyframes_item) + + + + shot_name = self.shot_name + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({ "id": id, + "index": index, + "revisionId": revision_id, "assetId": asset_id, "isAnimated": is_animated, - "sourceFile": source_file, }) + if source_file is not UNSET: + field_dict["sourceFile"] = source_file if annotation_asset_id is not UNSET: field_dict["annotationAssetId"] = annotation_asset_id + if shot_id is not UNSET: + field_dict["shotId"] = shot_id + if dialogue is not UNSET: + field_dict["dialogue"] = dialogue + if origin_sbp is not UNSET: + field_dict["originSbp"] = origin_sbp + if keyframes is not UNSET: + field_dict["keyframes"] = keyframes + if shot_name is not UNSET: + field_dict["shotName"] = shot_name return field_dict @@ -78,40 +130,73 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.keyframe_dto import KeyframeDto # noqa: PLC0415 + from ..models.open_file_panel_data_origin_sbp import OpenFilePanelDataOriginSbp # noqa: PLC0415 from ..models.open_source_file_data import OpenSourceFileData # noqa: PLC0415 d = dict(src_dict) id = d.pop("id") + index = d.pop("index") + + revision_id = d.pop("revisionId") + asset_id = d.pop("assetId") is_animated = d.pop("isAnimated") - def _parse_source_file(data: object) -> None | OpenSourceFileData: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - source_file_type_1 = OpenSourceFileData.from_dict(data) + _source_file = d.pop("sourceFile", UNSET) + source_file: OpenSourceFileData | Unset + if isinstance(_source_file, Unset) or _source_file is None: + source_file = UNSET + else: + source_file = OpenSourceFileData.from_dict(_source_file) + - return source_file_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | OpenSourceFileData, data) + annotation_asset_id = d.pop("annotationAssetId", UNSET) - source_file = _parse_source_file(d.pop("sourceFile")) + shot_id = d.pop("shotId", UNSET) + dialogue = d.pop("dialogue", UNSET) - annotation_asset_id = d.pop("annotationAssetId", UNSET) + _origin_sbp = d.pop("originSbp", UNSET) + origin_sbp: OpenFilePanelDataOriginSbp | Unset + if isinstance(_origin_sbp, Unset) or _origin_sbp is None: + origin_sbp = UNSET + else: + origin_sbp = OpenFilePanelDataOriginSbp.from_dict(_origin_sbp) + + + + + _keyframes = d.pop("keyframes", UNSET) + keyframes: list[KeyframeDto] | Unset = UNSET + if _keyframes is not UNSET: + keyframes = [] + for keyframes_item_data in _keyframes: + keyframes_item = KeyframeDto.from_dict(keyframes_item_data) + + + + keyframes.append(keyframes_item) + + + shot_name = d.pop("shotName", UNSET) open_file_panel_data = cls( id=id, + index=index, + revision_id=revision_id, asset_id=asset_id, is_animated=is_animated, source_file=source_file, annotation_asset_id=annotation_asset_id, + shot_id=shot_id, + dialogue=dialogue, + origin_sbp=origin_sbp, + keyframes=keyframes, + shot_name=shot_name, ) diff --git a/flixpy/flix/extension/extension_api/models/open_file_panel_data_origin_sbp.py b/flixpy/flix/extension/extension_api/models/open_file_panel_data_origin_sbp.py new file mode 100644 index 0000000..6a2b987 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/open_file_panel_data_origin_sbp.py @@ -0,0 +1,64 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="OpenFilePanelDataOriginSbp") + + + +@_attrs_define +class OpenFilePanelDataOriginSbp: + + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + open_file_panel_data_origin_sbp = cls( + ) + + + open_file_panel_data_origin_sbp.additional_properties = d + return open_file_panel_data_origin_sbp + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/open_file_shot_data.py b/flixpy/flix/extension/extension_api/models/open_file_shot_data.py new file mode 100644 index 0000000..4fcb5b2 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/open_file_shot_data.py @@ -0,0 +1,108 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="OpenFileShotData") + + + +@_attrs_define +class OpenFileShotData: + """ + Attributes: + id (int): + index (int): + start_panel_index (int): + end_panel_index (int): + name (str): + """ + + id: int + index: int + start_panel_index: int + end_panel_index: int + name: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + id = self.id + + index = self.index + + start_panel_index = self.start_panel_index + + end_panel_index = self.end_panel_index + + name = self.name + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "index": index, + "startPanelIndex": start_panel_index, + "endPanelIndex": end_panel_index, + "name": name, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + index = d.pop("index") + + start_panel_index = d.pop("startPanelIndex") + + end_panel_index = d.pop("endPanelIndex") + + name = d.pop("name") + + open_file_shot_data = cls( + id=id, + index=index, + start_panel_index=start_panel_index, + end_panel_index=end_panel_index, + name=name, + ) + + + open_file_shot_data.additional_properties = d + return open_file_shot_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/panel_details_response.py b/flixpy/flix/extension/extension_api/models/panel_details_response.py new file mode 100644 index 0000000..213a630 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/panel_details_response.py @@ -0,0 +1,94 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.panel_revision_details_dto import PanelRevisionDetailsDto + + + + + +T = TypeVar("T", bound="PanelDetailsResponse") + + + +@_attrs_define +class PanelDetailsResponse: + """ + Attributes: + panels (list[PanelRevisionDetailsDto]): Requested panels. + """ + + panels: list[PanelRevisionDetailsDto] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.panel_revision_details_dto import PanelRevisionDetailsDto # noqa: PLC0415 + panels = [] + for panels_item_data in self.panels: + panels_item = panels_item_data.to_dict() + panels.append(panels_item) + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "panels": panels, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.panel_revision_details_dto import PanelRevisionDetailsDto # noqa: PLC0415 + d = dict(src_dict) + panels = [] + _panels = d.pop("panels") + for panels_item_data in (_panels): + panels_item = PanelRevisionDetailsDto.from_dict(panels_item_data) + + + + panels.append(panels_item) + + + panel_details_response = cls( + panels=panels, + ) + + + panel_details_response.additional_properties = d + return panel_details_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/panel_metadata_update_event.py b/flixpy/flix/extension/extension_api/models/panel_metadata_update_event.py new file mode 100644 index 0000000..962d574 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/panel_metadata_update_event.py @@ -0,0 +1,94 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.updated_panel_metadata_dto import UpdatedPanelMetadataDto + + + + + +T = TypeVar("T", bound="PanelMetadataUpdateEvent") + + + +@_attrs_define +class PanelMetadataUpdateEvent: + """ + Attributes: + panels (list[UpdatedPanelMetadataDto]): + """ + + panels: list[UpdatedPanelMetadataDto] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.updated_panel_metadata_dto import UpdatedPanelMetadataDto # noqa: PLC0415 + panels = [] + for panels_item_data in self.panels: + panels_item = panels_item_data.to_dict() + panels.append(panels_item) + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "panels": panels, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.updated_panel_metadata_dto import UpdatedPanelMetadataDto # noqa: PLC0415 + d = dict(src_dict) + panels = [] + _panels = d.pop("panels") + for panels_item_data in (_panels): + panels_item = UpdatedPanelMetadataDto.from_dict(panels_item_data) + + + + panels.append(panels_item) + + + panel_metadata_update_event = cls( + panels=panels, + ) + + + panel_metadata_update_event.additional_properties = d + return panel_metadata_update_event + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/panel_request_item.py b/flixpy/flix/extension/extension_api/models/panel_request_item.py index d57b389..fffc690 100644 --- a/flixpy/flix/extension/extension_api/models/panel_request_item.py +++ b/flixpy/flix/extension/extension_api/models/panel_request_item.py @@ -9,7 +9,12 @@ from ..types import UNSET, Unset from ..types import UNSET, Unset +from typing import cast +if TYPE_CHECKING: + from ..models.keyframe_dto import KeyframeDto + from ..models.panel_request_item_metadata import PanelRequestItemMetadata + from ..models.panel_request_item_origin_sbp import PanelRequestItemOriginSbp @@ -25,10 +30,46 @@ class PanelRequestItem: Attributes: path (str): The file path to upload. Example: /path/to/file/1.psd. panel_id (int | Unset): The ID of the panel that should be updated. Example: 15. + duration (int | Unset): Duration is the number of frames this instance of [PanelRevision] has, within this + [Shot]. + trim_in_frame (int | Unset): TrimInFrame is the trim in of this panel revision in a given sequence revision if + this is an animated panel. + trim_out_frame (int | Unset): TrimOutFrame is the trim out of this panel revision in a given sequence revision + if this is an animated panel. + metadata (PanelRequestItemMetadata | Unset): Arbitrary key-value metadata to merge into the entity. Each value + must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + Example: {'com.myextension:status': 'inprogress', 'com.myextension:tag': None}. + keyframes (list[KeyframeDto] | Unset): The camera move keyframes on this panel revisions. + origin_sbp (PanelRequestItemOriginSbp | Unset): Contains information about panel revisions imported from + Storyboard Pro. + This is for internal use by the Storyboard Pro extension and might be removed in the future without notice. + source_media (str | Unset): This is used to upload a MOV file that will be used as the source media for the + panel preview. + dialogue (str | Unset): This is dialogue text that will be associated with the panel. + layer_transform (bool | Unset): This indicates whether panel has layer transform. + shot_name (str | Unset): The name of the shot this panel belongs to. + When specified, a shot with the given name will be created and this panel will be added to it. + If the name already exists within the sequence, the request will be rejected with a 400 Bad Request response. + If not provided, the panel will be added to an existing shot based on the target insert index. Example: Shot + 001. """ path: str panel_id: int | Unset = UNSET + duration: int | Unset = UNSET + trim_in_frame: int | Unset = UNSET + trim_out_frame: int | Unset = UNSET + metadata: PanelRequestItemMetadata | Unset = UNSET + keyframes: list[KeyframeDto] | Unset = UNSET + origin_sbp: PanelRequestItemOriginSbp | Unset = UNSET + source_media: str | Unset = UNSET + dialogue: str | Unset = UNSET + layer_transform: bool | Unset = UNSET + shot_name: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -36,10 +77,44 @@ class PanelRequestItem: def to_dict(self) -> dict[str, Any]: + from ..models.keyframe_dto import KeyframeDto # noqa: PLC0415 + from ..models.panel_request_item_metadata import PanelRequestItemMetadata # noqa: PLC0415 + from ..models.panel_request_item_origin_sbp import PanelRequestItemOriginSbp # noqa: PLC0415 path = self.path panel_id = self.panel_id + duration = self.duration + + trim_in_frame = self.trim_in_frame + + trim_out_frame = self.trim_out_frame + + metadata: dict[str, Any] | Unset = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + keyframes: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.keyframes, Unset): + keyframes = [] + for keyframes_item_data in self.keyframes: + keyframes_item = keyframes_item_data.to_dict() + keyframes.append(keyframes_item) + + + + origin_sbp: dict[str, Any] | Unset = UNSET + if not isinstance(self.origin_sbp, Unset): + origin_sbp = self.origin_sbp.to_dict() + + source_media = self.source_media + + dialogue = self.dialogue + + layer_transform = self.layer_transform + + shot_name = self.shot_name + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -48,6 +123,26 @@ def to_dict(self) -> dict[str, Any]: }) if panel_id is not UNSET: field_dict["panelId"] = panel_id + if duration is not UNSET: + field_dict["duration"] = duration + if trim_in_frame is not UNSET: + field_dict["trimInFrame"] = trim_in_frame + if trim_out_frame is not UNSET: + field_dict["trimOutFrame"] = trim_out_frame + if metadata is not UNSET: + field_dict["metadata"] = metadata + if keyframes is not UNSET: + field_dict["keyframes"] = keyframes + if origin_sbp is not UNSET: + field_dict["originSbp"] = origin_sbp + if source_media is not UNSET: + field_dict["sourceMedia"] = source_media + if dialogue is not UNSET: + field_dict["dialogue"] = dialogue + if layer_transform is not UNSET: + field_dict["layerTransform"] = layer_transform + if shot_name is not UNSET: + field_dict["shotName"] = shot_name return field_dict @@ -55,14 +150,73 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.keyframe_dto import KeyframeDto # noqa: PLC0415 + from ..models.panel_request_item_metadata import PanelRequestItemMetadata # noqa: PLC0415 + from ..models.panel_request_item_origin_sbp import PanelRequestItemOriginSbp # noqa: PLC0415 d = dict(src_dict) path = d.pop("path") panel_id = d.pop("panelId", UNSET) + duration = d.pop("duration", UNSET) + + trim_in_frame = d.pop("trimInFrame", UNSET) + + trim_out_frame = d.pop("trimOutFrame", UNSET) + + _metadata = d.pop("metadata", UNSET) + metadata: PanelRequestItemMetadata | Unset + if isinstance(_metadata, Unset) or _metadata is None: + metadata = UNSET + else: + metadata = PanelRequestItemMetadata.from_dict(_metadata) + + + + + _keyframes = d.pop("keyframes", UNSET) + keyframes: list[KeyframeDto] | Unset = UNSET + if _keyframes is not UNSET: + keyframes = [] + for keyframes_item_data in _keyframes: + keyframes_item = KeyframeDto.from_dict(keyframes_item_data) + + + + keyframes.append(keyframes_item) + + + _origin_sbp = d.pop("originSbp", UNSET) + origin_sbp: PanelRequestItemOriginSbp | Unset + if isinstance(_origin_sbp, Unset) or _origin_sbp is None: + origin_sbp = UNSET + else: + origin_sbp = PanelRequestItemOriginSbp.from_dict(_origin_sbp) + + + + + source_media = d.pop("sourceMedia", UNSET) + + dialogue = d.pop("dialogue", UNSET) + + layer_transform = d.pop("layerTransform", UNSET) + + shot_name = d.pop("shotName", UNSET) + panel_request_item = cls( path=path, panel_id=panel_id, + duration=duration, + trim_in_frame=trim_in_frame, + trim_out_frame=trim_out_frame, + metadata=metadata, + keyframes=keyframes, + origin_sbp=origin_sbp, + source_media=source_media, + dialogue=dialogue, + layer_transform=layer_transform, + shot_name=shot_name, ) diff --git a/flixpy/flix/extension/extension_api/models/panel_request_item_metadata.py b/flixpy/flix/extension/extension_api/models/panel_request_item_metadata.py new file mode 100644 index 0000000..b35d337 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/panel_request_item_metadata.py @@ -0,0 +1,73 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="PanelRequestItemMetadata") + + + +@_attrs_define +class PanelRequestItemMetadata: + """ Arbitrary key-value metadata to merge into the entity. Each value must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + + Example: + {'com.myextension:status': 'inprogress', 'com.myextension:tag': None} + + """ + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + panel_request_item_metadata = cls( + ) + + + panel_request_item_metadata.additional_properties = d + return panel_request_item_metadata + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/panel_request_item_origin_sbp.py b/flixpy/flix/extension/extension_api/models/panel_request_item_origin_sbp.py new file mode 100644 index 0000000..6d3f617 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/panel_request_item_origin_sbp.py @@ -0,0 +1,67 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="PanelRequestItemOriginSbp") + + + +@_attrs_define +class PanelRequestItemOriginSbp: + """ Contains information about panel revisions imported from Storyboard Pro. + This is for internal use by the Storyboard Pro extension and might be removed in the future without notice. + + """ + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + panel_request_item_origin_sbp = cls( + ) + + + panel_request_item_origin_sbp.additional_properties = d + return panel_request_item_origin_sbp + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/panel_request_source_file.py b/flixpy/flix/extension/extension_api/models/panel_request_source_file.py index 0dc64d8..551e322 100644 --- a/flixpy/flix/extension/extension_api/models/panel_request_source_file.py +++ b/flixpy/flix/extension/extension_api/models/panel_request_source_file.py @@ -25,7 +25,8 @@ class PanelRequestSourceFile: """ Attributes: path (str): The path to the source file. Example: /path/to/source/file.psd. - preview_mode (SourceFilePreviewMode): The mode to use to generate the source file preview. Example: source_file. + preview_mode (SourceFilePreviewMode): The mode to use to generate the source file preview. + @default 'first_panel' Example: source_file. source_file_type (SourceFileType): The extension type that the source file is coming from. Example: Sketch. """ diff --git a/flixpy/flix/extension/extension_api/models/panel_revision_details_dto.py b/flixpy/flix/extension/extension_api/models/panel_revision_details_dto.py new file mode 100644 index 0000000..afbedb7 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/panel_revision_details_dto.py @@ -0,0 +1,298 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast +import datetime + +if TYPE_CHECKING: + from ..models.keyframe_dto import KeyframeDto + from ..models.panel_revision_details_dto_metadata import PanelRevisionDetailsDtoMetadata + from ..models.panel_revision_details_dto_origin_sbp_type_0 import PanelRevisionDetailsDtoOriginSbpType0 + + + + + +T = TypeVar("T", bound="PanelRevisionDetailsDto") + + + +@_attrs_define +class PanelRevisionDetailsDto: + """ + Attributes: + panel_id (int): The identifier of this panel. + revision_id (int): The panel revision of this panel instance. + panel_position (int): The position of the panel in the sequence revision it belongs to. + asset_id (int): The identifier for the asset associated with this panel. + show_id (int): The show this panel belongs to. + sequence_id (int): The sequence this panel belongs to. + trim_in_frame (int): TrimInFrame is the trim in of this panel revision in a given sequence revision if this is + an animated panel. + trim_out_frame (int): TrimOutFrame is the trim out of this panel revision in a given sequence revision if this + is an animated panel. + metadata (PanelRevisionDetailsDtoMetadata): Arbitrary key-value metadata to merge into the entity. Each value + must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + Example: {'com.myextension:status': 'inprogress', 'com.myextension:tag': None}. + created_date (datetime.datetime): The date the panel was created. + revision_date (datetime.datetime): The date at which this panel revision was created. + owner (str): The user that originally created this "panel revision". + hidden (bool): Flag that indicates if a panel has been hidden in a sequence revision. + duration (float): The duration of the panel in frames. + layer_transform (bool): Whether the panel revision had a layer transform applied to it in Storyboard Pro. + dialogue (str): This dialogue associated with this panel. + keyframes (list[KeyframeDto]): The camera move keyframes on this panel revisions. + origin (str): Where the panel comes from e.g. "manual import". + shot_name (str): Sequence Revision shot this panel belongs to. + origin_sbp (None | PanelRevisionDetailsDtoOriginSbpType0 | Unset): Contains information about panel revisions + imported from Storyboard Pro. + This is for internal use by the Storyboard Pro extension and might be removed in the future without notice. + """ + + panel_id: int + revision_id: int + panel_position: int + asset_id: int + show_id: int + sequence_id: int + trim_in_frame: int + trim_out_frame: int + metadata: PanelRevisionDetailsDtoMetadata + created_date: datetime.datetime + revision_date: datetime.datetime + owner: str + hidden: bool + duration: float + layer_transform: bool + dialogue: str + keyframes: list[KeyframeDto] + origin: str + shot_name: str + origin_sbp: None | PanelRevisionDetailsDtoOriginSbpType0 | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.keyframe_dto import KeyframeDto # noqa: PLC0415 + from ..models.panel_revision_details_dto_metadata import PanelRevisionDetailsDtoMetadata # noqa: PLC0415 + from ..models.panel_revision_details_dto_origin_sbp_type_0 import PanelRevisionDetailsDtoOriginSbpType0 # noqa: PLC0415 + panel_id = self.panel_id + + revision_id = self.revision_id + + panel_position = self.panel_position + + asset_id = self.asset_id + + show_id = self.show_id + + sequence_id = self.sequence_id + + trim_in_frame = self.trim_in_frame + + trim_out_frame = self.trim_out_frame + + metadata = self.metadata.to_dict() + + created_date = self.created_date.isoformat() + + revision_date = self.revision_date.isoformat() + + owner = self.owner + + hidden = self.hidden + + duration = self.duration + + layer_transform = self.layer_transform + + dialogue = self.dialogue + + keyframes = [] + for keyframes_item_data in self.keyframes: + keyframes_item = keyframes_item_data.to_dict() + keyframes.append(keyframes_item) + + + + origin = self.origin + + shot_name = self.shot_name + + origin_sbp: dict[str, Any] | None | Unset + if isinstance(self.origin_sbp, Unset): + origin_sbp = UNSET + elif isinstance(self.origin_sbp, PanelRevisionDetailsDtoOriginSbpType0): + origin_sbp = self.origin_sbp.to_dict() + else: + origin_sbp = self.origin_sbp + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "panelId": panel_id, + "revisionId": revision_id, + "panelPosition": panel_position, + "assetId": asset_id, + "showId": show_id, + "sequenceId": sequence_id, + "trimInFrame": trim_in_frame, + "trimOutFrame": trim_out_frame, + "metadata": metadata, + "createdDate": created_date, + "revisionDate": revision_date, + "owner": owner, + "hidden": hidden, + "duration": duration, + "layerTransform": layer_transform, + "dialogue": dialogue, + "keyframes": keyframes, + "origin": origin, + "shotName": shot_name, + }) + if origin_sbp is not UNSET: + field_dict["originSbp"] = origin_sbp + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.keyframe_dto import KeyframeDto # noqa: PLC0415 + from ..models.panel_revision_details_dto_metadata import PanelRevisionDetailsDtoMetadata # noqa: PLC0415 + from ..models.panel_revision_details_dto_origin_sbp_type_0 import PanelRevisionDetailsDtoOriginSbpType0 # noqa: PLC0415 + d = dict(src_dict) + panel_id = d.pop("panelId") + + revision_id = d.pop("revisionId") + + panel_position = d.pop("panelPosition") + + asset_id = d.pop("assetId") + + show_id = d.pop("showId") + + sequence_id = d.pop("sequenceId") + + trim_in_frame = d.pop("trimInFrame") + + trim_out_frame = d.pop("trimOutFrame") + + metadata = PanelRevisionDetailsDtoMetadata.from_dict(d.pop("metadata")) + + + + + created_date = datetime.datetime.fromisoformat(d.pop("createdDate")) + + + + + revision_date = datetime.datetime.fromisoformat(d.pop("revisionDate")) + + + + + owner = d.pop("owner") + + hidden = d.pop("hidden") + + duration = d.pop("duration") + + layer_transform = d.pop("layerTransform") + + dialogue = d.pop("dialogue") + + keyframes = [] + _keyframes = d.pop("keyframes") + for keyframes_item_data in (_keyframes): + keyframes_item = KeyframeDto.from_dict(keyframes_item_data) + + + + keyframes.append(keyframes_item) + + + origin = d.pop("origin") + + shot_name = d.pop("shotName") + + def _parse_origin_sbp(data: object) -> None | PanelRevisionDetailsDtoOriginSbpType0 | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + origin_sbp_type_0 = PanelRevisionDetailsDtoOriginSbpType0.from_dict(data) + + + + return origin_sbp_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | PanelRevisionDetailsDtoOriginSbpType0 | Unset, data) + + origin_sbp = _parse_origin_sbp(d.pop("originSbp", UNSET)) + + + panel_revision_details_dto = cls( + panel_id=panel_id, + revision_id=revision_id, + panel_position=panel_position, + asset_id=asset_id, + show_id=show_id, + sequence_id=sequence_id, + trim_in_frame=trim_in_frame, + trim_out_frame=trim_out_frame, + metadata=metadata, + created_date=created_date, + revision_date=revision_date, + owner=owner, + hidden=hidden, + duration=duration, + layer_transform=layer_transform, + dialogue=dialogue, + keyframes=keyframes, + origin=origin, + shot_name=shot_name, + origin_sbp=origin_sbp, + ) + + + panel_revision_details_dto.additional_properties = d + return panel_revision_details_dto + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/panel_revision_details_dto_metadata.py b/flixpy/flix/extension/extension_api/models/panel_revision_details_dto_metadata.py new file mode 100644 index 0000000..24d836b --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/panel_revision_details_dto_metadata.py @@ -0,0 +1,73 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="PanelRevisionDetailsDtoMetadata") + + + +@_attrs_define +class PanelRevisionDetailsDtoMetadata: + """ Arbitrary key-value metadata to merge into the entity. Each value must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + + Example: + {'com.myextension:status': 'inprogress', 'com.myextension:tag': None} + + """ + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + panel_revision_details_dto_metadata = cls( + ) + + + panel_revision_details_dto_metadata.additional_properties = d + return panel_revision_details_dto_metadata + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/panel_revision_details_dto_origin_sbp_type_0.py b/flixpy/flix/extension/extension_api/models/panel_revision_details_dto_origin_sbp_type_0.py new file mode 100644 index 0000000..d047da5 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/panel_revision_details_dto_origin_sbp_type_0.py @@ -0,0 +1,67 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="PanelRevisionDetailsDtoOriginSbpType0") + + + +@_attrs_define +class PanelRevisionDetailsDtoOriginSbpType0: + """ Contains information about panel revisions imported from Storyboard Pro. + This is for internal use by the Storyboard Pro extension and might be removed in the future without notice. + + """ + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + panel_revision_details_dto_origin_sbp_type_0 = cls( + ) + + + panel_revision_details_dto_origin_sbp_type_0.additional_properties = d + return panel_revision_details_dto_origin_sbp_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/panel_track_request.py b/flixpy/flix/extension/extension_api/models/panel_track_request.py new file mode 100644 index 0000000..7265e38 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/panel_track_request.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="PanelTrackRequest") + + + +@_attrs_define +class PanelTrackRequest: + """ + Attributes: + show_id (int): The ID of the show the tracked panel belongs to. Example: 1. + sequence_id (int): The ID of the sequence the tracked panel belongs to. Example: 12. + panel_id (int): The ID of the panel that is being tracked. Example: 1234. + """ + + show_id: int + sequence_id: int + panel_id: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + show_id = self.show_id + + sequence_id = self.sequence_id + + panel_id = self.panel_id + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "showId": show_id, + "sequenceId": sequence_id, + "panelId": panel_id, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + show_id = d.pop("showId") + + sequence_id = d.pop("sequenceId") + + panel_id = d.pop("panelId") + + panel_track_request = cls( + show_id=show_id, + sequence_id=sequence_id, + panel_id=panel_id, + ) + + + panel_track_request.additional_properties = d + return panel_track_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/panel_update_metadata_request.py b/flixpy/flix/extension/extension_api/models/panel_update_metadata_request.py new file mode 100644 index 0000000..7db86a2 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/panel_update_metadata_request.py @@ -0,0 +1,90 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.panel_update_metadata_request_metadata import PanelUpdateMetadataRequestMetadata + + + + + +T = TypeVar("T", bound="PanelUpdateMetadataRequest") + + + +@_attrs_define +class PanelUpdateMetadataRequest: + """ + Attributes: + metadata (PanelUpdateMetadataRequestMetadata): Arbitrary key-value metadata to merge into the entity. Each value + must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + Example: {'com.myextension:status': 'inprogress', 'com.myextension:tag': None}. + """ + + metadata: PanelUpdateMetadataRequestMetadata + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.panel_update_metadata_request_metadata import PanelUpdateMetadataRequestMetadata # noqa: PLC0415 + metadata = self.metadata.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "metadata": metadata, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.panel_update_metadata_request_metadata import PanelUpdateMetadataRequestMetadata # noqa: PLC0415 + d = dict(src_dict) + metadata = PanelUpdateMetadataRequestMetadata.from_dict(d.pop("metadata")) + + + + + panel_update_metadata_request = cls( + metadata=metadata, + ) + + + panel_update_metadata_request.additional_properties = d + return panel_update_metadata_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/panel_update_metadata_request_metadata.py b/flixpy/flix/extension/extension_api/models/panel_update_metadata_request_metadata.py new file mode 100644 index 0000000..e80da70 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/panel_update_metadata_request_metadata.py @@ -0,0 +1,73 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="PanelUpdateMetadataRequestMetadata") + + + +@_attrs_define +class PanelUpdateMetadataRequestMetadata: + """ Arbitrary key-value metadata to merge into the entity. Each value must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + + Example: + {'com.myextension:status': 'inprogress', 'com.myextension:tag': None} + + """ + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + panel_update_metadata_request_metadata = cls( + ) + + + panel_update_metadata_request_metadata.additional_properties = d + return panel_update_metadata_request_metadata + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/panel_update_metadata_response.py b/flixpy/flix/extension/extension_api/models/panel_update_metadata_response.py new file mode 100644 index 0000000..eba365e --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/panel_update_metadata_response.py @@ -0,0 +1,95 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.panel_update_metadata_response_item import PanelUpdateMetadataResponseItem + + + + + +T = TypeVar("T", bound="PanelUpdateMetadataResponse") + + + +@_attrs_define +class PanelUpdateMetadataResponse: + """ + Attributes: + results (list[PanelUpdateMetadataResponseItem]): List of metadata update results. Each includes panel id and + updated metadata. Example: [{'id': '1', 'metadata': {'com.myextension:status': 'inprogress'}}]. + """ + + results: list[PanelUpdateMetadataResponseItem] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.panel_update_metadata_response_item import PanelUpdateMetadataResponseItem # noqa: PLC0415 + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "results": results, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.panel_update_metadata_response_item import PanelUpdateMetadataResponseItem # noqa: PLC0415 + d = dict(src_dict) + results = [] + _results = d.pop("results") + for results_item_data in (_results): + results_item = PanelUpdateMetadataResponseItem.from_dict(results_item_data) + + + + results.append(results_item) + + + panel_update_metadata_response = cls( + results=results, + ) + + + panel_update_metadata_response.additional_properties = d + return panel_update_metadata_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/panel_update_metadata_response_item.py b/flixpy/flix/extension/extension_api/models/panel_update_metadata_response_item.py new file mode 100644 index 0000000..a0700ff --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/panel_update_metadata_response_item.py @@ -0,0 +1,98 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.panel_update_metadata_response_item_metadata import PanelUpdateMetadataResponseItemMetadata + + + + + +T = TypeVar("T", bound="PanelUpdateMetadataResponseItem") + + + +@_attrs_define +class PanelUpdateMetadataResponseItem: + """ + Attributes: + id (int): The panel ID against which this metadata item is associated. + metadata (PanelUpdateMetadataResponseItemMetadata): Arbitrary key-value metadata to merge into the entity. Each + value must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + Example: {'com.myextension:status': 'inprogress', 'com.myextension:tag': None}. + """ + + id: int + metadata: PanelUpdateMetadataResponseItemMetadata + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.panel_update_metadata_response_item_metadata import PanelUpdateMetadataResponseItemMetadata # noqa: PLC0415 + id = self.id + + metadata = self.metadata.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "metadata": metadata, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.panel_update_metadata_response_item_metadata import PanelUpdateMetadataResponseItemMetadata # noqa: PLC0415 + d = dict(src_dict) + id = d.pop("id") + + metadata = PanelUpdateMetadataResponseItemMetadata.from_dict(d.pop("metadata")) + + + + + panel_update_metadata_response_item = cls( + id=id, + metadata=metadata, + ) + + + panel_update_metadata_response_item.additional_properties = d + return panel_update_metadata_response_item + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/panel_update_metadata_response_item_metadata.py b/flixpy/flix/extension/extension_api/models/panel_update_metadata_response_item_metadata.py new file mode 100644 index 0000000..6553c7c --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/panel_update_metadata_response_item_metadata.py @@ -0,0 +1,73 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="PanelUpdateMetadataResponseItemMetadata") + + + +@_attrs_define +class PanelUpdateMetadataResponseItemMetadata: + """ Arbitrary key-value metadata to merge into the entity. Each value must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + + Example: + {'com.myextension:status': 'inprogress', 'com.myextension:tag': None} + + """ + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + panel_update_metadata_response_item_metadata = cls( + ) + + + panel_update_metadata_response_item_metadata.additional_properties = d + return panel_update_metadata_response_item_metadata + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/project_details_dto.py b/flixpy/flix/extension/extension_api/models/project_details_dto.py index f65fcb2..9b0959b 100644 --- a/flixpy/flix/extension/extension_api/models/project_details_dto.py +++ b/flixpy/flix/extension/extension_api/models/project_details_dto.py @@ -8,6 +8,7 @@ from ..types import UNSET, Unset +from ..types import UNSET, Unset from typing import cast if TYPE_CHECKING: @@ -28,16 +29,16 @@ class ProjectDetailsDto: """ Attributes: - show (None | ShowDetailsDto): Details of the currently opened show. - episode (EpisodeDetailsDto | None): Details of the currently opened episode, if in an episodic show. - sequence (None | SequenceDetailsDto): Details of the currently opened sequence. - sequence_revision (None | SequenceRevisionDetailsDto): Details of the currently opened sequence revision. + show (ShowDetailsDto | Unset): + episode (EpisodeDetailsDto | Unset): + sequence (SequenceDetailsDto | Unset): + sequence_revision (SequenceRevisionDetailsDto | Unset): """ - show: None | ShowDetailsDto - episode: EpisodeDetailsDto | None - sequence: None | SequenceDetailsDto - sequence_revision: None | SequenceRevisionDetailsDto + show: ShowDetailsDto | Unset = UNSET + episode: EpisodeDetailsDto | Unset = UNSET + sequence: SequenceDetailsDto | Unset = UNSET + sequence_revision: SequenceRevisionDetailsDto | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -49,39 +50,35 @@ def to_dict(self) -> dict[str, Any]: from ..models.sequence_details_dto import SequenceDetailsDto # noqa: PLC0415 from ..models.sequence_revision_details_dto import SequenceRevisionDetailsDto # noqa: PLC0415 from ..models.show_details_dto import ShowDetailsDto # noqa: PLC0415 - show: dict[str, Any] | None - if isinstance(self.show, ShowDetailsDto): + show: dict[str, Any] | Unset = UNSET + if not isinstance(self.show, Unset): show = self.show.to_dict() - else: - show = self.show - episode: dict[str, Any] | None - if isinstance(self.episode, EpisodeDetailsDto): + episode: dict[str, Any] | Unset = UNSET + if not isinstance(self.episode, Unset): episode = self.episode.to_dict() - else: - episode = self.episode - sequence: dict[str, Any] | None - if isinstance(self.sequence, SequenceDetailsDto): + sequence: dict[str, Any] | Unset = UNSET + if not isinstance(self.sequence, Unset): sequence = self.sequence.to_dict() - else: - sequence = self.sequence - sequence_revision: dict[str, Any] | None - if isinstance(self.sequence_revision, SequenceRevisionDetailsDto): + sequence_revision: dict[str, Any] | Unset = UNSET + if not isinstance(self.sequence_revision, Unset): sequence_revision = self.sequence_revision.to_dict() - else: - sequence_revision = self.sequence_revision field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({ - "show": show, - "episode": episode, - "sequence": sequence, - "sequenceRevision": sequence_revision, }) + if show is not UNSET: + field_dict["show"] = show + if episode is not UNSET: + field_dict["episode"] = episode + if sequence is not UNSET: + field_dict["sequence"] = sequence + if sequence_revision is not UNSET: + field_dict["sequenceRevision"] = sequence_revision return field_dict @@ -94,76 +91,44 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.sequence_revision_details_dto import SequenceRevisionDetailsDto # noqa: PLC0415 from ..models.show_details_dto import ShowDetailsDto # noqa: PLC0415 d = dict(src_dict) - def _parse_show(data: object) -> None | ShowDetailsDto: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - show_type_1 = ShowDetailsDto.from_dict(data) - - - - return show_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | ShowDetailsDto, data) - - show = _parse_show(d.pop("show")) - - - def _parse_episode(data: object) -> EpisodeDetailsDto | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - episode_type_1 = EpisodeDetailsDto.from_dict(data) - - + _show = d.pop("show", UNSET) + show: ShowDetailsDto | Unset + if isinstance(_show, Unset) or _show is None: + show = UNSET + else: + show = ShowDetailsDto.from_dict(_show) - return episode_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(EpisodeDetailsDto | None, data) - episode = _parse_episode(d.pop("episode")) - def _parse_sequence(data: object) -> None | SequenceDetailsDto: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - sequence_type_1 = SequenceDetailsDto.from_dict(data) + _episode = d.pop("episode", UNSET) + episode: EpisodeDetailsDto | Unset + if isinstance(_episode, Unset) or _episode is None: + episode = UNSET + else: + episode = EpisodeDetailsDto.from_dict(_episode) - return sequence_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | SequenceDetailsDto, data) - sequence = _parse_sequence(d.pop("sequence")) + _sequence = d.pop("sequence", UNSET) + sequence: SequenceDetailsDto | Unset + if isinstance(_sequence, Unset) or _sequence is None: + sequence = UNSET + else: + sequence = SequenceDetailsDto.from_dict(_sequence) - def _parse_sequence_revision(data: object) -> None | SequenceRevisionDetailsDto: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - sequence_revision_type_1 = SequenceRevisionDetailsDto.from_dict(data) + _sequence_revision = d.pop("sequenceRevision", UNSET) + sequence_revision: SequenceRevisionDetailsDto | Unset + if isinstance(_sequence_revision, Unset) or _sequence_revision is None: + sequence_revision = UNSET + else: + sequence_revision = SequenceRevisionDetailsDto.from_dict(_sequence_revision) - return sequence_revision_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | SequenceRevisionDetailsDto, data) - sequence_revision = _parse_sequence_revision(d.pop("sequenceRevision")) project_details_dto = cls( diff --git a/flixpy/flix/extension/extension_api/models/project_details_metadata_dto.py b/flixpy/flix/extension/extension_api/models/project_details_metadata_dto.py new file mode 100644 index 0000000..326517f --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/project_details_metadata_dto.py @@ -0,0 +1,183 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.project_details_metadata_dto_episode import ProjectDetailsMetadataDtoEpisode + from ..models.project_details_metadata_dto_sequence import ProjectDetailsMetadataDtoSequence + from ..models.project_details_metadata_dto_sequence_revision import ProjectDetailsMetadataDtoSequenceRevision + from ..models.project_details_metadata_dto_show import ProjectDetailsMetadataDtoShow + + + + + +T = TypeVar("T", bound="ProjectDetailsMetadataDto") + + + +@_attrs_define +class ProjectDetailsMetadataDto: + """ + Attributes: + show (ProjectDetailsMetadataDtoShow | Unset): Arbitrary key-value metadata to merge into the entity. Each value + must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + Example: {'com.myextension:status': 'inprogress', 'com.myextension:tag': None}. + episode (ProjectDetailsMetadataDtoEpisode | Unset): Arbitrary key-value metadata to merge into the entity. Each + value must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + Example: {'com.myextension:status': 'inprogress', 'com.myextension:tag': None}. + sequence (ProjectDetailsMetadataDtoSequence | Unset): Arbitrary key-value metadata to merge into the entity. + Each value must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + Example: {'com.myextension:status': 'inprogress', 'com.myextension:tag': None}. + sequence_revision (ProjectDetailsMetadataDtoSequenceRevision | Unset): Arbitrary key-value metadata to merge + into the entity. Each value must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + Example: {'com.myextension:status': 'inprogress', 'com.myextension:tag': None}. + """ + + show: ProjectDetailsMetadataDtoShow | Unset = UNSET + episode: ProjectDetailsMetadataDtoEpisode | Unset = UNSET + sequence: ProjectDetailsMetadataDtoSequence | Unset = UNSET + sequence_revision: ProjectDetailsMetadataDtoSequenceRevision | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.project_details_metadata_dto_episode import ProjectDetailsMetadataDtoEpisode # noqa: PLC0415 + from ..models.project_details_metadata_dto_sequence import ProjectDetailsMetadataDtoSequence # noqa: PLC0415 + from ..models.project_details_metadata_dto_sequence_revision import ProjectDetailsMetadataDtoSequenceRevision # noqa: PLC0415 + from ..models.project_details_metadata_dto_show import ProjectDetailsMetadataDtoShow # noqa: PLC0415 + show: dict[str, Any] | Unset = UNSET + if not isinstance(self.show, Unset): + show = self.show.to_dict() + + episode: dict[str, Any] | Unset = UNSET + if not isinstance(self.episode, Unset): + episode = self.episode.to_dict() + + sequence: dict[str, Any] | Unset = UNSET + if not isinstance(self.sequence, Unset): + sequence = self.sequence.to_dict() + + sequence_revision: dict[str, Any] | Unset = UNSET + if not isinstance(self.sequence_revision, Unset): + sequence_revision = self.sequence_revision.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + }) + if show is not UNSET: + field_dict["show"] = show + if episode is not UNSET: + field_dict["episode"] = episode + if sequence is not UNSET: + field_dict["sequence"] = sequence + if sequence_revision is not UNSET: + field_dict["sequenceRevision"] = sequence_revision + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.project_details_metadata_dto_episode import ProjectDetailsMetadataDtoEpisode # noqa: PLC0415 + from ..models.project_details_metadata_dto_sequence import ProjectDetailsMetadataDtoSequence # noqa: PLC0415 + from ..models.project_details_metadata_dto_sequence_revision import ProjectDetailsMetadataDtoSequenceRevision # noqa: PLC0415 + from ..models.project_details_metadata_dto_show import ProjectDetailsMetadataDtoShow # noqa: PLC0415 + d = dict(src_dict) + _show = d.pop("show", UNSET) + show: ProjectDetailsMetadataDtoShow | Unset + if isinstance(_show, Unset) or _show is None: + show = UNSET + else: + show = ProjectDetailsMetadataDtoShow.from_dict(_show) + + + + + _episode = d.pop("episode", UNSET) + episode: ProjectDetailsMetadataDtoEpisode | Unset + if isinstance(_episode, Unset) or _episode is None: + episode = UNSET + else: + episode = ProjectDetailsMetadataDtoEpisode.from_dict(_episode) + + + + + _sequence = d.pop("sequence", UNSET) + sequence: ProjectDetailsMetadataDtoSequence | Unset + if isinstance(_sequence, Unset) or _sequence is None: + sequence = UNSET + else: + sequence = ProjectDetailsMetadataDtoSequence.from_dict(_sequence) + + + + + _sequence_revision = d.pop("sequenceRevision", UNSET) + sequence_revision: ProjectDetailsMetadataDtoSequenceRevision | Unset + if isinstance(_sequence_revision, Unset) or _sequence_revision is None: + sequence_revision = UNSET + else: + sequence_revision = ProjectDetailsMetadataDtoSequenceRevision.from_dict(_sequence_revision) + + + + + project_details_metadata_dto = cls( + show=show, + episode=episode, + sequence=sequence, + sequence_revision=sequence_revision, + ) + + + project_details_metadata_dto.additional_properties = d + return project_details_metadata_dto + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/project_details_metadata_dto_episode.py b/flixpy/flix/extension/extension_api/models/project_details_metadata_dto_episode.py new file mode 100644 index 0000000..33ae9e3 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/project_details_metadata_dto_episode.py @@ -0,0 +1,73 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="ProjectDetailsMetadataDtoEpisode") + + + +@_attrs_define +class ProjectDetailsMetadataDtoEpisode: + """ Arbitrary key-value metadata to merge into the entity. Each value must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + + Example: + {'com.myextension:status': 'inprogress', 'com.myextension:tag': None} + + """ + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + project_details_metadata_dto_episode = cls( + ) + + + project_details_metadata_dto_episode.additional_properties = d + return project_details_metadata_dto_episode + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/project_details_metadata_dto_sequence.py b/flixpy/flix/extension/extension_api/models/project_details_metadata_dto_sequence.py new file mode 100644 index 0000000..0b56ea7 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/project_details_metadata_dto_sequence.py @@ -0,0 +1,73 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="ProjectDetailsMetadataDtoSequence") + + + +@_attrs_define +class ProjectDetailsMetadataDtoSequence: + """ Arbitrary key-value metadata to merge into the entity. Each value must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + + Example: + {'com.myextension:status': 'inprogress', 'com.myextension:tag': None} + + """ + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + project_details_metadata_dto_sequence = cls( + ) + + + project_details_metadata_dto_sequence.additional_properties = d + return project_details_metadata_dto_sequence + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/project_details_metadata_dto_sequence_revision.py b/flixpy/flix/extension/extension_api/models/project_details_metadata_dto_sequence_revision.py new file mode 100644 index 0000000..376602b --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/project_details_metadata_dto_sequence_revision.py @@ -0,0 +1,73 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="ProjectDetailsMetadataDtoSequenceRevision") + + + +@_attrs_define +class ProjectDetailsMetadataDtoSequenceRevision: + """ Arbitrary key-value metadata to merge into the entity. Each value must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + + Example: + {'com.myextension:status': 'inprogress', 'com.myextension:tag': None} + + """ + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + project_details_metadata_dto_sequence_revision = cls( + ) + + + project_details_metadata_dto_sequence_revision.additional_properties = d + return project_details_metadata_dto_sequence_revision + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/project_details_metadata_dto_show.py b/flixpy/flix/extension/extension_api/models/project_details_metadata_dto_show.py new file mode 100644 index 0000000..6cb694b --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/project_details_metadata_dto_show.py @@ -0,0 +1,73 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="ProjectDetailsMetadataDtoShow") + + + +@_attrs_define +class ProjectDetailsMetadataDtoShow: + """ Arbitrary key-value metadata to merge into the entity. Each value must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + + Example: + {'com.myextension:status': 'inprogress', 'com.myextension:tag': None} + + """ + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + project_details_metadata_dto_show = cls( + ) + + + project_details_metadata_dto_show.additional_properties = d + return project_details_metadata_dto_show + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/project_metadata_update_event.py b/flixpy/flix/extension/extension_api/models/project_metadata_update_event.py new file mode 100644 index 0000000..8550228 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/project_metadata_update_event.py @@ -0,0 +1,167 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.episode_details_dto import EpisodeDetailsDto + from ..models.sequence_details_dto import SequenceDetailsDto + from ..models.sequence_revision_details_dto import SequenceRevisionDetailsDto + from ..models.show_details_dto import ShowDetailsDto + + + + + +T = TypeVar("T", bound="ProjectMetadataUpdateEvent") + + + +@_attrs_define +class ProjectMetadataUpdateEvent: + """ + Attributes: + success (bool): + show (ShowDetailsDto | Unset): + episode (EpisodeDetailsDto | Unset): + sequence (SequenceDetailsDto | Unset): + sequence_revision (SequenceRevisionDetailsDto | Unset): + """ + + success: bool + show: ShowDetailsDto | Unset = UNSET + episode: EpisodeDetailsDto | Unset = UNSET + sequence: SequenceDetailsDto | Unset = UNSET + sequence_revision: SequenceRevisionDetailsDto | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.episode_details_dto import EpisodeDetailsDto # noqa: PLC0415 + from ..models.sequence_details_dto import SequenceDetailsDto # noqa: PLC0415 + from ..models.sequence_revision_details_dto import SequenceRevisionDetailsDto # noqa: PLC0415 + from ..models.show_details_dto import ShowDetailsDto # noqa: PLC0415 + success = self.success + + show: dict[str, Any] | Unset = UNSET + if not isinstance(self.show, Unset): + show = self.show.to_dict() + + episode: dict[str, Any] | Unset = UNSET + if not isinstance(self.episode, Unset): + episode = self.episode.to_dict() + + sequence: dict[str, Any] | Unset = UNSET + if not isinstance(self.sequence, Unset): + sequence = self.sequence.to_dict() + + sequence_revision: dict[str, Any] | Unset = UNSET + if not isinstance(self.sequence_revision, Unset): + sequence_revision = self.sequence_revision.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "success": success, + }) + if show is not UNSET: + field_dict["show"] = show + if episode is not UNSET: + field_dict["episode"] = episode + if sequence is not UNSET: + field_dict["sequence"] = sequence + if sequence_revision is not UNSET: + field_dict["sequenceRevision"] = sequence_revision + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.episode_details_dto import EpisodeDetailsDto # noqa: PLC0415 + from ..models.sequence_details_dto import SequenceDetailsDto # noqa: PLC0415 + from ..models.sequence_revision_details_dto import SequenceRevisionDetailsDto # noqa: PLC0415 + from ..models.show_details_dto import ShowDetailsDto # noqa: PLC0415 + d = dict(src_dict) + success = d.pop("success") + + _show = d.pop("show", UNSET) + show: ShowDetailsDto | Unset + if isinstance(_show, Unset) or _show is None: + show = UNSET + else: + show = ShowDetailsDto.from_dict(_show) + + + + + _episode = d.pop("episode", UNSET) + episode: EpisodeDetailsDto | Unset + if isinstance(_episode, Unset) or _episode is None: + episode = UNSET + else: + episode = EpisodeDetailsDto.from_dict(_episode) + + + + + _sequence = d.pop("sequence", UNSET) + sequence: SequenceDetailsDto | Unset + if isinstance(_sequence, Unset) or _sequence is None: + sequence = UNSET + else: + sequence = SequenceDetailsDto.from_dict(_sequence) + + + + + _sequence_revision = d.pop("sequenceRevision", UNSET) + sequence_revision: SequenceRevisionDetailsDto | Unset + if isinstance(_sequence_revision, Unset) or _sequence_revision is None: + sequence_revision = UNSET + else: + sequence_revision = SequenceRevisionDetailsDto.from_dict(_sequence_revision) + + + + + project_metadata_update_event = cls( + success=success, + show=show, + episode=episode, + sequence=sequence, + sequence_revision=sequence_revision, + ) + + + project_metadata_update_event.additional_properties = d + return project_metadata_update_event + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/registration_details.py b/flixpy/flix/extension/extension_api/models/registration_details.py index 9248142..5653ad3 100644 --- a/flixpy/flix/extension/extension_api/models/registration_details.py +++ b/flixpy/flix/extension/extension_api/models/registration_details.py @@ -11,6 +11,8 @@ from ..types import UNSET, Unset from typing import cast +if TYPE_CHECKING: + from ..models.registration_details_actions_item import RegistrationDetailsActionsItem @@ -30,6 +32,9 @@ class RegistrationDetails: version (str | Unset): The version of this API consumer (Optional). log_paths (list[str] | Unset): Paths to the location where the extension will write its logs for different versions of the app (Optional). + actions (list[RegistrationDetailsActionsItem] | Unset): List of actions available for this extension. + icon_svg (str | Unset): SVG icon for the default extension button. + short_name (str | Unset): Short name for extension to be used in context menu. """ flix_id: int @@ -37,6 +42,9 @@ class RegistrationDetails: client_uid: str version: str | Unset = UNSET log_paths: list[str] | Unset = UNSET + actions: list[RegistrationDetailsActionsItem] | Unset = UNSET + icon_svg: str | Unset = UNSET + short_name: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -44,6 +52,7 @@ class RegistrationDetails: def to_dict(self) -> dict[str, Any]: + from ..models.registration_details_actions_item import RegistrationDetailsActionsItem # noqa: PLC0415 flix_id = self.flix_id name = self.name @@ -58,6 +67,19 @@ def to_dict(self) -> dict[str, Any]: + actions: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.actions, Unset): + actions = [] + for actions_item_data in self.actions: + actions_item = actions_item_data.to_dict() + actions.append(actions_item) + + + + icon_svg = self.icon_svg + + short_name = self.short_name + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -70,6 +92,12 @@ def to_dict(self) -> dict[str, Any]: field_dict["version"] = version if log_paths is not UNSET: field_dict["logPaths"] = log_paths + if actions is not UNSET: + field_dict["actions"] = actions + if icon_svg is not UNSET: + field_dict["iconSvg"] = icon_svg + if short_name is not UNSET: + field_dict["shortName"] = short_name return field_dict @@ -77,6 +105,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.registration_details_actions_item import RegistrationDetailsActionsItem # noqa: PLC0415 d = dict(src_dict) flix_id = d.pop("flixId") @@ -89,12 +118,31 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: log_paths = cast(list[str], d.pop("logPaths", UNSET)) + _actions = d.pop("actions", UNSET) + actions: list[RegistrationDetailsActionsItem] | Unset = UNSET + if _actions is not UNSET: + actions = [] + for actions_item_data in _actions: + actions_item = RegistrationDetailsActionsItem.from_dict(actions_item_data) + + + + actions.append(actions_item) + + + icon_svg = d.pop("iconSvg", UNSET) + + short_name = d.pop("shortName", UNSET) + registration_details = cls( flix_id=flix_id, name=name, client_uid=client_uid, version=version, log_paths=log_paths, + actions=actions, + icon_svg=icon_svg, + short_name=short_name, ) diff --git a/flixpy/flix/extension/extension_api/models/registration_details_actions_item.py b/flixpy/flix/extension/extension_api/models/registration_details_actions_item.py new file mode 100644 index 0000000..aa56609 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/registration_details_actions_item.py @@ -0,0 +1,64 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="RegistrationDetailsActionsItem") + + + +@_attrs_define +class RegistrationDetailsActionsItem: + + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + registration_details_actions_item = cls( + ) + + + registration_details_actions_item.additional_properties = d + return registration_details_actions_item + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/registration_request.py b/flixpy/flix/extension/extension_api/models/registration_request.py index bd56cc6..583e85e 100644 --- a/flixpy/flix/extension/extension_api/models/registration_request.py +++ b/flixpy/flix/extension/extension_api/models/registration_request.py @@ -11,6 +11,8 @@ from ..types import UNSET, Unset from typing import cast +if TYPE_CHECKING: + from ..models.action_registration import ActionRegistration @@ -28,12 +30,20 @@ class RegistrationRequest: client_uid (str): A unique identifier for this API consumer. version (str | Unset): The version of this API consumer (Optional). log_paths (list[str] | Unset): Paths to the extension's log files. + actions (list[ActionRegistration] | Unset): List of actions available for this extension. + icon_svg (str | Unset): A simple SVG icon to be displayed by default for extension actions when displayed in the + UI. + This value will be processed upon registration and may display incorrectly if unsupported SVG features are used. + short_name (str | Unset): Short name for extension to be used in context menu. """ name: str client_uid: str version: str | Unset = UNSET log_paths: list[str] | Unset = UNSET + actions: list[ActionRegistration] | Unset = UNSET + icon_svg: str | Unset = UNSET + short_name: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -41,6 +51,7 @@ class RegistrationRequest: def to_dict(self) -> dict[str, Any]: + from ..models.action_registration import ActionRegistration # noqa: PLC0415 name = self.name client_uid = self.client_uid @@ -53,6 +64,19 @@ def to_dict(self) -> dict[str, Any]: + actions: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.actions, Unset): + actions = [] + for actions_item_data in self.actions: + actions_item = actions_item_data.to_dict() + actions.append(actions_item) + + + + icon_svg = self.icon_svg + + short_name = self.short_name + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -64,6 +88,12 @@ def to_dict(self) -> dict[str, Any]: field_dict["version"] = version if log_paths is not UNSET: field_dict["logPaths"] = log_paths + if actions is not UNSET: + field_dict["actions"] = actions + if icon_svg is not UNSET: + field_dict["iconSvg"] = icon_svg + if short_name is not UNSET: + field_dict["shortName"] = short_name return field_dict @@ -71,6 +101,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.action_registration import ActionRegistration # noqa: PLC0415 d = dict(src_dict) name = d.pop("name") @@ -81,11 +112,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: log_paths = cast(list[str], d.pop("logPaths", UNSET)) + _actions = d.pop("actions", UNSET) + actions: list[ActionRegistration] | Unset = UNSET + if _actions is not UNSET: + actions = [] + for actions_item_data in _actions: + actions_item = ActionRegistration.from_dict(actions_item_data) + + + + actions.append(actions_item) + + + icon_svg = d.pop("iconSvg", UNSET) + + short_name = d.pop("shortName", UNSET) + registration_request = cls( name=name, client_uid=client_uid, version=version, log_paths=log_paths, + actions=actions, + icon_svg=icon_svg, + short_name=short_name, ) diff --git a/flixpy/flix/extension/extension_api/models/revision_status_response.py b/flixpy/flix/extension/extension_api/models/revision_status_response.py index dffa786..f28a888 100644 --- a/flixpy/flix/extension/extension_api/models/revision_status_response.py +++ b/flixpy/flix/extension/extension_api/models/revision_status_response.py @@ -8,7 +8,6 @@ from ..types import UNSET, Unset -from ..types import UNSET, Unset from typing import cast if TYPE_CHECKING: @@ -30,15 +29,14 @@ class RevisionStatusResponse: can_save (bool): Whether the current revision can be saved. can_publish (bool): Whether the user has permission to publish the current revision. can_export (bool): Whether the user has permission to export files from the current revision. - panel_selection (list[PanelSelectionResponse] | Unset): A list of the currently selected panel details, - including ID. + panel_selection (list[PanelSelectionResponse]): A list of the currently selected panel details, including ID. """ selected_panels: list[int] can_save: bool can_publish: bool can_export: bool - panel_selection: list[PanelSelectionResponse] | Unset = UNSET + panel_selection: list[PanelSelectionResponse] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -57,12 +55,10 @@ def to_dict(self) -> dict[str, Any]: can_export = self.can_export - panel_selection: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.panel_selection, Unset): - panel_selection = [] - for panel_selection_item_data in self.panel_selection: - panel_selection_item = panel_selection_item_data.to_dict() - panel_selection.append(panel_selection_item) + panel_selection = [] + for panel_selection_item_data in self.panel_selection: + panel_selection_item = panel_selection_item_data.to_dict() + panel_selection.append(panel_selection_item) @@ -74,9 +70,8 @@ def to_dict(self) -> dict[str, Any]: "canSave": can_save, "canPublish": can_publish, "canExport": can_export, + "panelSelection": panel_selection, }) - if panel_selection is not UNSET: - field_dict["panelSelection"] = panel_selection return field_dict @@ -95,16 +90,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: can_export = d.pop("canExport") - _panel_selection = d.pop("panelSelection", UNSET) - panel_selection: list[PanelSelectionResponse] | Unset = UNSET - if _panel_selection is not UNSET: - panel_selection = [] - for panel_selection_item_data in _panel_selection: - panel_selection_item = PanelSelectionResponse.from_dict(panel_selection_item_data) + panel_selection = [] + _panel_selection = d.pop("panelSelection") + for panel_selection_item_data in (_panel_selection): + panel_selection_item = PanelSelectionResponse.from_dict(panel_selection_item_data) - panel_selection.append(panel_selection_item) + panel_selection.append(panel_selection_item) revision_status_response = cls( diff --git a/flixpy/flix/extension/extension_api/models/sequence_details_dto.py b/flixpy/flix/extension/extension_api/models/sequence_details_dto.py index dc360cf..2344622 100644 --- a/flixpy/flix/extension/extension_api/models/sequence_details_dto.py +++ b/flixpy/flix/extension/extension_api/models/sequence_details_dto.py @@ -8,9 +8,12 @@ from ..types import UNSET, Unset +from ..types import UNSET, Unset from typing import cast import datetime +if TYPE_CHECKING: + from ..models.sequence_details_dto_metadata import SequenceDetailsDtoMetadata @@ -29,6 +32,14 @@ class SequenceDetailsDto: created_date (datetime.datetime): The date the sequence was created. owner (str): The user that created the sequence. title (None | str): The sequence's display title. + aspect_ratio (float): The aspect ratio used by the sequence. + metadata (SequenceDetailsDtoMetadata | Unset): Arbitrary key-value metadata to merge into the entity. Each value + must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + Example: {'com.myextension:status': 'inprogress', 'com.myextension:tag': None}. """ id: int @@ -36,6 +47,8 @@ class SequenceDetailsDto: created_date: datetime.datetime owner: str title: None | str + aspect_ratio: float + metadata: SequenceDetailsDtoMetadata | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -43,6 +56,7 @@ class SequenceDetailsDto: def to_dict(self) -> dict[str, Any]: + from ..models.sequence_details_dto_metadata import SequenceDetailsDtoMetadata # noqa: PLC0415 id = self.id tracking_code = self.tracking_code @@ -54,6 +68,12 @@ def to_dict(self) -> dict[str, Any]: title: None | str title = self.title + aspect_ratio = self.aspect_ratio + + metadata: dict[str, Any] | Unset = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -63,7 +83,10 @@ def to_dict(self) -> dict[str, Any]: "createdDate": created_date, "owner": owner, "title": title, + "aspectRatio": aspect_ratio, }) + if metadata is not UNSET: + field_dict["metadata"] = metadata return field_dict @@ -71,6 +94,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.sequence_details_dto_metadata import SequenceDetailsDtoMetadata # noqa: PLC0415 d = dict(src_dict) id = d.pop("id") @@ -91,12 +115,26 @@ def _parse_title(data: object) -> None | str: title = _parse_title(d.pop("title")) + aspect_ratio = d.pop("aspectRatio") + + _metadata = d.pop("metadata", UNSET) + metadata: SequenceDetailsDtoMetadata | Unset + if isinstance(_metadata, Unset) or _metadata is None: + metadata = UNSET + else: + metadata = SequenceDetailsDtoMetadata.from_dict(_metadata) + + + + sequence_details_dto = cls( id=id, tracking_code=tracking_code, created_date=created_date, owner=owner, title=title, + aspect_ratio=aspect_ratio, + metadata=metadata, ) diff --git a/flixpy/flix/extension/extension_api/models/sequence_details_dto_metadata.py b/flixpy/flix/extension/extension_api/models/sequence_details_dto_metadata.py new file mode 100644 index 0000000..c9c1ced --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/sequence_details_dto_metadata.py @@ -0,0 +1,73 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="SequenceDetailsDtoMetadata") + + + +@_attrs_define +class SequenceDetailsDtoMetadata: + """ Arbitrary key-value metadata to merge into the entity. Each value must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + + Example: + {'com.myextension:status': 'inprogress', 'com.myextension:tag': None} + + """ + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + sequence_details_dto_metadata = cls( + ) + + + sequence_details_dto_metadata.additional_properties = d + return sequence_details_dto_metadata + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/sequence_revision_details_dto.py b/flixpy/flix/extension/extension_api/models/sequence_revision_details_dto.py index b388a1f..3355673 100644 --- a/flixpy/flix/extension/extension_api/models/sequence_revision_details_dto.py +++ b/flixpy/flix/extension/extension_api/models/sequence_revision_details_dto.py @@ -8,9 +8,12 @@ from ..types import UNSET, Unset +from ..types import UNSET, Unset from typing import cast import datetime +if TYPE_CHECKING: + from ..models.sequence_revision_details_dto_metadata import SequenceRevisionDetailsDtoMetadata @@ -29,6 +32,15 @@ class SequenceRevisionDetailsDto: owner (str): The user that created the sequence revision. published (bool): Whether this sequence revision has been published to editorial. comment (str): Any comment added to the sequence revision when saving. + shot_names (list[str]): The list of shot names included in the sequence revision, derived from the named shots + of the panels in the sequence revision. + metadata (SequenceRevisionDetailsDtoMetadata | Unset): Arbitrary key-value metadata to merge into the entity. + Each value must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + Example: {'com.myextension:status': 'inprogress', 'com.myextension:tag': None}. """ id: int @@ -36,6 +48,8 @@ class SequenceRevisionDetailsDto: owner: str published: bool comment: str + shot_names: list[str] + metadata: SequenceRevisionDetailsDtoMetadata | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -43,6 +57,7 @@ class SequenceRevisionDetailsDto: def to_dict(self) -> dict[str, Any]: + from ..models.sequence_revision_details_dto_metadata import SequenceRevisionDetailsDtoMetadata # noqa: PLC0415 id = self.id created_date: None | str @@ -57,6 +72,14 @@ def to_dict(self) -> dict[str, Any]: comment = self.comment + shot_names = self.shot_names + + + + metadata: dict[str, Any] | Unset = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -66,7 +89,10 @@ def to_dict(self) -> dict[str, Any]: "owner": owner, "published": published, "comment": comment, + "shotNames": shot_names, }) + if metadata is not UNSET: + field_dict["metadata"] = metadata return field_dict @@ -74,6 +100,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.sequence_revision_details_dto_metadata import SequenceRevisionDetailsDtoMetadata # noqa: PLC0415 d = dict(src_dict) id = d.pop("id") @@ -101,12 +128,27 @@ def _parse_created_date(data: object) -> datetime.datetime | None: comment = d.pop("comment") + shot_names = cast(list[str], d.pop("shotNames")) + + + _metadata = d.pop("metadata", UNSET) + metadata: SequenceRevisionDetailsDtoMetadata | Unset + if isinstance(_metadata, Unset) or _metadata is None: + metadata = UNSET + else: + metadata = SequenceRevisionDetailsDtoMetadata.from_dict(_metadata) + + + + sequence_revision_details_dto = cls( id=id, created_date=created_date, owner=owner, published=published, comment=comment, + shot_names=shot_names, + metadata=metadata, ) diff --git a/flixpy/flix/extension/extension_api/models/sequence_revision_details_dto_metadata.py b/flixpy/flix/extension/extension_api/models/sequence_revision_details_dto_metadata.py new file mode 100644 index 0000000..9d4b1b2 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/sequence_revision_details_dto_metadata.py @@ -0,0 +1,73 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="SequenceRevisionDetailsDtoMetadata") + + + +@_attrs_define +class SequenceRevisionDetailsDtoMetadata: + """ Arbitrary key-value metadata to merge into the entity. Each value must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + + Example: + {'com.myextension:status': 'inprogress', 'com.myextension:tag': None} + + """ + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + sequence_revision_details_dto_metadata = cls( + ) + + + sequence_revision_details_dto_metadata.additional_properties = d + return sequence_revision_details_dto_metadata + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/show_details_dto.py b/flixpy/flix/extension/extension_api/models/show_details_dto.py index fe42e37..af48235 100644 --- a/flixpy/flix/extension/extension_api/models/show_details_dto.py +++ b/flixpy/flix/extension/extension_api/models/show_details_dto.py @@ -8,8 +8,11 @@ from ..types import UNSET, Unset +from ..types import UNSET, Unset from typing import cast +if TYPE_CHECKING: + from ..models.show_details_dto_metadata import ShowDetailsDtoMetadata @@ -26,13 +29,23 @@ class ShowDetailsDto: id (int): The Flix identifier for the show. tracking_code (str): The show's tracking code. title (None | str): The show's display title. - aspect_ratio (float): The configured aspect ratio for the show. + aspect_ratio (float): The configured aspect ratio for the active sequence or show. + default_aspect_ratio (float): The configured default aspect ratio for the sequence. + metadata (ShowDetailsDtoMetadata | Unset): Arbitrary key-value metadata to merge into the entity. Each value + must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + Example: {'com.myextension:status': 'inprogress', 'com.myextension:tag': None}. """ id: int tracking_code: str title: None | str aspect_ratio: float + default_aspect_ratio: float + metadata: ShowDetailsDtoMetadata | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -40,6 +53,7 @@ class ShowDetailsDto: def to_dict(self) -> dict[str, Any]: + from ..models.show_details_dto_metadata import ShowDetailsDtoMetadata # noqa: PLC0415 id = self.id tracking_code = self.tracking_code @@ -49,6 +63,12 @@ def to_dict(self) -> dict[str, Any]: aspect_ratio = self.aspect_ratio + default_aspect_ratio = self.default_aspect_ratio + + metadata: dict[str, Any] | Unset = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -57,7 +77,10 @@ def to_dict(self) -> dict[str, Any]: "trackingCode": tracking_code, "title": title, "aspectRatio": aspect_ratio, + "defaultAspectRatio": default_aspect_ratio, }) + if metadata is not UNSET: + field_dict["metadata"] = metadata return field_dict @@ -65,6 +88,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.show_details_dto_metadata import ShowDetailsDtoMetadata # noqa: PLC0415 d = dict(src_dict) id = d.pop("id") @@ -80,11 +104,25 @@ def _parse_title(data: object) -> None | str: aspect_ratio = d.pop("aspectRatio") + default_aspect_ratio = d.pop("defaultAspectRatio") + + _metadata = d.pop("metadata", UNSET) + metadata: ShowDetailsDtoMetadata | Unset + if isinstance(_metadata, Unset) or _metadata is None: + metadata = UNSET + else: + metadata = ShowDetailsDtoMetadata.from_dict(_metadata) + + + + show_details_dto = cls( id=id, tracking_code=tracking_code, title=title, aspect_ratio=aspect_ratio, + default_aspect_ratio=default_aspect_ratio, + metadata=metadata, ) diff --git a/flixpy/flix/extension/extension_api/models/show_details_dto_metadata.py b/flixpy/flix/extension/extension_api/models/show_details_dto_metadata.py new file mode 100644 index 0000000..f853bcf --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/show_details_dto_metadata.py @@ -0,0 +1,73 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="ShowDetailsDtoMetadata") + + + +@_attrs_define +class ShowDetailsDtoMetadata: + """ Arbitrary key-value metadata to merge into the entity. Each value must be a string, or `null` to delete that key. + + **Note:** Keys in this dictionary are **case-sensitive**. + + Best practice: Use namespaced keys to avoid conflicts with other extensions (e.g., `vendor.plugin:key`). + + Example: + {'com.myextension:status': 'inprogress', 'com.myextension:tag': None} + + """ + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + show_details_dto_metadata = cls( + ) + + + show_details_dto_metadata.additional_properties = d + return show_details_dto_metadata + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/sse_event.py b/flixpy/flix/extension/extension_api/models/sse_event.py new file mode 100644 index 0000000..1a59592 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/sse_event.py @@ -0,0 +1,215 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.sse_event_data_type_0 import SSEEventDataType0 + from ..models.sse_event_data_type_1 import SSEEventDataType1 + from ..models.sse_event_data_type_2 import SSEEventDataType2 + from ..models.sse_event_data_type_3 import SSEEventDataType3 + from ..models.sse_event_data_type_4 import SSEEventDataType4 + from ..models.sse_event_data_type_5 import SSEEventDataType5 + from ..models.sse_event_data_type_6 import SSEEventDataType6 + from ..models.sse_event_data_type_7 import SSEEventDataType7 + from ..models.sse_event_data_type_8 import SSEEventDataType8 + + + + + +T = TypeVar("T", bound="SSEEvent") + + + +@_attrs_define +class SSEEvent: + """ + Attributes: + data (SSEEventDataType0 | SSEEventDataType1 | SSEEventDataType2 | SSEEventDataType3 | SSEEventDataType4 | + SSEEventDataType5 | SSEEventDataType6 | SSEEventDataType7 | SSEEventDataType8): + """ + + data: SSEEventDataType0 | SSEEventDataType1 | SSEEventDataType2 | SSEEventDataType3 | SSEEventDataType4 | SSEEventDataType5 | SSEEventDataType6 | SSEEventDataType7 | SSEEventDataType8 + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.sse_event_data_type_0 import SSEEventDataType0 # noqa: PLC0415 + from ..models.sse_event_data_type_1 import SSEEventDataType1 # noqa: PLC0415 + from ..models.sse_event_data_type_2 import SSEEventDataType2 # noqa: PLC0415 + from ..models.sse_event_data_type_3 import SSEEventDataType3 # noqa: PLC0415 + from ..models.sse_event_data_type_4 import SSEEventDataType4 # noqa: PLC0415 + from ..models.sse_event_data_type_5 import SSEEventDataType5 # noqa: PLC0415 + from ..models.sse_event_data_type_6 import SSEEventDataType6 # noqa: PLC0415 + from ..models.sse_event_data_type_7 import SSEEventDataType7 # noqa: PLC0415 + from ..models.sse_event_data_type_8 import SSEEventDataType8 # noqa: PLC0415 + data: dict[str, Any] + if isinstance(self.data, SSEEventDataType0): + data = self.data.to_dict() + elif isinstance(self.data, SSEEventDataType1): + data = self.data.to_dict() + elif isinstance(self.data, SSEEventDataType2): + data = self.data.to_dict() + elif isinstance(self.data, SSEEventDataType3): + data = self.data.to_dict() + elif isinstance(self.data, SSEEventDataType4): + data = self.data.to_dict() + elif isinstance(self.data, SSEEventDataType5): + data = self.data.to_dict() + elif isinstance(self.data, SSEEventDataType6): + data = self.data.to_dict() + elif isinstance(self.data, SSEEventDataType7): + data = self.data.to_dict() + else: + data = self.data.to_dict() + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "data": data, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.sse_event_data_type_0 import SSEEventDataType0 # noqa: PLC0415 + from ..models.sse_event_data_type_1 import SSEEventDataType1 # noqa: PLC0415 + from ..models.sse_event_data_type_2 import SSEEventDataType2 # noqa: PLC0415 + from ..models.sse_event_data_type_3 import SSEEventDataType3 # noqa: PLC0415 + from ..models.sse_event_data_type_4 import SSEEventDataType4 # noqa: PLC0415 + from ..models.sse_event_data_type_5 import SSEEventDataType5 # noqa: PLC0415 + from ..models.sse_event_data_type_6 import SSEEventDataType6 # noqa: PLC0415 + from ..models.sse_event_data_type_7 import SSEEventDataType7 # noqa: PLC0415 + from ..models.sse_event_data_type_8 import SSEEventDataType8 # noqa: PLC0415 + d = dict(src_dict) + def _parse_data(data: object) -> SSEEventDataType0 | SSEEventDataType1 | SSEEventDataType2 | SSEEventDataType3 | SSEEventDataType4 | SSEEventDataType5 | SSEEventDataType6 | SSEEventDataType7 | SSEEventDataType8: + try: + if not isinstance(data, dict): + raise TypeError() + data_type_0 = SSEEventDataType0.from_dict(data) + + + + return data_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + data_type_1 = SSEEventDataType1.from_dict(data) + + + + return data_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + data_type_2 = SSEEventDataType2.from_dict(data) + + + + return data_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + data_type_3 = SSEEventDataType3.from_dict(data) + + + + return data_type_3 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + data_type_4 = SSEEventDataType4.from_dict(data) + + + + return data_type_4 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + data_type_5 = SSEEventDataType5.from_dict(data) + + + + return data_type_5 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + data_type_6 = SSEEventDataType6.from_dict(data) + + + + return data_type_6 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + data_type_7 = SSEEventDataType7.from_dict(data) + + + + return data_type_7 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + data_type_8 = SSEEventDataType8.from_dict(data) + + + + return data_type_8 + + data = _parse_data(d.pop("data")) + + + sse_event = cls( + data=data, + ) + + + sse_event.additional_properties = d + return sse_event + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/sse_event_data_type_0.py b/flixpy/flix/extension/extension_api/models/sse_event_data_type_0.py new file mode 100644 index 0000000..f934343 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/sse_event_data_type_0.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.sse_event_data_type_0_type import SSEEventDataType0Type +from typing import cast + +if TYPE_CHECKING: + from ..models.ping_event import PingEvent + + + + + +T = TypeVar("T", bound="SSEEventDataType0") + + + +@_attrs_define +class SSEEventDataType0: + """ + Attributes: + type_ (SSEEventDataType0Type): + data (PingEvent): + """ + + type_: SSEEventDataType0Type + data: PingEvent + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.ping_event import PingEvent # noqa: PLC0415 + type_ = self.type_.value + + data = self.data.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "type": type_, + "data": data, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.ping_event import PingEvent # noqa: PLC0415 + d = dict(src_dict) + type_ = SSEEventDataType0Type(d.pop("type")) + + + + + data = PingEvent.from_dict(d.pop("data")) + + + + + sse_event_data_type_0 = cls( + type_=type_, + data=data, + ) + + + sse_event_data_type_0.additional_properties = d + return sse_event_data_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/sse_event_data_type_0_type.py b/flixpy/flix/extension/extension_api/models/sse_event_data_type_0_type.py new file mode 100644 index 0000000..85b2f6d --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/sse_event_data_type_0_type.py @@ -0,0 +1,8 @@ +from enum import Enum + + +class SSEEventDataType0Type(str, Enum): + PING = "PING" + + def __str__(self) -> str: + return str(self.value) diff --git a/flixpy/flix/extension/extension_api/models/sse_event_data_type_1.py b/flixpy/flix/extension/extension_api/models/sse_event_data_type_1.py new file mode 100644 index 0000000..73fb421 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/sse_event_data_type_1.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.sse_event_data_type_1_type import SSEEventDataType1Type +from typing import cast + +if TYPE_CHECKING: + from ..models.status_response import StatusResponse + + + + + +T = TypeVar("T", bound="SSEEventDataType1") + + + +@_attrs_define +class SSEEventDataType1: + """ + Attributes: + type_ (SSEEventDataType1Type): + data (StatusResponse): + """ + + type_: SSEEventDataType1Type + data: StatusResponse + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.status_response import StatusResponse # noqa: PLC0415 + type_ = self.type_.value + + data = self.data.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "type": type_, + "data": data, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.status_response import StatusResponse # noqa: PLC0415 + d = dict(src_dict) + type_ = SSEEventDataType1Type(d.pop("type")) + + + + + data = StatusResponse.from_dict(d.pop("data")) + + + + + sse_event_data_type_1 = cls( + type_=type_, + data=data, + ) + + + sse_event_data_type_1.additional_properties = d + return sse_event_data_type_1 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/sse_event_data_type_1_type.py b/flixpy/flix/extension/extension_api/models/sse_event_data_type_1_type.py new file mode 100644 index 0000000..6fa4376 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/sse_event_data_type_1_type.py @@ -0,0 +1,8 @@ +from enum import Enum + + +class SSEEventDataType1Type(str, Enum): + STATUS = "STATUS" + + def __str__(self) -> str: + return str(self.value) diff --git a/flixpy/flix/extension/extension_api/models/sse_event_data_type_2.py b/flixpy/flix/extension/extension_api/models/sse_event_data_type_2.py new file mode 100644 index 0000000..73c6d51 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/sse_event_data_type_2.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.sse_event_data_type_2_type import SSEEventDataType2Type +from typing import cast + +if TYPE_CHECKING: + from ..models.project_details_dto import ProjectDetailsDto + + + + + +T = TypeVar("T", bound="SSEEventDataType2") + + + +@_attrs_define +class SSEEventDataType2: + """ + Attributes: + type_ (SSEEventDataType2Type): + data (ProjectDetailsDto): + """ + + type_: SSEEventDataType2Type + data: ProjectDetailsDto + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.project_details_dto import ProjectDetailsDto # noqa: PLC0415 + type_ = self.type_.value + + data = self.data.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "type": type_, + "data": data, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.project_details_dto import ProjectDetailsDto # noqa: PLC0415 + d = dict(src_dict) + type_ = SSEEventDataType2Type(d.pop("type")) + + + + + data = ProjectDetailsDto.from_dict(d.pop("data")) + + + + + sse_event_data_type_2 = cls( + type_=type_, + data=data, + ) + + + sse_event_data_type_2.additional_properties = d + return sse_event_data_type_2 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/sse_event_data_type_2_type.py b/flixpy/flix/extension/extension_api/models/sse_event_data_type_2_type.py new file mode 100644 index 0000000..b61978c --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/sse_event_data_type_2_type.py @@ -0,0 +1,8 @@ +from enum import Enum + + +class SSEEventDataType2Type(str, Enum): + PROJECT = "PROJECT" + + def __str__(self) -> str: + return str(self.value) diff --git a/flixpy/flix/extension/extension_api/models/sse_event_data_type_3.py b/flixpy/flix/extension/extension_api/models/sse_event_data_type_3.py new file mode 100644 index 0000000..738dcbc --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/sse_event_data_type_3.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.sse_event_data_type_3_type import SSEEventDataType3Type +from typing import cast + +if TYPE_CHECKING: + from ..models.action_event import ActionEvent + + + + + +T = TypeVar("T", bound="SSEEventDataType3") + + + +@_attrs_define +class SSEEventDataType3: + """ + Attributes: + type_ (SSEEventDataType3Type): + data (ActionEvent): + """ + + type_: SSEEventDataType3Type + data: ActionEvent + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.action_event import ActionEvent # noqa: PLC0415 + type_ = self.type_.value + + data = self.data.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "type": type_, + "data": data, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.action_event import ActionEvent # noqa: PLC0415 + d = dict(src_dict) + type_ = SSEEventDataType3Type(d.pop("type")) + + + + + data = ActionEvent.from_dict(d.pop("data")) + + + + + sse_event_data_type_3 = cls( + type_=type_, + data=data, + ) + + + sse_event_data_type_3.additional_properties = d + return sse_event_data_type_3 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/sse_event_data_type_3_type.py b/flixpy/flix/extension/extension_api/models/sse_event_data_type_3_type.py new file mode 100644 index 0000000..63402c8 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/sse_event_data_type_3_type.py @@ -0,0 +1,8 @@ +from enum import Enum + + +class SSEEventDataType3Type(str, Enum): + ACTION = "ACTION" + + def __str__(self) -> str: + return str(self.value) diff --git a/flixpy/flix/extension/extension_api/models/sse_event_data_type_4.py b/flixpy/flix/extension/extension_api/models/sse_event_data_type_4.py new file mode 100644 index 0000000..6ae4be9 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/sse_event_data_type_4.py @@ -0,0 +1,121 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.sse_event_data_type_4_type import SSEEventDataType4Type +from typing import cast + +if TYPE_CHECKING: + from ..models.open_file_event import OpenFileEvent + from ..models.open_source_file_event import OpenSourceFileEvent + + + + + +T = TypeVar("T", bound="SSEEventDataType4") + + + +@_attrs_define +class SSEEventDataType4: + """ + Attributes: + type_ (SSEEventDataType4Type): + data (OpenFileEvent | OpenSourceFileEvent): + """ + + type_: SSEEventDataType4Type + data: OpenFileEvent | OpenSourceFileEvent + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.open_file_event import OpenFileEvent # noqa: PLC0415 + from ..models.open_source_file_event import OpenSourceFileEvent # noqa: PLC0415 + type_ = self.type_.value + + data: dict[str, Any] + if isinstance(self.data, OpenFileEvent): + data = self.data.to_dict() + else: + data = self.data.to_dict() + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "type": type_, + "data": data, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.open_file_event import OpenFileEvent # noqa: PLC0415 + from ..models.open_source_file_event import OpenSourceFileEvent # noqa: PLC0415 + d = dict(src_dict) + type_ = SSEEventDataType4Type(d.pop("type")) + + + + + def _parse_data(data: object) -> OpenFileEvent | OpenSourceFileEvent: + try: + if not isinstance(data, dict): + raise TypeError() + data_type_0 = OpenFileEvent.from_dict(data) + + + + return data_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + data_type_1 = OpenSourceFileEvent.from_dict(data) + + + + return data_type_1 + + data = _parse_data(d.pop("data")) + + + sse_event_data_type_4 = cls( + type_=type_, + data=data, + ) + + + sse_event_data_type_4.additional_properties = d + return sse_event_data_type_4 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/sse_event_data_type_4_type.py b/flixpy/flix/extension/extension_api/models/sse_event_data_type_4_type.py new file mode 100644 index 0000000..ea7867c --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/sse_event_data_type_4_type.py @@ -0,0 +1,8 @@ +from enum import Enum + + +class SSEEventDataType4Type(str, Enum): + OPEN = "OPEN" + + def __str__(self) -> str: + return str(self.value) diff --git a/flixpy/flix/extension/extension_api/models/sse_event_data_type_5.py b/flixpy/flix/extension/extension_api/models/sse_event_data_type_5.py new file mode 100644 index 0000000..f6fc8e7 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/sse_event_data_type_5.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.sse_event_data_type_5_type import SSEEventDataType5Type +from typing import cast + +if TYPE_CHECKING: + from ..models.version_event import VersionEvent + + + + + +T = TypeVar("T", bound="SSEEventDataType5") + + + +@_attrs_define +class SSEEventDataType5: + """ + Attributes: + type_ (SSEEventDataType5Type): + data (VersionEvent): + """ + + type_: SSEEventDataType5Type + data: VersionEvent + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.version_event import VersionEvent # noqa: PLC0415 + type_ = self.type_.value + + data = self.data.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "type": type_, + "data": data, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.version_event import VersionEvent # noqa: PLC0415 + d = dict(src_dict) + type_ = SSEEventDataType5Type(d.pop("type")) + + + + + data = VersionEvent.from_dict(d.pop("data")) + + + + + sse_event_data_type_5 = cls( + type_=type_, + data=data, + ) + + + sse_event_data_type_5.additional_properties = d + return sse_event_data_type_5 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/sse_event_data_type_5_type.py b/flixpy/flix/extension/extension_api/models/sse_event_data_type_5_type.py new file mode 100644 index 0000000..f2ceca3 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/sse_event_data_type_5_type.py @@ -0,0 +1,8 @@ +from enum import Enum + + +class SSEEventDataType5Type(str, Enum): + VERSION = "VERSION" + + def __str__(self) -> str: + return str(self.value) diff --git a/flixpy/flix/extension/extension_api/models/sse_event_data_type_6.py b/flixpy/flix/extension/extension_api/models/sse_event_data_type_6.py new file mode 100644 index 0000000..7b041a4 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/sse_event_data_type_6.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.sse_event_data_type_6_type import SSEEventDataType6Type +from typing import cast + +if TYPE_CHECKING: + from ..models.sse_event_data_type_6_data import SSEEventDataType6Data + + + + + +T = TypeVar("T", bound="SSEEventDataType6") + + + +@_attrs_define +class SSEEventDataType6: + """ + Attributes: + type_ (SSEEventDataType6Type): + data (SSEEventDataType6Data): + """ + + type_: SSEEventDataType6Type + data: SSEEventDataType6Data + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.sse_event_data_type_6_data import SSEEventDataType6Data # noqa: PLC0415 + type_ = self.type_.value + + data = self.data.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "type": type_, + "data": data, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.sse_event_data_type_6_data import SSEEventDataType6Data # noqa: PLC0415 + d = dict(src_dict) + type_ = SSEEventDataType6Type(d.pop("type")) + + + + + data = SSEEventDataType6Data.from_dict(d.pop("data")) + + + + + sse_event_data_type_6 = cls( + type_=type_, + data=data, + ) + + + sse_event_data_type_6.additional_properties = d + return sse_event_data_type_6 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/sse_event_data_type_6_data.py b/flixpy/flix/extension/extension_api/models/sse_event_data_type_6_data.py new file mode 100644 index 0000000..737973f --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/sse_event_data_type_6_data.py @@ -0,0 +1,77 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="SSEEventDataType6Data") + + + +@_attrs_define +class SSEEventDataType6Data: + + + additional_properties: dict[str, bool | int | str] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + + field_dict[prop_name] = prop + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + sse_event_data_type_6_data = cls( + ) + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> bool | int | str: + return cast(bool | int | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + sse_event_data_type_6_data.additional_properties = additional_properties + return sse_event_data_type_6_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> bool | int | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: bool | int | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/sse_event_data_type_6_type.py b/flixpy/flix/extension/extension_api/models/sse_event_data_type_6_type.py new file mode 100644 index 0000000..c1803e5 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/sse_event_data_type_6_type.py @@ -0,0 +1,8 @@ +from enum import Enum + + +class SSEEventDataType6Type(str, Enum): + PREFERENCES = "PREFERENCES" + + def __str__(self) -> str: + return str(self.value) diff --git a/flixpy/flix/extension/extension_api/models/sse_event_data_type_7.py b/flixpy/flix/extension/extension_api/models/sse_event_data_type_7.py new file mode 100644 index 0000000..30e112e --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/sse_event_data_type_7.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.sse_event_data_type_7_type import SSEEventDataType7Type +from typing import cast + +if TYPE_CHECKING: + from ..models.panel_metadata_update_event import PanelMetadataUpdateEvent + + + + + +T = TypeVar("T", bound="SSEEventDataType7") + + + +@_attrs_define +class SSEEventDataType7: + """ + Attributes: + type_ (SSEEventDataType7Type): + data (PanelMetadataUpdateEvent): + """ + + type_: SSEEventDataType7Type + data: PanelMetadataUpdateEvent + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.panel_metadata_update_event import PanelMetadataUpdateEvent # noqa: PLC0415 + type_ = self.type_.value + + data = self.data.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "type": type_, + "data": data, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.panel_metadata_update_event import PanelMetadataUpdateEvent # noqa: PLC0415 + d = dict(src_dict) + type_ = SSEEventDataType7Type(d.pop("type")) + + + + + data = PanelMetadataUpdateEvent.from_dict(d.pop("data")) + + + + + sse_event_data_type_7 = cls( + type_=type_, + data=data, + ) + + + sse_event_data_type_7.additional_properties = d + return sse_event_data_type_7 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/sse_event_data_type_7_type.py b/flixpy/flix/extension/extension_api/models/sse_event_data_type_7_type.py new file mode 100644 index 0000000..63babcd --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/sse_event_data_type_7_type.py @@ -0,0 +1,8 @@ +from enum import Enum + + +class SSEEventDataType7Type(str, Enum): + PANEL_METADATA_UPDATE = "PANEL_METADATA_UPDATE" + + def __str__(self) -> str: + return str(self.value) diff --git a/flixpy/flix/extension/extension_api/models/sse_event_data_type_8.py b/flixpy/flix/extension/extension_api/models/sse_event_data_type_8.py new file mode 100644 index 0000000..e52a232 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/sse_event_data_type_8.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.sse_event_data_type_8_type import SSEEventDataType8Type +from typing import cast + +if TYPE_CHECKING: + from ..models.project_metadata_update_event import ProjectMetadataUpdateEvent + + + + + +T = TypeVar("T", bound="SSEEventDataType8") + + + +@_attrs_define +class SSEEventDataType8: + """ + Attributes: + type_ (SSEEventDataType8Type): + data (ProjectMetadataUpdateEvent): + """ + + type_: SSEEventDataType8Type + data: ProjectMetadataUpdateEvent + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.project_metadata_update_event import ProjectMetadataUpdateEvent # noqa: PLC0415 + type_ = self.type_.value + + data = self.data.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "type": type_, + "data": data, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.project_metadata_update_event import ProjectMetadataUpdateEvent # noqa: PLC0415 + d = dict(src_dict) + type_ = SSEEventDataType8Type(d.pop("type")) + + + + + data = ProjectMetadataUpdateEvent.from_dict(d.pop("data")) + + + + + sse_event_data_type_8 = cls( + type_=type_, + data=data, + ) + + + sse_event_data_type_8.additional_properties = d + return sse_event_data_type_8 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/sse_event_data_type_8_type.py b/flixpy/flix/extension/extension_api/models/sse_event_data_type_8_type.py new file mode 100644 index 0000000..8a7403d --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/sse_event_data_type_8_type.py @@ -0,0 +1,8 @@ +from enum import Enum + + +class SSEEventDataType8Type(str, Enum): + PROJECT_METADATA_UPDATE = "PROJECT_METADATA_UPDATE" + + def __str__(self) -> str: + return str(self.value) diff --git a/flixpy/flix/extension/extension_api/models/updated_panel_metadata_dto.py b/flixpy/flix/extension/extension_api/models/updated_panel_metadata_dto.py new file mode 100644 index 0000000..5484f52 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/updated_panel_metadata_dto.py @@ -0,0 +1,93 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.updated_panel_metadata_dto_metadata import UpdatedPanelMetadataDtoMetadata + + + + + +T = TypeVar("T", bound="UpdatedPanelMetadataDto") + + + +@_attrs_define +class UpdatedPanelMetadataDto: + """ + Attributes: + id (int): + metadata (UpdatedPanelMetadataDtoMetadata): Arbitrary key-value metadata for the panel. Example: + {'ftrack:sequence_id': '9402'}. + """ + + id: int + metadata: UpdatedPanelMetadataDtoMetadata + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.updated_panel_metadata_dto_metadata import UpdatedPanelMetadataDtoMetadata # noqa: PLC0415 + id = self.id + + metadata = self.metadata.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "metadata": metadata, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.updated_panel_metadata_dto_metadata import UpdatedPanelMetadataDtoMetadata # noqa: PLC0415 + d = dict(src_dict) + id = d.pop("id") + + metadata = UpdatedPanelMetadataDtoMetadata.from_dict(d.pop("metadata")) + + + + + updated_panel_metadata_dto = cls( + id=id, + metadata=metadata, + ) + + + updated_panel_metadata_dto.additional_properties = d + return updated_panel_metadata_dto + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/updated_panel_metadata_dto_metadata.py b/flixpy/flix/extension/extension_api/models/updated_panel_metadata_dto_metadata.py new file mode 100644 index 0000000..185f404 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/updated_panel_metadata_dto_metadata.py @@ -0,0 +1,69 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="UpdatedPanelMetadataDtoMetadata") + + + +@_attrs_define +class UpdatedPanelMetadataDtoMetadata: + """ Arbitrary key-value metadata for the panel. + + Example: + {'ftrack:sequence_id': '9402'} + + """ + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + updated_panel_metadata_dto_metadata = cls( + ) + + + updated_panel_metadata_dto_metadata.additional_properties = d + return updated_panel_metadata_dto_metadata + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/viewport_dto.py b/flixpy/flix/extension/extension_api/models/viewport_dto.py new file mode 100644 index 0000000..ef2be64 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/viewport_dto.py @@ -0,0 +1,119 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="ViewportDto") + + + +@_attrs_define +class ViewportDto: + """ + Attributes: + width (int): Width is the width of the media in pixels, dictating the scale of horizontal camera movements. + height (int): Height is the height of the media in pixels, dictating the scale of vertical camera movements. + scale (int): Stretch (Scale in API) specifies how much the source artwork has been stretched within this media. + More specifically, it is the inverse stretch, such that if the source artwork has a width of 1000 + while the bounding box of the same artwork within this media has a width of 2000, the stretch will be + 1000 / 2000 = 0.5. + offset_x (int): OffsetX is the horizontal offset of the source artwork within this media, if this media has been + padded. + In particular, it is the horizontal distance from the centre of this media to the centre of the source artwork. + Specified in terms of the pixel space of the source artwork; calculate OffsetX / Stretch to get + the offset in pixels within this me. + offset_y (int): OffsetY is the vertical offset of the source artwork within this media, if this media has been + padded. + In particular, it is the vertical distance from the centre of this media to the centre of the source artwork. + Specified in terms of the pixel space of the source artwork; calculate OffsetY / Stretch to get + the offset in pixels within this media. + """ + + width: int + height: int + scale: int + offset_x: int + offset_y: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + width = self.width + + height = self.height + + scale = self.scale + + offset_x = self.offset_x + + offset_y = self.offset_y + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "width": width, + "height": height, + "scale": scale, + "offsetX": offset_x, + "offsetY": offset_y, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + width = d.pop("width") + + height = d.pop("height") + + scale = d.pop("scale") + + offset_x = d.pop("offsetX") + + offset_y = d.pop("offsetY") + + viewport_dto = cls( + width=width, + height=height, + scale=scale, + offset_x=offset_x, + offset_y=offset_y, + ) + + + viewport_dto.additional_properties = d + return viewport_dto + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/websocket_event.py b/flixpy/flix/extension/extension_api/models/websocket_event.py index 1b2764a..b112cac 100644 --- a/flixpy/flix/extension/extension_api/models/websocket_event.py +++ b/flixpy/flix/extension/extension_api/models/websocket_event.py @@ -18,6 +18,8 @@ from ..models.websocket_event_data_type_4 import WebsocketEventDataType4 from ..models.websocket_event_data_type_5 import WebsocketEventDataType5 from ..models.websocket_event_data_type_6 import WebsocketEventDataType6 + from ..models.websocket_event_data_type_7 import WebsocketEventDataType7 + from ..models.websocket_event_data_type_8 import WebsocketEventDataType8 @@ -32,10 +34,11 @@ class WebsocketEvent: """ Attributes: data (WebsocketEventDataType0 | WebsocketEventDataType1 | WebsocketEventDataType2 | WebsocketEventDataType3 | - WebsocketEventDataType4 | WebsocketEventDataType5 | WebsocketEventDataType6): + WebsocketEventDataType4 | WebsocketEventDataType5 | WebsocketEventDataType6 | WebsocketEventDataType7 | + WebsocketEventDataType8): """ - data: WebsocketEventDataType0 | WebsocketEventDataType1 | WebsocketEventDataType2 | WebsocketEventDataType3 | WebsocketEventDataType4 | WebsocketEventDataType5 | WebsocketEventDataType6 + data: WebsocketEventDataType0 | WebsocketEventDataType1 | WebsocketEventDataType2 | WebsocketEventDataType3 | WebsocketEventDataType4 | WebsocketEventDataType5 | WebsocketEventDataType6 | WebsocketEventDataType7 | WebsocketEventDataType8 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -50,6 +53,8 @@ def to_dict(self) -> dict[str, Any]: from ..models.websocket_event_data_type_4 import WebsocketEventDataType4 # noqa: PLC0415 from ..models.websocket_event_data_type_5 import WebsocketEventDataType5 # noqa: PLC0415 from ..models.websocket_event_data_type_6 import WebsocketEventDataType6 # noqa: PLC0415 + from ..models.websocket_event_data_type_7 import WebsocketEventDataType7 # noqa: PLC0415 + from ..models.websocket_event_data_type_8 import WebsocketEventDataType8 # noqa: PLC0415 data: dict[str, Any] if isinstance(self.data, WebsocketEventDataType0): data = self.data.to_dict() @@ -63,6 +68,10 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() elif isinstance(self.data, WebsocketEventDataType5): data = self.data.to_dict() + elif isinstance(self.data, WebsocketEventDataType6): + data = self.data.to_dict() + elif isinstance(self.data, WebsocketEventDataType7): + data = self.data.to_dict() else: data = self.data.to_dict() @@ -87,8 +96,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.websocket_event_data_type_4 import WebsocketEventDataType4 # noqa: PLC0415 from ..models.websocket_event_data_type_5 import WebsocketEventDataType5 # noqa: PLC0415 from ..models.websocket_event_data_type_6 import WebsocketEventDataType6 # noqa: PLC0415 + from ..models.websocket_event_data_type_7 import WebsocketEventDataType7 # noqa: PLC0415 + from ..models.websocket_event_data_type_8 import WebsocketEventDataType8 # noqa: PLC0415 d = dict(src_dict) - def _parse_data(data: object) -> WebsocketEventDataType0 | WebsocketEventDataType1 | WebsocketEventDataType2 | WebsocketEventDataType3 | WebsocketEventDataType4 | WebsocketEventDataType5 | WebsocketEventDataType6: + def _parse_data(data: object) -> WebsocketEventDataType0 | WebsocketEventDataType1 | WebsocketEventDataType2 | WebsocketEventDataType3 | WebsocketEventDataType4 | WebsocketEventDataType5 | WebsocketEventDataType6 | WebsocketEventDataType7 | WebsocketEventDataType8: try: if not isinstance(data, dict): raise TypeError() @@ -149,13 +160,33 @@ def _parse_data(data: object) -> WebsocketEventDataType0 | WebsocketEventDataTyp return data_type_5 except (TypeError, ValueError, AttributeError, KeyError): pass + try: + if not isinstance(data, dict): + raise TypeError() + data_type_6 = WebsocketEventDataType6.from_dict(data) + + + + return data_type_6 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + data_type_7 = WebsocketEventDataType7.from_dict(data) + + + + return data_type_7 + except (TypeError, ValueError, AttributeError, KeyError): + pass if not isinstance(data, dict): raise TypeError() - data_type_6 = WebsocketEventDataType6.from_dict(data) + data_type_8 = WebsocketEventDataType8.from_dict(data) - return data_type_6 + return data_type_8 data = _parse_data(d.pop("data")) diff --git a/flixpy/flix/extension/extension_api/models/websocket_event_data_type_7.py b/flixpy/flix/extension/extension_api/models/websocket_event_data_type_7.py new file mode 100644 index 0000000..c3628c2 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/websocket_event_data_type_7.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.websocket_event_data_type_7_type import WebsocketEventDataType7Type +from typing import cast + +if TYPE_CHECKING: + from ..models.panel_metadata_update_event import PanelMetadataUpdateEvent + + + + + +T = TypeVar("T", bound="WebsocketEventDataType7") + + + +@_attrs_define +class WebsocketEventDataType7: + """ + Attributes: + type_ (WebsocketEventDataType7Type): + data (PanelMetadataUpdateEvent): + """ + + type_: WebsocketEventDataType7Type + data: PanelMetadataUpdateEvent + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.panel_metadata_update_event import PanelMetadataUpdateEvent # noqa: PLC0415 + type_ = self.type_.value + + data = self.data.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "type": type_, + "data": data, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.panel_metadata_update_event import PanelMetadataUpdateEvent # noqa: PLC0415 + d = dict(src_dict) + type_ = WebsocketEventDataType7Type(d.pop("type")) + + + + + data = PanelMetadataUpdateEvent.from_dict(d.pop("data")) + + + + + websocket_event_data_type_7 = cls( + type_=type_, + data=data, + ) + + + websocket_event_data_type_7.additional_properties = d + return websocket_event_data_type_7 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/websocket_event_data_type_7_type.py b/flixpy/flix/extension/extension_api/models/websocket_event_data_type_7_type.py new file mode 100644 index 0000000..28ead88 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/websocket_event_data_type_7_type.py @@ -0,0 +1,8 @@ +from enum import Enum + + +class WebsocketEventDataType7Type(str, Enum): + PANEL_METADATA_UPDATE = "PANEL_METADATA_UPDATE" + + def __str__(self) -> str: + return str(self.value) diff --git a/flixpy/flix/extension/extension_api/models/websocket_event_data_type_8.py b/flixpy/flix/extension/extension_api/models/websocket_event_data_type_8.py new file mode 100644 index 0000000..8fa1a86 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/websocket_event_data_type_8.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.websocket_event_data_type_8_type import WebsocketEventDataType8Type +from typing import cast + +if TYPE_CHECKING: + from ..models.project_metadata_update_event import ProjectMetadataUpdateEvent + + + + + +T = TypeVar("T", bound="WebsocketEventDataType8") + + + +@_attrs_define +class WebsocketEventDataType8: + """ + Attributes: + type_ (WebsocketEventDataType8Type): + data (ProjectMetadataUpdateEvent): + """ + + type_: WebsocketEventDataType8Type + data: ProjectMetadataUpdateEvent + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.project_metadata_update_event import ProjectMetadataUpdateEvent # noqa: PLC0415 + type_ = self.type_.value + + data = self.data.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "type": type_, + "data": data, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.project_metadata_update_event import ProjectMetadataUpdateEvent # noqa: PLC0415 + d = dict(src_dict) + type_ = WebsocketEventDataType8Type(d.pop("type")) + + + + + data = ProjectMetadataUpdateEvent.from_dict(d.pop("data")) + + + + + websocket_event_data_type_8 = cls( + type_=type_, + data=data, + ) + + + websocket_event_data_type_8.additional_properties = d + return websocket_event_data_type_8 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/flixpy/flix/extension/extension_api/models/websocket_event_data_type_8_type.py b/flixpy/flix/extension/extension_api/models/websocket_event_data_type_8_type.py new file mode 100644 index 0000000..8a0046c --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/websocket_event_data_type_8_type.py @@ -0,0 +1,8 @@ +from enum import Enum + + +class WebsocketEventDataType8Type(str, Enum): + PROJECT_METADATA_UPDATE = "PROJECT_METADATA_UPDATE" + + def __str__(self) -> str: + return str(self.value) diff --git a/flixpy/flix/extension/extension_api_config.yaml b/flixpy/flix/extension/extension_api_config.yaml index becbc77..d176839 100644 --- a/flixpy/flix/extension/extension_api_config.yaml +++ b/flixpy/flix/extension/extension_api_config.yaml @@ -12,3 +12,5 @@ class_overrides: class_name: SourceFileType PanelRequestSourceFilePreviewMode: class_name: SourceFilePreviewMode +content_type_overrides: + text/event-stream: application/json \ No newline at end of file diff --git a/flixpy/flix/extension/extension_api_templates/property_templates/property_macros.py.jinja b/flixpy/flix/extension/extension_api_templates/property_templates/property_macros.py.jinja new file mode 100644 index 0000000..9cd53ae --- /dev/null +++ b/flixpy/flix/extension/extension_api_templates/property_templates/property_macros.py.jinja @@ -0,0 +1,12 @@ +{% macro construct_template(construct_function, property, source) %} +{% if property.required %} +{{ property.python_name }} = {{ construct_function(property, source) }} +{% else %}{# Must be non-required #} +_{{ property.python_name }} = {{ source }} +{{ property.python_name }}: {{ property.get_type_string() | as_unembedded_code }} +if isinstance(_{{ property.python_name }}, Unset) or _{{ property.python_name }} is None: + {{ property.python_name }} = UNSET +else: + {{ property.python_name }} = {{ construct_function(property, "_" + property.python_name) }} +{% endif %} +{% endmacro %} \ No newline at end of file diff --git a/flixpy/flix/extension/types.py b/flixpy/flix/extension/types.py index 07b9c2e..28479b6 100644 --- a/flixpy/flix/extension/types.py +++ b/flixpy/flix/extension/types.py @@ -4,11 +4,12 @@ import dataclasses import enum -from typing import Any, Self +from typing import TYPE_CHECKING, Any, Self from ..lib import types as flix_types from .extension_api import models from .extension_api.models import ( + ActionRegistrationType, ActionState, ActionType, AssetType, @@ -16,10 +17,16 @@ SourceFilePreviewMode, SourceFileType, ) -from .extension_api.types import Unset +from .extension_api.types import UNSET, Unset + +if TYPE_CHECKING: + import datetime as dt __all__ = [ "ActionEvent", + "ActionEventPanel", + "ActionRegistration", + "ActionRegistrationType", "ActionState", "ActionType", "ActionsInProgress", @@ -32,13 +39,19 @@ "Event", "OpenEvent", "OpenPanelData", + "OpenShot", "OpenSourceFileEvent", "PanelBrowserStatus", + "PanelMetadataUpdate", + "PanelMetadataUpdateEvent", "PanelRequestResponse", + "PanelRevisionDetails", "PanelSelection", "ProjectDetails", "ProjectEvent", "ProjectIds", + "ProjectMetadata", + "ProjectMetadataUpdateEvent", "RevisionStatus", "SourceFile", "SourceFilePreviewMode", @@ -79,44 +92,48 @@ def from_model(cls, data: models.ProjectDetailsDto) -> Self: sequence: flix_types.Sequence | None = None sequence_revision: flix_types.SequenceRevision | None = None - if data.show is not None: + if data.show: show = flix_types.Show( show_id=data.show.id, tracking_code=data.show.tracking_code, aspect_ratio=data.show.aspect_ratio, title=data.show.title or "", + metadata=data.show.metadata.to_dict() if data.show.metadata else None, _client=None, ) - if data.episode is not None: + if data.episode: episode = flix_types.Episode( episode_id=data.episode.id, tracking_code=data.episode.tracking_code, created_date=data.episode.created_date, title=data.episode.title or "", owner=flix_types.User(data.episode.owner, _client=None), + metadata=data.episode.metadata.to_dict() if data.episode.metadata else None, _show=show, _client=None, ) - if data.sequence is not None: + if data.sequence: sequence = flix_types.Sequence( sequence_id=data.sequence.id, tracking_code=data.sequence.tracking_code, created_date=data.sequence.created_date, description=data.sequence.title or "", owner=flix_types.User(data.sequence.owner, _client=None), + metadata=data.sequence.metadata.to_dict() if data.sequence.metadata else None, _show=show, _episode=episode, _client=None, ) - if (rev := data.sequence_revision) is not None: + if rev := data.sequence_revision: sequence_revision = flix_types.SequenceRevision( revision_number=rev.id, published=rev.published, comment=rev.comment or "", created_date=rev.created_date, + metadata=rev.metadata.to_dict() if rev.metadata else None, owner=flix_types.User(rev.owner, _client=None) if rev.owner else None, _sequence=sequence, _client=None, @@ -146,7 +163,7 @@ class ClientEvent(Event): additional_properties: dict[str, Any] @classmethod - def parse_event(cls, event_data: dict[str, Any]) -> ClientEvent: # noqa: PLR0911 + def parse_event(cls, event_data: dict[str, Any]) -> ClientEvent: # noqa: PLR0911, C901 try: ws_event = models.WebsocketEvent.from_dict(event_data) except (ValueError, LookupError, TypeError) as e: @@ -170,6 +187,10 @@ def parse_event(cls, event_data: dict[str, Any]) -> ClientEvent: # noqa: PLR091 return StatusEvent.from_dict(event_type, data) elif isinstance(data, models.PingEvent): return ClientPingEvent.from_dict(event_type, data) + elif isinstance(data, models.PanelMetadataUpdateEvent): + return PanelMetadataUpdateEvent.from_dict(event_type, data) + elif isinstance(data, models.ProjectMetadataUpdateEvent): + return ProjectMetadataUpdateEvent.from_dict(event_type, data) return cls( type=event_type, @@ -190,12 +211,30 @@ def from_dict(cls, event_type: str, data: models.PingEvent) -> Self: ) +@dataclasses.dataclass +class ActionEventPanel: + panel_id: int + panel_revision: int + path: str + metadata: dict[str, str] + + @classmethod + def from_dict(cls, data: models.ActionEventPanelResponse) -> Self: + return cls( + panel_id=data.panel_id, + panel_revision=data.panel_revision, + path=data.path, + metadata={} if isinstance(data.metadata, Unset) else data.metadata.to_dict(), + ) + + @dataclasses.dataclass class ActionEvent(ClientEvent): state: ActionState action: ActionType action_id: int api_client_id: int | None + panels: list[ActionEventPanel] @classmethod def from_dict(cls, event_type: str, data: models.ActionEvent) -> Self: @@ -205,6 +244,9 @@ def from_dict(cls, event_type: str, data: models.ActionEvent) -> Self: action=data.action, action_id=data.action_id, api_client_id=data.api_client_id, + panels=[ActionEventPanel.from_dict(panel) for panel in data.panels] + if not isinstance(data.panels, Unset) + else [], additional_properties=data.additional_properties, ) @@ -237,6 +279,105 @@ def from_dict(cls, event_type: str, data: models.ProjectDetailsDto) -> Self: ) +@dataclasses.dataclass +class PanelMetadataUpdate: + """The metadata of a single panel, as returned after it was updated.""" + + panel_id: int + metadata: dict[str, str] + + @classmethod + def from_model( + cls, + data: models.UpdatedPanelMetadataDto | models.PanelUpdateMetadataResponseItem, + ) -> Self: + return cls(panel_id=data.id, metadata=data.metadata.to_dict()) + + +@dataclasses.dataclass +class PanelMetadataUpdateEvent(ClientEvent): + panels: list[PanelMetadataUpdate] + + @classmethod + def from_dict(cls, event_type: str, data: models.PanelMetadataUpdateEvent) -> Self: + return cls( + type=event_type, + panels=[PanelMetadataUpdate.from_model(panel) for panel in data.panels], + additional_properties=data.additional_properties, + ) + + +@dataclasses.dataclass +class ProjectMetadata: + """Combined metadata for each of the entities in the currently open project. + + Each loaded entity in the current project has its metadata mapped into a dictionary under the + relevant property (show/episode/sequence/sequence revision). If the value is set to None, the + entity is not loaded in Flix. + """ + + show: dict[str, str | None] | None = None + episode: dict[str, str | None] | None = None + sequence: dict[str, str | None] | None = None + sequence_revision: dict[str, str | None] | None = None + + @classmethod + def from_model(cls, data: models.ProjectDetailsMetadataDto) -> Self: + return cls( + show=None if isinstance(data.show, Unset) else data.show.to_dict(), + episode=None if isinstance(data.episode, Unset) else data.episode.to_dict(), + sequence=None if isinstance(data.sequence, Unset) else data.sequence.to_dict(), + sequence_revision=None + if isinstance(data.sequence_revision, Unset) + else data.sequence_revision.to_dict(), + ) + + def to_model(self) -> models.ProjectDetailsMetadataDto: + return models.ProjectDetailsMetadataDto( + show=UNSET + if self.show is None + else models.ProjectDetailsMetadataDtoShow.from_dict(self.show), + episode=UNSET + if self.episode is None + else models.ProjectDetailsMetadataDtoEpisode.from_dict(self.episode), + sequence=UNSET + if self.sequence is None + else models.ProjectDetailsMetadataDtoSequence.from_dict(self.sequence), + sequence_revision=UNSET + if self.sequence_revision is None + else models.ProjectDetailsMetadataDtoSequenceRevision.from_dict(self.sequence_revision), + ) + + +@dataclasses.dataclass +class ProjectMetadataUpdateEvent(ClientEvent): + success: bool + metadata: ProjectMetadata + + @classmethod + def from_dict(cls, event_type: str, data: models.ProjectMetadataUpdateEvent) -> Self: + return cls( + type=event_type, + success=data.success, + metadata=ProjectMetadata( + show=None + if isinstance(data.show, Unset) or isinstance(data.show.metadata, Unset) + else data.show.metadata.to_dict(), + episode=None + if isinstance(data.episode, Unset) or isinstance(data.episode.metadata, Unset) + else data.episode.metadata.to_dict(), + sequence=None + if isinstance(data.sequence, Unset) or isinstance(data.sequence.metadata, Unset) + else data.sequence.metadata.to_dict(), + sequence_revision=None + if isinstance(data.sequence_revision, Unset) + or isinstance(data.sequence_revision.metadata, Unset) + else data.sequence_revision.metadata.to_dict(), + ), + additional_properties=data.additional_properties, + ) + + @dataclasses.dataclass class ProjectIds: show_id: int | None @@ -254,15 +395,6 @@ def from_dict(cls, data: models.ProjectIdsDto) -> Self: ) -@dataclasses.dataclass -class RevisionStatus: - can_save: bool = False - can_publish: bool = False - can_export: bool = False - selected_panels: list[int] = dataclasses.field(default_factory=list) - panel_selection: list[PanelSelection] = dataclasses.field(default_factory=list) - - @dataclasses.dataclass class PanelSelection: id: int @@ -278,6 +410,15 @@ def from_dict(cls, data: models.PanelSelectionResponse) -> Self: ) +@dataclasses.dataclass +class RevisionStatus: + can_save: bool = False + can_publish: bool = False + can_export: bool = False + selected_panels: list[int] = dataclasses.field(default_factory=list[int]) + panel_selection: list[PanelSelection] = dataclasses.field(default_factory=list[PanelSelection]) + + @dataclasses.dataclass class ActionsInProgress: is_saving: bool = False @@ -332,19 +473,58 @@ def from_dict(cls, event_type: str, data: models.StatusResponse) -> Self: @dataclasses.dataclass class OpenPanelData: panel_id: int + panel_index: int + revision_id: int asset_id: int is_animated: bool source_file_asset_id: int | None annotation_asset_id: int | None + shot_id: int | None + dialogue: str | None + origin_sbp: dict[str, Any] | None + keyframes: list[dict[str, Any]] | None + shot_name: str | None @classmethod def from_dict(cls, data: models.OpenFilePanelData) -> Self: return cls( panel_id=data.id, + panel_index=data.index, + revision_id=data.revision_id, asset_id=data.asset_id, is_animated=data.is_animated, - source_file_asset_id=data.source_file.asset_id if data.source_file else None, + source_file_asset_id=data.source_file.asset_id + if not isinstance(data.source_file, Unset) + else None, annotation_asset_id=data.annotation_asset_id or None, + shot_id=data.shot_id or None, + dialogue=data.dialogue if not isinstance(data.dialogue, Unset) else None, + origin_sbp=data.origin_sbp.to_dict() + if not isinstance(data.origin_sbp, Unset) + else None, + keyframes=[keyframe.to_dict() for keyframe in data.keyframes] + if not isinstance(data.keyframes, Unset) + else None, + shot_name=data.shot_name if not isinstance(data.shot_name, Unset) else None, + ) + + +@dataclasses.dataclass +class OpenShot: + shot_id: int + index: int + name: str + start_panel_index: int + end_panel_index: int + + @classmethod + def from_dict(cls, data: models.OpenFileShotData) -> Self: + return cls( + shot_id=data.id, + index=data.index, + name=data.name, + start_panel_index=data.start_panel_index, + end_panel_index=data.end_panel_index, ) @@ -352,6 +532,8 @@ def from_dict(cls, data: models.OpenFilePanelData) -> Self: class OpenEvent(ClientEvent): project: ProjectIds panels: list[OpenPanelData] + shots: list[OpenShot] + action_id: str | None @classmethod def from_dict(cls, event_type: str, data: models.OpenFileEvent) -> Self: @@ -359,7 +541,9 @@ def from_dict(cls, event_type: str, data: models.OpenFileEvent) -> Self: type=event_type, project=ProjectIds.from_dict(data.project), panels=[OpenPanelData.from_dict(panel) for panel in data.panels], + shots=[OpenShot.from_dict(shot) for shot in data.shots], additional_properties=data.additional_properties, + action_id=data.action_id or None, ) @@ -419,3 +603,84 @@ def from_model(cls, data: models.InfoResponse) -> Self: flix_version=data.flix_version, supported_api_versions=data.supported_api_versions, ) + + +@dataclasses.dataclass +class ActionRegistration: + """An action that an extension that is registered with the Flix Client.""" + + id: str + name: str + description: str | None = None + icon_svg: str | None = None + type_: ActionRegistrationType | None = None + + def to_model(self) -> models.ActionRegistration: + return models.ActionRegistration( + id=self.id, + name=self.name, + description=self.description or UNSET, + icon_svg=self.icon_svg or UNSET, + type_=self.type_ or UNSET, + ) + + @classmethod + def from_dict(cls, data: models.ActionRegistration) -> Self: + return cls( + id=data.id, + name=data.name, + description=data.description or None, + icon_svg=data.icon_svg or None, + type_=data.type_ or None, + ) + + +@dataclasses.dataclass +class PanelRevisionDetails: + """A panel revision in the sequence revision currently open in the Panel Browser.""" + + panel_id: int + revision_id: int + panel_position: int + asset_id: int + created_date: dt.datetime + revision_date: dt.datetime + owner: str + show_id: int + sequence_id: int + hidden: bool + duration: int + trim_in_frame: int + trim_out_frame: int + layer_transform: bool + dialogue: str + origin_sbp: dict[str, str] | None + keyframes: list[dict[str, Any]] + origin: str + shot_name: str + metadata: dict[str, str] + + @classmethod + def from_dict(cls, data: models.PanelRevisionDetailsDto) -> Self: + return cls( + panel_id=data.panel_id, + revision_id=data.revision_id, + panel_position=data.panel_position, + asset_id=data.asset_id, + created_date=data.created_date, + revision_date=data.revision_date, + owner=data.owner, + show_id=data.show_id, + sequence_id=data.sequence_id, + hidden=data.hidden, + duration=int(data.duration), + trim_in_frame=data.trim_in_frame, + trim_out_frame=data.trim_out_frame, + layer_transform=data.layer_transform, + dialogue=data.dialogue, + origin_sbp=data.origin_sbp.to_dict() if data.origin_sbp else None, + keyframes=[keyframe.to_dict() for keyframe in data.keyframes], + origin=data.origin, + shot_name=data.shot_name, + metadata=data.metadata.to_dict(), + ) diff --git a/flixpy/flix/lib/types.py b/flixpy/flix/lib/types.py index cee2518..ee47417 100644 --- a/flixpy/flix/lib/types.py +++ b/flixpy/flix/lib/types.py @@ -1,7 +1,5 @@ """Pythonic abstractions of the models used by the Flix Server REST API.""" -# pyright: reportTypedDictNotRequiredAccess=warning - from __future__ import annotations import base64