From 962f5055ff167a979b8a8819f0dd6351689629a3 Mon Sep 17 00:00:00 2001 From: Ben Morton Date: Mon, 16 Nov 2026 11:27:41 +0000 Subject: [PATCH 01/23] [FLIX-282](Story) Update extension API models following schema update --- flixpy/flix/extension/extension_api.yaml | 1380 +++++++++++++++-- .../registration_controller_get_all.py | 12 - ...registration_controller_register_client.py | 8 - ...istration_controller_set_client_actions.py | 182 +++ ...gistration_controller_unregister_client.py | 4 - .../extension_api/api/events/__init__.py | 1 + .../event_controller_handle_connection.py | 189 +++ .../health_check_controller_health_check.py | 4 - .../api/info/info_controller_get.py | 8 - ...wnload_controller_download_media_object.py | 8 - .../panel_controller_annotate.py | 8 - .../panel_controller_create.py | 34 +- .../panel_management/panel_controller_get.py | 282 ++++ .../panel_controller_track_panel.py | 126 ++ .../panel_controller_untrack_panel.py | 126 ++ .../panel_controller_update.py | 8 - .../panel_controller_update_metadata.py | 333 ++++ .../project_details/project_controller_get.py | 8 - .../api/project_metadata/__init__.py | 1 + .../project_metadata_controller_get.py | 154 ++ ...ect_metadata_controller_update_metadata.py | 148 ++ .../api/status/status_controller_get.py | 8 - .../extension_api/models/__init__.py | 126 ++ .../extension_api/models/action_event.py | 31 + .../models/action_event_panel_response.py | 118 ++ .../action_event_panel_response_metadata.py | 69 + .../models/action_registration_response.py | 125 ++ .../action_registration_response_type.py | 8 + .../models/actions_update_request.py | 94 ++ .../models/actions_update_response.py | 94 ++ .../extension_api/models/asset_type.py | 8 + .../models/bulk_panel_annotate_request.py | 4 +- .../models/bulk_panel_request.py | 4 +- .../extension_api/models/client_event_type.py | 2 + .../custom_action_registration_request.py | 126 ++ ...custom_action_registration_request_type.py | 8 + .../models/episode_details_dto.py | 21 + .../models/episode_details_dto_metadata.py | 73 + ...controller_handle_connection_event_item.py | 16 + .../extension_api/models/keyframe.py | 64 + .../extension_api/models/keyframe_request.py | 161 ++ .../extension_api/models/open_file_event.py | 24 + .../models/open_file_panel_data.py | 117 +- .../models/open_file_panel_data_origin_sbp.py | 64 + .../models/open_file_shot_data.py | 108 ++ .../models/panel_details_response.py | 94 ++ .../models/panel_metadata_update_event.py | 94 ++ .../models/panel_request_item.py | 154 ++ .../models/panel_request_item_metadata.py | 73 + .../models/panel_request_item_origin_sbp.py | 67 + .../models/panel_request_source_file.py | 3 +- .../models/panel_revision_details_dto.py | 286 ++++ .../panel_revision_details_dto_metadata.py | 66 + .../panel_revision_details_dto_origin_sbp.py | 67 + .../models/panel_track_request.py | 92 ++ .../models/panel_update_metadata_request.py | 90 ++ .../panel_update_metadata_request_metadata.py | 73 + .../models/panel_update_metadata_response.py | 95 ++ ...l_update_metadata_response_results_item.py | 64 + .../models/project_details_dto.py | 106 +- .../models/project_details_metadata_dto.py | 183 +++ .../project_details_metadata_dto_episode.py | 73 + .../project_details_metadata_dto_sequence.py | 73 + ..._details_metadata_dto_sequence_revision.py | 73 + .../project_details_metadata_dto_show.py | 73 + .../models/project_metadata_update_event.py | 167 ++ .../models/registration_details.py | 48 + .../registration_details_actions_item.py | 64 + .../models/registration_request.py | 50 + .../models/revision_status_response.py | 31 +- .../models/sequence_details_dto.py | 29 + .../models/sequence_details_dto_metadata.py | 73 + .../models/sequence_revision_details_dto.py | 33 + .../sequence_revision_details_dto_metadata.py | 73 + .../extension_api/models/show_details_dto.py | 31 +- .../models/show_details_dto_metadata.py | 73 + .../extension_api/models/sse_event.py | 215 +++ .../models/sse_event_data_type_0.py | 96 ++ .../models/sse_event_data_type_0_type.py | 8 + .../models/sse_event_data_type_1.py | 96 ++ .../models/sse_event_data_type_1_type.py | 8 + .../models/sse_event_data_type_2.py | 96 ++ .../models/sse_event_data_type_2_type.py | 8 + .../models/sse_event_data_type_3.py | 96 ++ .../models/sse_event_data_type_3_type.py | 8 + .../models/sse_event_data_type_4.py | 121 ++ .../models/sse_event_data_type_4_type.py | 8 + .../models/sse_event_data_type_5.py | 96 ++ .../models/sse_event_data_type_5_type.py | 8 + .../models/sse_event_data_type_6.py | 96 ++ .../models/sse_event_data_type_6_data.py | 77 + .../models/sse_event_data_type_6_type.py | 8 + .../models/sse_event_data_type_7.py | 96 ++ .../models/sse_event_data_type_7_type.py | 8 + .../models/sse_event_data_type_8.py | 96 ++ .../models/sse_event_data_type_8_type.py | 8 + .../models/updated_panel_metadata_dto.py | 93 ++ .../updated_panel_metadata_dto_metadata.py | 69 + .../extension_api/models/viewport_request.py | 120 ++ .../extension_api/models/websocket_event.py | 41 +- .../models/websocket_event_data_type_7.py | 96 ++ .../websocket_event_data_type_7_type.py | 8 + .../models/websocket_event_data_type_8.py | 96 ++ .../websocket_event_data_type_8_type.py | 8 + 104 files changed, 8456 insertions(+), 396 deletions(-) create mode 100644 flixpy/flix/extension/extension_api/api/api_registration/registration_controller_set_client_actions.py create mode 100644 flixpy/flix/extension/extension_api/api/events/__init__.py create mode 100644 flixpy/flix/extension/extension_api/api/events/event_controller_handle_connection.py create mode 100644 flixpy/flix/extension/extension_api/api/panel_management/panel_controller_get.py create mode 100644 flixpy/flix/extension/extension_api/api/panel_management/panel_controller_track_panel.py create mode 100644 flixpy/flix/extension/extension_api/api/panel_management/panel_controller_untrack_panel.py create mode 100644 flixpy/flix/extension/extension_api/api/panel_management/panel_controller_update_metadata.py create mode 100644 flixpy/flix/extension/extension_api/api/project_metadata/__init__.py create mode 100644 flixpy/flix/extension/extension_api/api/project_metadata/project_metadata_controller_get.py create mode 100644 flixpy/flix/extension/extension_api/api/project_metadata/project_metadata_controller_update_metadata.py create mode 100644 flixpy/flix/extension/extension_api/models/action_event_panel_response.py create mode 100644 flixpy/flix/extension/extension_api/models/action_event_panel_response_metadata.py create mode 100644 flixpy/flix/extension/extension_api/models/action_registration_response.py create mode 100644 flixpy/flix/extension/extension_api/models/action_registration_response_type.py create mode 100644 flixpy/flix/extension/extension_api/models/actions_update_request.py create mode 100644 flixpy/flix/extension/extension_api/models/actions_update_response.py create mode 100644 flixpy/flix/extension/extension_api/models/custom_action_registration_request.py create mode 100644 flixpy/flix/extension/extension_api/models/custom_action_registration_request_type.py create mode 100644 flixpy/flix/extension/extension_api/models/episode_details_dto_metadata.py create mode 100644 flixpy/flix/extension/extension_api/models/event_controller_handle_connection_event_item.py create mode 100644 flixpy/flix/extension/extension_api/models/keyframe.py create mode 100644 flixpy/flix/extension/extension_api/models/keyframe_request.py create mode 100644 flixpy/flix/extension/extension_api/models/open_file_panel_data_origin_sbp.py create mode 100644 flixpy/flix/extension/extension_api/models/open_file_shot_data.py create mode 100644 flixpy/flix/extension/extension_api/models/panel_details_response.py create mode 100644 flixpy/flix/extension/extension_api/models/panel_metadata_update_event.py create mode 100644 flixpy/flix/extension/extension_api/models/panel_request_item_metadata.py create mode 100644 flixpy/flix/extension/extension_api/models/panel_request_item_origin_sbp.py create mode 100644 flixpy/flix/extension/extension_api/models/panel_revision_details_dto.py create mode 100644 flixpy/flix/extension/extension_api/models/panel_revision_details_dto_metadata.py create mode 100644 flixpy/flix/extension/extension_api/models/panel_revision_details_dto_origin_sbp.py create mode 100644 flixpy/flix/extension/extension_api/models/panel_track_request.py create mode 100644 flixpy/flix/extension/extension_api/models/panel_update_metadata_request.py create mode 100644 flixpy/flix/extension/extension_api/models/panel_update_metadata_request_metadata.py create mode 100644 flixpy/flix/extension/extension_api/models/panel_update_metadata_response.py create mode 100644 flixpy/flix/extension/extension_api/models/panel_update_metadata_response_results_item.py create mode 100644 flixpy/flix/extension/extension_api/models/project_details_metadata_dto.py create mode 100644 flixpy/flix/extension/extension_api/models/project_details_metadata_dto_episode.py create mode 100644 flixpy/flix/extension/extension_api/models/project_details_metadata_dto_sequence.py create mode 100644 flixpy/flix/extension/extension_api/models/project_details_metadata_dto_sequence_revision.py create mode 100644 flixpy/flix/extension/extension_api/models/project_details_metadata_dto_show.py create mode 100644 flixpy/flix/extension/extension_api/models/project_metadata_update_event.py create mode 100644 flixpy/flix/extension/extension_api/models/registration_details_actions_item.py create mode 100644 flixpy/flix/extension/extension_api/models/sequence_details_dto_metadata.py create mode 100644 flixpy/flix/extension/extension_api/models/sequence_revision_details_dto_metadata.py create mode 100644 flixpy/flix/extension/extension_api/models/show_details_dto_metadata.py create mode 100644 flixpy/flix/extension/extension_api/models/sse_event.py create mode 100644 flixpy/flix/extension/extension_api/models/sse_event_data_type_0.py create mode 100644 flixpy/flix/extension/extension_api/models/sse_event_data_type_0_type.py create mode 100644 flixpy/flix/extension/extension_api/models/sse_event_data_type_1.py create mode 100644 flixpy/flix/extension/extension_api/models/sse_event_data_type_1_type.py create mode 100644 flixpy/flix/extension/extension_api/models/sse_event_data_type_2.py create mode 100644 flixpy/flix/extension/extension_api/models/sse_event_data_type_2_type.py create mode 100644 flixpy/flix/extension/extension_api/models/sse_event_data_type_3.py create mode 100644 flixpy/flix/extension/extension_api/models/sse_event_data_type_3_type.py create mode 100644 flixpy/flix/extension/extension_api/models/sse_event_data_type_4.py create mode 100644 flixpy/flix/extension/extension_api/models/sse_event_data_type_4_type.py create mode 100644 flixpy/flix/extension/extension_api/models/sse_event_data_type_5.py create mode 100644 flixpy/flix/extension/extension_api/models/sse_event_data_type_5_type.py create mode 100644 flixpy/flix/extension/extension_api/models/sse_event_data_type_6.py create mode 100644 flixpy/flix/extension/extension_api/models/sse_event_data_type_6_data.py create mode 100644 flixpy/flix/extension/extension_api/models/sse_event_data_type_6_type.py create mode 100644 flixpy/flix/extension/extension_api/models/sse_event_data_type_7.py create mode 100644 flixpy/flix/extension/extension_api/models/sse_event_data_type_7_type.py create mode 100644 flixpy/flix/extension/extension_api/models/sse_event_data_type_8.py create mode 100644 flixpy/flix/extension/extension_api/models/sse_event_data_type_8_type.py create mode 100644 flixpy/flix/extension/extension_api/models/updated_panel_metadata_dto.py create mode 100644 flixpy/flix/extension/extension_api/models/updated_panel_metadata_dto_metadata.py create mode 100644 flixpy/flix/extension/extension_api/models/viewport_request.py create mode 100644 flixpy/flix/extension/extension_api/models/websocket_event_data_type_7.py create mode 100644 flixpy/flix/extension/extension_api/models/websocket_event_data_type_7_type.py create mode 100644 flixpy/flix/extension/extension_api/models/websocket_event_data_type_8.py create mode 100644 flixpy/flix/extension/extension_api/models/websocket_event_data_type_8_type.py diff --git a/flixpy/flix/extension/extension_api.yaml b/flixpy/flix/extension/extension_api.yaml index ce7e5a0..9a9d5a3 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,23 +873,136 @@ components: type: integer required: - assetId + ViewportRequest: + type: object + properties: + width: + type: number + description: Width is the width of the media in pixels, dictating the scale of horizontal camera movements. + height: + type: number + description: Height is the height of the media in pixels, dictating the scale of vertical camera movements. + scale: + type: number + 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: number + 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: number + 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: + - width + - height + - scale + - offsetX + - offsetY + KeyframeRequest: + type: object + properties: + anchorPointHorizontal: + type: number + 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: number + 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: number + 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: number + 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: number + description: How much to rotate the image clockwise in degrees. + default: 0 + scale: + type: number + description: A vertical and horizontal scale, 100 meaning no scaling. + default: 0 + startKey: + type: number + 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/ViewportRequest' + required: + - anchorPointHorizontal + - anchorPointVertical + - centerHorizontal + - centerVertical + - rotation + - scale + - startKey OpenFilePanelData: type: object properties: id: type: integer - assetId: + index: + type: integer + revisionId: + type: integer + assetId: type: integer annotationAssetId: type: integer + shotId: + type: integer isAnimated: type: boolean sourceFile: nullable: true + type: object allOf: - $ref: '#/components/schemas/OpenSourceFileData' + dialogue: + type: string + originSbp: + type: object + keyframes: + type: array + items: + $ref: '#/components/schemas/KeyframeRequest' + shotName: + type: string required: - id + - index + - revisionId - assetId - isAnimated - sourceFile @@ -603,6 +1019,25 @@ components: - 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 +1049,14 @@ components: $ref: '#/components/schemas/OpenFilePanelData' sketchingToolConfiguration: $ref: '#/components/schemas/PsConfiguration' + shots: + type: array + items: + $ref: '#/components/schemas/OpenFileShotData' required: - project - panels + - shots OpenSourceFileEvent: type: object properties: @@ -624,6 +1064,242 @@ 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 + - metadata + - 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 + - metadata + - 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 + - metadata + - 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 + - metadata + - 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 + CustomActionRegistrationRequest: + type: object + properties: + 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. + type: + type: string + description: |- + Context/location of the action within the application. + For now only PanelBrowserAction is supported and will be set regardless of provided value. + enum: + - PanelBrowserAction + required: + - id + - name RegistrationRequest: type: object properties: @@ -641,6 +1317,19 @@ components: type: array items: type: string + actions: + description: List of actions available for this extension. + type: array + items: + $ref: '#/components/schemas/CustomActionRegistrationRequest' + 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 +1365,66 @@ 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/CustomActionRegistrationRequest' + required: + - actions + ActionRegistrationResponse: + type: object + properties: + id: + type: string + description: The 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. + type: + type: string + description: |- + Context/location of the action within the application. + For now only PanelBrowserAction is supported and will be set regardless of provided value. + enum: + - PanelBrowserAction + required: + - id + - name + ActionsUpdateResponse: + type: object + properties: + actions: + description: The list of actions registered for this API consumer's extension. + type: array + items: + $ref: '#/components/schemas/ActionRegistrationResponse' + required: + - actions PanelRequestItem: type: object properties: @@ -687,10 +1432,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/KeyframeRequest' + 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 +1498,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 +1555,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 +1598,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,44 +1619,218 @@ components: required: - paths - origin - PanelRequestResponse: + Keyframe: 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 - DownloadRequest: + properties: {} + PanelRevisionDetailsDto: type: object properties: + panelId: + type: number + description: The identifier of this panel. + revisionId: + type: number + description: The panel revision of this panel instance. + panelPosition: + type: number + description: The position of the panel in the sequence revision it belongs to. assetId: - type: integer - description: The identifier of an asset in Flix. For example, the asset specified in the `OPEN` event. - targetFolder: + type: number + description: The identifier for the asset associated with this panel. + createdDate: + format: date-time type: string - description: The folder that the requested asset should be downloaded into. - assetType: + description: The date the panel was created. + revisionDate: + format: date-time type: string - description: The type of media object to download for the specified asset. - enum: - - aaf - - annotation - - artwork - - audio + description: The date at which this panel revision was created. + owner: + type: string + description: The user that originally created this "panel revision". + showId: + type: number + description: The show this panel belongs to. + sequenceId: + type: number + description: The sequence this panel belongs to. + 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. + trimInFrame: + type: number + description: TrimInFrame is the trim in of this panel revision in a given sequence revision if this is an animated panel. + trimOutFrame: + type: number + description: TrimOutFrame is the trim out of this panel revision in a given sequence revision if this is an animated panel. + in: + type: number + description: The sequence frame in which this panel begins. + out: + type: number + description: The sequence frame in which this panel ends. + 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. + 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. + keyframes: + description: The camera move keyframes on this panel revisions. + type: array + items: + $ref: '#/components/schemas/Keyframe' + origin: + type: string + description: Where the panel comes from e.g. "manual import". + shotName: + type: string + description: Sequence Revision shot this panel belongs to. + metadata: + type: object + additionalProperties: + type: string + description: Metadata of the panel revision. Can be updated via GRC API by extensions. + required: + - panelId + - revisionId + - panelPosition + - assetId + - createdDate + - revisionDate + - owner + - showId + - sequenceId + - hidden + - duration + - trimInFrame + - trimOutFrame + - in + - out + - layerTransform + - dialogue + - originSbp + - keyframes + - origin + - shotName + - metadata + 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 + 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: + type: object + 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: + assetId: + type: integer + description: The identifier of an asset in Flix. For example, the asset specified in the `OPEN` event. + targetFolder: + type: string + description: The folder that the requested asset should be downloaded into. + assetType: + type: string + description: The type of media object to download for the specified asset. + enum: + - aaf + - annotation + - artwork + - audio - contactsheet - dialogue - 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,126 +1864,31 @@ 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: @@ -1059,6 +1940,7 @@ components: - canSave - canPublish - canExport + - panelSelection ActionsInProgressResponse: type: object properties: @@ -1093,3 +1975,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..db9ca8d --- /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.text) + + + + 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..44befad 100644 --- a/flixpy/flix/extension/extension_api/models/__init__.py +++ b/flixpy/flix/extension/extension_api/models/__init__.py @@ -1,44 +1,103 @@ """ 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_response import ActionRegistrationResponse +from .action_registration_response_type import ActionRegistrationResponseType 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 from .client_event_type import ClientEventType +from .custom_action_registration_request import CustomActionRegistrationRequest +from .custom_action_registration_request_type import CustomActionRegistrationRequestType 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 import Keyframe +from .keyframe_request import KeyframeRequest 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 import PanelRevisionDetailsDtoOriginSbp 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_results_item import PanelUpdateMetadataResponseResultsItem 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_request import ViewportRequest from .websocket_event import WebsocketEvent from .websocket_event_data_type_0 import WebsocketEventDataType0 from .websocket_event_data_type_0_type import WebsocketEventDataType0Type @@ -55,47 +114,110 @@ 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", + "ActionRegistrationResponse", + "ActionRegistrationResponseType", "ActionsInProgressResponse", "ActionState", + "ActionsUpdateRequest", + "ActionsUpdateResponse", "ActionType", "AssetType", "BulkPanelAnnotateRequest", "BulkPanelRequest", "ClientEventType", + "CustomActionRegistrationRequest", + "CustomActionRegistrationRequestType", "DownloadRequest", "DownloadResponse", "EpisodeDetailsDto", + "EpisodeDetailsDtoMetadata", + "EventControllerHandleConnectionEventItem", "FullPanelAnnotateRequest", "FullPanelRequest", "InfoResponse", + "Keyframe", + "KeyframeRequest", "OpenFileEvent", "OpenFilePanelData", + "OpenFilePanelDataOriginSbp", + "OpenFileShotData", "OpenSourceFileData", "OpenSourceFileEvent", + "PanelDetailsResponse", + "PanelMetadataUpdateEvent", "PanelRequestItem", + "PanelRequestItemMetadata", + "PanelRequestItemOriginSbp", "PanelRequestResponse", "PanelRequestSourceFile", + "PanelRevisionDetailsDto", + "PanelRevisionDetailsDtoMetadata", + "PanelRevisionDetailsDtoOriginSbp", "PanelSelectionResponse", + "PanelTrackRequest", + "PanelUpdateMetadataRequest", + "PanelUpdateMetadataRequestMetadata", + "PanelUpdateMetadataResponse", + "PanelUpdateMetadataResponseResultsItem", "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", + "ViewportRequest", "WebsocketEvent", "WebsocketEventDataType0", "WebsocketEventDataType0Type", @@ -112,4 +234,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..fa1c1bf --- /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): + 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_response.py b/flixpy/flix/extension/extension_api/models/action_registration_response.py new file mode 100644 index 0000000..635c66d --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/action_registration_response.py @@ -0,0 +1,125 @@ +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_response_type import ActionRegistrationResponseType +from ..types import UNSET, Unset + + + + + + +T = TypeVar("T", bound="ActionRegistrationResponse") + + + +@_attrs_define +class ActionRegistrationResponse: + """ + Attributes: + id (str): The unique identifier for this action. + name (str): The user-friendly name for this action to be displayed in the UI. + 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. + type_ (ActionRegistrationResponseType | Unset): Context/location of the action within the application. + For now only PanelBrowserAction is supported and will be set regardless of provided value. + """ + + id: str + name: str + description: str | Unset = UNSET + icon_svg: str | Unset = UNSET + type_: ActionRegistrationResponseType | 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 + + description = self.description + + icon_svg = self.icon_svg + + type_: str | Unset = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "name": name, + }) + if description is not UNSET: + field_dict["description"] = description + if icon_svg is not UNSET: + field_dict["iconSvg"] = icon_svg + if type_ is not UNSET: + field_dict["type"] = type_ + + 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") + + description = d.pop("description", UNSET) + + icon_svg = d.pop("iconSvg", UNSET) + + _type_ = d.pop("type", UNSET) + type_: ActionRegistrationResponseType | Unset + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = ActionRegistrationResponseType(_type_) + + + + + action_registration_response = cls( + id=id, + name=name, + description=description, + icon_svg=icon_svg, + type_=type_, + ) + + + action_registration_response.additional_properties = d + return action_registration_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_registration_response_type.py b/flixpy/flix/extension/extension_api/models/action_registration_response_type.py new file mode 100644 index 0000000..4794bca --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/action_registration_response_type.py @@ -0,0 +1,8 @@ +from enum import Enum + + +class ActionRegistrationResponseType(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..3f7e90c --- /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.custom_action_registration_request import CustomActionRegistrationRequest + + + + + +T = TypeVar("T", bound="ActionsUpdateRequest") + + + +@_attrs_define +class ActionsUpdateRequest: + """ + Attributes: + actions (list[CustomActionRegistrationRequest]): List of actions to be updated for this API client. + """ + + actions: list[CustomActionRegistrationRequest] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.custom_action_registration_request import CustomActionRegistrationRequest # 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.custom_action_registration_request import CustomActionRegistrationRequest # noqa: PLC0415 + d = dict(src_dict) + actions = [] + _actions = d.pop("actions") + for actions_item_data in (_actions): + actions_item = CustomActionRegistrationRequest.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..1b12cf9 --- /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_response import ActionRegistrationResponse + + + + + +T = TypeVar("T", bound="ActionsUpdateResponse") + + + +@_attrs_define +class ActionsUpdateResponse: + """ + Attributes: + actions (list[ActionRegistrationResponse]): The list of actions registered for this API consumer's extension. + """ + + actions: list[ActionRegistrationResponse] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.action_registration_response import ActionRegistrationResponse # 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_response import ActionRegistrationResponse # noqa: PLC0415 + d = dict(src_dict) + actions = [] + _actions = d.pop("actions") + for actions_item_data in (_actions): + actions_item = ActionRegistrationResponse.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..18684b8 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. 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/custom_action_registration_request.py b/flixpy/flix/extension/extension_api/models/custom_action_registration_request.py new file mode 100644 index 0000000..438209a --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/custom_action_registration_request.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.custom_action_registration_request_type import CustomActionRegistrationRequestType +from ..types import UNSET, Unset + + + + + + +T = TypeVar("T", bound="CustomActionRegistrationRequest") + + + +@_attrs_define +class CustomActionRegistrationRequest: + """ + Attributes: + id (str): Unique identifier for this action. + name (str): The user-friendly name for this action to be displayed in the UI. + 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. + type_ (CustomActionRegistrationRequestType | Unset): Context/location of the action within the application. + For now only PanelBrowserAction is supported and will be set regardless of provided value. + """ + + id: str + name: str + description: str | Unset = UNSET + icon_svg: str | Unset = UNSET + type_: CustomActionRegistrationRequestType | 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 + + description = self.description + + icon_svg = self.icon_svg + + type_: str | Unset = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "name": name, + }) + if description is not UNSET: + field_dict["description"] = description + if icon_svg is not UNSET: + field_dict["iconSvg"] = icon_svg + if type_ is not UNSET: + field_dict["type"] = type_ + + 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") + + description = d.pop("description", UNSET) + + icon_svg = d.pop("iconSvg", UNSET) + + _type_ = d.pop("type", UNSET) + type_: CustomActionRegistrationRequestType | Unset + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = CustomActionRegistrationRequestType(_type_) + + + + + custom_action_registration_request = cls( + id=id, + name=name, + description=description, + icon_svg=icon_svg, + type_=type_, + ) + + + custom_action_registration_request.additional_properties = d + return custom_action_registration_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/custom_action_registration_request_type.py b/flixpy/flix/extension/extension_api/models/custom_action_registration_request_type.py new file mode 100644 index 0000000..164a277 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/custom_action_registration_request_type.py @@ -0,0 +1,8 @@ +from enum import Enum + + +class CustomActionRegistrationRequestType(str, Enum): + PANEL_BROWSER_ACTION = "PanelBrowserAction" + + def __str__(self) -> str: + return str(self.value) 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..ddb69fa 100644 --- a/flixpy/flix/extension/extension_api/models/episode_details_dto.py +++ b/flixpy/flix/extension/extension_api/models/episode_details_dto.py @@ -11,6 +11,8 @@ from typing import cast import datetime +if TYPE_CHECKING: + from ..models.episode_details_dto_metadata import EpisodeDetailsDtoMetadata @@ -25,6 +27,13 @@ class EpisodeDetailsDto: """ Attributes: id (int): The Flix identifier for the episode. + metadata (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}. tracking_code (str): The episode's tracking code. created_date (datetime.datetime): The date the episode was created. owner (str): The user that created the episode. @@ -32,6 +41,7 @@ class EpisodeDetailsDto: """ id: int + metadata: EpisodeDetailsDtoMetadata tracking_code: str created_date: datetime.datetime owner: str @@ -43,8 +53,11 @@ class EpisodeDetailsDto: def to_dict(self) -> dict[str, Any]: + from ..models.episode_details_dto_metadata import EpisodeDetailsDtoMetadata # noqa: PLC0415 id = self.id + metadata = self.metadata.to_dict() + tracking_code = self.tracking_code created_date = self.created_date.isoformat() @@ -59,6 +72,7 @@ def to_dict(self) -> dict[str, Any]: field_dict.update(self.additional_properties) field_dict.update({ "id": id, + "metadata": metadata, "trackingCode": tracking_code, "createdDate": created_date, "owner": owner, @@ -71,9 +85,15 @@ 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") + metadata = EpisodeDetailsDtoMetadata.from_dict(d.pop("metadata")) + + + + tracking_code = d.pop("trackingCode") created_date = datetime.datetime.fromisoformat(d.pop("createdDate")) @@ -93,6 +113,7 @@ def _parse_title(data: object) -> None | str: episode_details_dto = cls( id=id, + metadata=metadata, tracking_code=tracking_code, created_date=created_date, owner=owner, 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/keyframe.py b/flixpy/flix/extension/extension_api/models/keyframe.py new file mode 100644 index 0000000..f7904f3 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/keyframe.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="Keyframe") + + + +@_attrs_define +class Keyframe: + + + 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) + keyframe = cls( + ) + + + keyframe.additional_properties = d + return keyframe + + @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/keyframe_request.py b/flixpy/flix/extension/extension_api/models/keyframe_request.py new file mode 100644 index 0000000..783840e --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/keyframe_request.py @@ -0,0 +1,161 @@ +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_request import ViewportRequest + + + + + +T = TypeVar("T", bound="KeyframeRequest") + + + +@_attrs_define +class KeyframeRequest: + """ + Attributes: + anchor_point_horizontal (float): 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.0. + anchor_point_vertical (float): 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.0. + center_horizontal (float): 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.0. + center_vertical (float): 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.0. + rotation (float): How much to rotate the image clockwise in degrees. Default: 0.0. + scale (float): A vertical and horizontal scale, 100 meaning no scaling. Default: 0.0. + start_key (float): The frame of the panel revision that the information of this keyframe relates to, starting at + 0. Default: 0.0. + viewport (ViewportRequest | Unset): + """ + + anchor_point_horizontal: float = 0.0 + anchor_point_vertical: float = 0.0 + center_horizontal: float = 0.0 + center_vertical: float = 0.0 + rotation: float = 0.0 + scale: float = 0.0 + start_key: float = 0.0 + viewport: ViewportRequest | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.viewport_request import ViewportRequest # 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_request import ViewportRequest # 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: ViewportRequest | Unset + if isinstance(_viewport, Unset): + viewport = UNSET + else: + viewport = ViewportRequest.from_dict(_viewport) + + + + + keyframe_request = 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_request.additional_properties = d + return keyframe_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/open_file_event.py b/flixpy/flix/extension/extension_api/models/open_file_event.py index 800a373..9a06de4 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,11 +31,13 @@ class OpenFileEvent: Attributes: project (ProjectIdsDto): panels (list[OpenFilePanelData]): + shots (list[OpenFileShotData]): sketching_tool_configuration (PsConfiguration | Unset): """ project: ProjectIdsDto panels: list[OpenFilePanelData] + shots: list[OpenFileShotData] sketching_tool_configuration: PsConfiguration | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -44,6 +47,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,6 +59,13 @@ 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() @@ -65,6 +76,7 @@ def to_dict(self) -> dict[str, Any]: field_dict.update({ "project": project, "panels": panels, + "shots": shots, }) if sketching_tool_configuration is not UNSET: field_dict["sketchingToolConfiguration"] = sketching_tool_configuration @@ -76,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.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,6 +107,16 @@ 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): @@ -107,6 +130,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: open_file_event = cls( project=project, panels=panels, + shots=shots, sketching_tool_configuration=sketching_tool_configuration, ) 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..1353a9a 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_request import KeyframeRequest + 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): annotation_asset_id (int | Unset): + shot_id (int | Unset): + dialogue (str | Unset): + origin_sbp (OpenFilePanelDataOriginSbp | Unset): + keyframes (list[KeyframeRequest] | 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 annotation_asset_id: int | Unset = UNSET + shot_id: int | Unset = UNSET + dialogue: str | Unset = UNSET + origin_sbp: OpenFilePanelDataOriginSbp | Unset = UNSET + keyframes: list[KeyframeRequest] | Unset = UNSET + shot_name: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -45,32 +61,65 @@ class OpenFilePanelData: def to_dict(self) -> dict[str, Any]: + from ..models.keyframe_request import KeyframeRequest # 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 = self.source_file.to_dict() - else: - source_file = self.source_file + source_file = self.source_file.to_dict() 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 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 +127,68 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.keyframe_request import KeyframeRequest # 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 = OpenSourceFileData.from_dict(d.pop("sourceFile")) - return source_file_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | OpenSourceFileData, data) - source_file = _parse_source_file(d.pop("sourceFile")) + annotation_asset_id = d.pop("annotationAssetId", UNSET) + shot_id = d.pop("shotId", UNSET) - annotation_asset_id = d.pop("annotationAssetId", UNSET) + dialogue = d.pop("dialogue", UNSET) + + _origin_sbp = d.pop("originSbp", UNSET) + origin_sbp: OpenFilePanelDataOriginSbp | Unset + if isinstance(_origin_sbp, Unset): + origin_sbp = UNSET + else: + origin_sbp = OpenFilePanelDataOriginSbp.from_dict(_origin_sbp) + + + + + _keyframes = d.pop("keyframes", UNSET) + keyframes: list[KeyframeRequest] | Unset = UNSET + if _keyframes is not UNSET: + keyframes = [] + for keyframes_item_data in _keyframes: + keyframes_item = KeyframeRequest.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..ca7a389 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_request import KeyframeRequest + 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[KeyframeRequest] | 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[KeyframeRequest] | 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_request import KeyframeRequest # 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_request import KeyframeRequest # 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): + metadata = UNSET + else: + metadata = PanelRequestItemMetadata.from_dict(_metadata) + + + + + _keyframes = d.pop("keyframes", UNSET) + keyframes: list[KeyframeRequest] | Unset = UNSET + if _keyframes is not UNSET: + keyframes = [] + for keyframes_item_data in _keyframes: + keyframes_item = KeyframeRequest.from_dict(keyframes_item_data) + + + + keyframes.append(keyframes_item) + + + _origin_sbp = d.pop("originSbp", UNSET) + origin_sbp: PanelRequestItemOriginSbp | Unset + if isinstance(_origin_sbp, Unset): + 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..4c75b54 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/panel_revision_details_dto.py @@ -0,0 +1,286 @@ +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 +import datetime + +if TYPE_CHECKING: + from ..models.keyframe import Keyframe + from ..models.panel_revision_details_dto_metadata import PanelRevisionDetailsDtoMetadata + from ..models.panel_revision_details_dto_origin_sbp import PanelRevisionDetailsDtoOriginSbp + + + + + +T = TypeVar("T", bound="PanelRevisionDetailsDto") + + + +@_attrs_define +class PanelRevisionDetailsDto: + """ + Attributes: + panel_id (float): The identifier of this panel. + revision_id (float): The panel revision of this panel instance. + panel_position (float): The position of the panel in the sequence revision it belongs to. + asset_id (float): The identifier for the asset associated with this panel. + 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". + show_id (float): The show this panel belongs to. + sequence_id (float): The sequence this panel belongs to. + hidden (bool): Flag that indicates if a panel has been hidden in a sequence revision. + duration (float): The duration of the panel in frames. + trim_in_frame (float): TrimInFrame is the trim in of this panel revision in a given sequence revision if this is + an animated panel. + trim_out_frame (float): TrimOutFrame is the trim out of this panel revision in a given sequence revision if this + is an animated panel. + in_ (float): The sequence frame in which this panel begins. + out (float): The sequence frame in which this panel ends. + 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. + origin_sbp (PanelRevisionDetailsDtoOriginSbp): 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. + keyframes (list[Keyframe]): 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. + metadata (PanelRevisionDetailsDtoMetadata): Metadata of the panel revision. Can be updated via GRC API by + extensions. + """ + + panel_id: float + revision_id: float + panel_position: float + asset_id: float + created_date: datetime.datetime + revision_date: datetime.datetime + owner: str + show_id: float + sequence_id: float + hidden: bool + duration: float + trim_in_frame: float + trim_out_frame: float + in_: float + out: float + layer_transform: bool + dialogue: str + origin_sbp: PanelRevisionDetailsDtoOriginSbp + keyframes: list[Keyframe] + origin: str + shot_name: str + metadata: PanelRevisionDetailsDtoMetadata + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.keyframe import Keyframe # noqa: PLC0415 + from ..models.panel_revision_details_dto_metadata import PanelRevisionDetailsDtoMetadata # noqa: PLC0415 + from ..models.panel_revision_details_dto_origin_sbp import PanelRevisionDetailsDtoOriginSbp # noqa: PLC0415 + panel_id = self.panel_id + + revision_id = self.revision_id + + panel_position = self.panel_position + + asset_id = self.asset_id + + created_date = self.created_date.isoformat() + + revision_date = self.revision_date.isoformat() + + owner = self.owner + + show_id = self.show_id + + sequence_id = self.sequence_id + + hidden = self.hidden + + duration = self.duration + + trim_in_frame = self.trim_in_frame + + trim_out_frame = self.trim_out_frame + + in_ = self.in_ + + out = self.out + + layer_transform = self.layer_transform + + dialogue = self.dialogue + + origin_sbp = self.origin_sbp.to_dict() + + 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 + + metadata = self.metadata.to_dict() + + + 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, + "createdDate": created_date, + "revisionDate": revision_date, + "owner": owner, + "showId": show_id, + "sequenceId": sequence_id, + "hidden": hidden, + "duration": duration, + "trimInFrame": trim_in_frame, + "trimOutFrame": trim_out_frame, + "in": in_, + "out": out, + "layerTransform": layer_transform, + "dialogue": dialogue, + "originSbp": origin_sbp, + "keyframes": keyframes, + "origin": origin, + "shotName": shot_name, + "metadata": metadata, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.keyframe import Keyframe # noqa: PLC0415 + from ..models.panel_revision_details_dto_metadata import PanelRevisionDetailsDtoMetadata # noqa: PLC0415 + from ..models.panel_revision_details_dto_origin_sbp import PanelRevisionDetailsDtoOriginSbp # 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") + + created_date = datetime.datetime.fromisoformat(d.pop("createdDate")) + + + + + revision_date = datetime.datetime.fromisoformat(d.pop("revisionDate")) + + + + + owner = d.pop("owner") + + show_id = d.pop("showId") + + sequence_id = d.pop("sequenceId") + + hidden = d.pop("hidden") + + duration = d.pop("duration") + + trim_in_frame = d.pop("trimInFrame") + + trim_out_frame = d.pop("trimOutFrame") + + in_ = d.pop("in") + + out = d.pop("out") + + layer_transform = d.pop("layerTransform") + + dialogue = d.pop("dialogue") + + origin_sbp = PanelRevisionDetailsDtoOriginSbp.from_dict(d.pop("originSbp")) + + + + + keyframes = [] + _keyframes = d.pop("keyframes") + for keyframes_item_data in (_keyframes): + keyframes_item = Keyframe.from_dict(keyframes_item_data) + + + + keyframes.append(keyframes_item) + + + origin = d.pop("origin") + + shot_name = d.pop("shotName") + + metadata = PanelRevisionDetailsDtoMetadata.from_dict(d.pop("metadata")) + + + + + panel_revision_details_dto = cls( + panel_id=panel_id, + revision_id=revision_id, + panel_position=panel_position, + asset_id=asset_id, + created_date=created_date, + revision_date=revision_date, + owner=owner, + show_id=show_id, + sequence_id=sequence_id, + hidden=hidden, + duration=duration, + trim_in_frame=trim_in_frame, + trim_out_frame=trim_out_frame, + in_=in_, + out=out, + layer_transform=layer_transform, + dialogue=dialogue, + origin_sbp=origin_sbp, + keyframes=keyframes, + origin=origin, + shot_name=shot_name, + metadata=metadata, + ) + + + 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..aa3201b --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/panel_revision_details_dto_metadata.py @@ -0,0 +1,66 @@ +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: + """ Metadata of the panel revision. Can be updated via GRC API by extensions. + + """ + + 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.py b/flixpy/flix/extension/extension_api/models/panel_revision_details_dto_origin_sbp.py new file mode 100644 index 0000000..f9378ff --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/panel_revision_details_dto_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="PanelRevisionDetailsDtoOriginSbp") + + + +@_attrs_define +class PanelRevisionDetailsDtoOriginSbp: + """ 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 = cls( + ) + + + panel_revision_details_dto_origin_sbp.additional_properties = d + return panel_revision_details_dto_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_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..abdc124 --- /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_results_item import PanelUpdateMetadataResponseResultsItem + + + + + +T = TypeVar("T", bound="PanelUpdateMetadataResponse") + + + +@_attrs_define +class PanelUpdateMetadataResponse: + """ + Attributes: + results (list[PanelUpdateMetadataResponseResultsItem]): List of metadata update results. Each includes panel id + and updated metadata. Example: [{'id': '1', 'metadata': {'com.myextension:status': 'inprogress'}}]. + """ + + results: list[PanelUpdateMetadataResponseResultsItem] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.panel_update_metadata_response_results_item import PanelUpdateMetadataResponseResultsItem # 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_results_item import PanelUpdateMetadataResponseResultsItem # noqa: PLC0415 + d = dict(src_dict) + results = [] + _results = d.pop("results") + for results_item_data in (_results): + results_item = PanelUpdateMetadataResponseResultsItem.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_results_item.py b/flixpy/flix/extension/extension_api/models/panel_update_metadata_response_results_item.py new file mode 100644 index 0000000..049e9d6 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/panel_update_metadata_response_results_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="PanelUpdateMetadataResponseResultsItem") + + + +@_attrs_define +class PanelUpdateMetadataResponseResultsItem: + + + 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) + panel_update_metadata_response_results_item = cls( + ) + + + panel_update_metadata_response_results_item.additional_properties = d + return panel_update_metadata_response_results_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/project_details_dto.py b/flixpy/flix/extension/extension_api/models/project_details_dto.py index f65fcb2..249b312 100644 --- a/flixpy/flix/extension/extension_api/models/project_details_dto.py +++ b/flixpy/flix/extension/extension_api/models/project_details_dto.py @@ -28,16 +28,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): + episode (EpisodeDetailsDto): + sequence (SequenceDetailsDto): + sequence_revision (SequenceRevisionDetailsDto): """ - show: None | ShowDetailsDto - episode: EpisodeDetailsDto | None - sequence: None | SequenceDetailsDto - sequence_revision: None | SequenceRevisionDetailsDto + show: ShowDetailsDto + episode: EpisodeDetailsDto + sequence: SequenceDetailsDto + sequence_revision: SequenceRevisionDetailsDto additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -49,29 +49,13 @@ 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 = self.show.to_dict() - else: - show = self.show - - episode: dict[str, Any] | None - if isinstance(self.episode, EpisodeDetailsDto): - episode = self.episode.to_dict() - else: - episode = self.episode - - sequence: dict[str, Any] | None - if isinstance(self.sequence, SequenceDetailsDto): - sequence = self.sequence.to_dict() - else: - sequence = self.sequence - - sequence_revision: dict[str, Any] | None - if isinstance(self.sequence_revision, SequenceRevisionDetailsDto): - sequence_revision = self.sequence_revision.to_dict() - else: - sequence_revision = self.sequence_revision + show = self.show.to_dict() + + episode = self.episode.to_dict() + + sequence = self.sequence.to_dict() + + sequence_revision = self.sequence_revision.to_dict() field_dict: dict[str, Any] = {} @@ -94,76 +78,24 @@ 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 = ShowDetailsDto.from_dict(d.pop("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 = EpisodeDetailsDto.from_dict(d.pop("episode")) - return sequence_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | SequenceDetailsDto, data) - sequence = _parse_sequence(d.pop("sequence")) + sequence = SequenceDetailsDto.from_dict(d.pop("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 = SequenceRevisionDetailsDto.from_dict(d.pop("sequenceRevision")) - 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..54468a2 --- /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): + show = UNSET + else: + show = ProjectDetailsMetadataDtoShow.from_dict(_show) + + + + + _episode = d.pop("episode", UNSET) + episode: ProjectDetailsMetadataDtoEpisode | Unset + if isinstance(_episode, Unset): + episode = UNSET + else: + episode = ProjectDetailsMetadataDtoEpisode.from_dict(_episode) + + + + + _sequence = d.pop("sequence", UNSET) + sequence: ProjectDetailsMetadataDtoSequence | Unset + if isinstance(_sequence, Unset): + sequence = UNSET + else: + sequence = ProjectDetailsMetadataDtoSequence.from_dict(_sequence) + + + + + _sequence_revision = d.pop("sequenceRevision", UNSET) + sequence_revision: ProjectDetailsMetadataDtoSequenceRevision | Unset + if isinstance(_sequence_revision, Unset): + 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..7449d56 --- /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): + show = UNSET + else: + show = ShowDetailsDto.from_dict(_show) + + + + + _episode = d.pop("episode", UNSET) + episode: EpisodeDetailsDto | Unset + if isinstance(_episode, Unset): + episode = UNSET + else: + episode = EpisodeDetailsDto.from_dict(_episode) + + + + + _sequence = d.pop("sequence", UNSET) + sequence: SequenceDetailsDto | Unset + if isinstance(_sequence, Unset): + sequence = UNSET + else: + sequence = SequenceDetailsDto.from_dict(_sequence) + + + + + _sequence_revision = d.pop("sequenceRevision", UNSET) + sequence_revision: SequenceRevisionDetailsDto | Unset + if isinstance(_sequence_revision, Unset): + 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..52ad3ec 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.custom_action_registration_request import CustomActionRegistrationRequest @@ -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[CustomActionRegistrationRequest] | 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[CustomActionRegistrationRequest] | 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.custom_action_registration_request import CustomActionRegistrationRequest # 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.custom_action_registration_request import CustomActionRegistrationRequest # 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[CustomActionRegistrationRequest] | Unset = UNSET + if _actions is not UNSET: + actions = [] + for actions_item_data in _actions: + actions_item = CustomActionRegistrationRequest.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..d198e54 100644 --- a/flixpy/flix/extension/extension_api/models/sequence_details_dto.py +++ b/flixpy/flix/extension/extension_api/models/sequence_details_dto.py @@ -11,6 +11,8 @@ from typing import cast import datetime +if TYPE_CHECKING: + from ..models.sequence_details_dto_metadata import SequenceDetailsDtoMetadata @@ -25,17 +27,27 @@ class SequenceDetailsDto: """ Attributes: id (int): The Flix identifier for the sequence. + metadata (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}. tracking_code (str): The sequence's tracking code. 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. """ id: int + metadata: SequenceDetailsDtoMetadata tracking_code: str created_date: datetime.datetime owner: str title: None | str + aspect_ratio: float additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -43,8 +55,11 @@ class SequenceDetailsDto: def to_dict(self) -> dict[str, Any]: + from ..models.sequence_details_dto_metadata import SequenceDetailsDtoMetadata # noqa: PLC0415 id = self.id + metadata = self.metadata.to_dict() + tracking_code = self.tracking_code created_date = self.created_date.isoformat() @@ -54,15 +69,19 @@ def to_dict(self) -> dict[str, Any]: title: None | str title = self.title + aspect_ratio = self.aspect_ratio + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({ "id": id, + "metadata": metadata, "trackingCode": tracking_code, "createdDate": created_date, "owner": owner, "title": title, + "aspectRatio": aspect_ratio, }) return field_dict @@ -71,9 +90,15 @@ 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") + metadata = SequenceDetailsDtoMetadata.from_dict(d.pop("metadata")) + + + + tracking_code = d.pop("trackingCode") created_date = datetime.datetime.fromisoformat(d.pop("createdDate")) @@ -91,12 +116,16 @@ def _parse_title(data: object) -> None | str: title = _parse_title(d.pop("title")) + aspect_ratio = d.pop("aspectRatio") + sequence_details_dto = cls( id=id, + metadata=metadata, tracking_code=tracking_code, created_date=created_date, owner=owner, title=title, + aspect_ratio=aspect_ratio, ) 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..972e011 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 @@ -11,6 +11,8 @@ from typing import cast import datetime +if TYPE_CHECKING: + from ..models.sequence_revision_details_dto_metadata import SequenceRevisionDetailsDtoMetadata @@ -25,17 +27,28 @@ class SequenceRevisionDetailsDto: """ Attributes: id (int): The Flix identifier for the sequence revision. + metadata (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}. created_date (datetime.datetime | None): The date the sequence revision was created. 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. """ id: int + metadata: SequenceRevisionDetailsDtoMetadata created_date: datetime.datetime | None owner: str published: bool comment: str + shot_names: list[str] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -43,8 +56,11 @@ class SequenceRevisionDetailsDto: def to_dict(self) -> dict[str, Any]: + from ..models.sequence_revision_details_dto_metadata import SequenceRevisionDetailsDtoMetadata # noqa: PLC0415 id = self.id + metadata = self.metadata.to_dict() + created_date: None | str if isinstance(self.created_date, datetime.datetime): created_date = self.created_date.isoformat() @@ -57,15 +73,21 @@ def to_dict(self) -> dict[str, Any]: comment = self.comment + shot_names = self.shot_names + + + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({ "id": id, + "metadata": metadata, "createdDate": created_date, "owner": owner, "published": published, "comment": comment, + "shotNames": shot_names, }) return field_dict @@ -74,9 +96,15 @@ 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") + metadata = SequenceRevisionDetailsDtoMetadata.from_dict(d.pop("metadata")) + + + + def _parse_created_date(data: object) -> datetime.datetime | None: if data is None: return data @@ -101,12 +129,17 @@ def _parse_created_date(data: object) -> datetime.datetime | None: comment = d.pop("comment") + shot_names = cast(list[str], d.pop("shotNames")) + + sequence_revision_details_dto = cls( id=id, + metadata=metadata, created_date=created_date, owner=owner, published=published, comment=comment, + shot_names=shot_names, ) 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..06c7bc1 100644 --- a/flixpy/flix/extension/extension_api/models/show_details_dto.py +++ b/flixpy/flix/extension/extension_api/models/show_details_dto.py @@ -10,6 +10,8 @@ from typing import cast +if TYPE_CHECKING: + from ..models.show_details_dto_metadata import ShowDetailsDtoMetadata @@ -24,15 +26,25 @@ class ShowDetailsDto: """ Attributes: id (int): The Flix identifier for the show. + metadata (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}. 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. """ id: int + metadata: ShowDetailsDtoMetadata tracking_code: str title: None | str aspect_ratio: float + default_aspect_ratio: float additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -40,8 +52,11 @@ class ShowDetailsDto: def to_dict(self) -> dict[str, Any]: + from ..models.show_details_dto_metadata import ShowDetailsDtoMetadata # noqa: PLC0415 id = self.id + metadata = self.metadata.to_dict() + tracking_code = self.tracking_code title: None | str @@ -49,14 +64,18 @@ def to_dict(self) -> dict[str, Any]: aspect_ratio = self.aspect_ratio + default_aspect_ratio = self.default_aspect_ratio + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({ "id": id, + "metadata": metadata, "trackingCode": tracking_code, "title": title, "aspectRatio": aspect_ratio, + "defaultAspectRatio": default_aspect_ratio, }) return field_dict @@ -65,9 +84,15 @@ 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") + metadata = ShowDetailsDtoMetadata.from_dict(d.pop("metadata")) + + + + tracking_code = d.pop("trackingCode") def _parse_title(data: object) -> None | str: @@ -80,11 +105,15 @@ def _parse_title(data: object) -> None | str: aspect_ratio = d.pop("aspectRatio") + default_aspect_ratio = d.pop("defaultAspectRatio") + show_details_dto = cls( id=id, + metadata=metadata, tracking_code=tracking_code, title=title, aspect_ratio=aspect_ratio, + default_aspect_ratio=default_aspect_ratio, ) 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_request.py b/flixpy/flix/extension/extension_api/models/viewport_request.py new file mode 100644 index 0000000..62e5dd2 --- /dev/null +++ b/flixpy/flix/extension/extension_api/models/viewport_request.py @@ -0,0 +1,120 @@ +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="ViewportRequest") + + + +@_attrs_define +class ViewportRequest: + """ + Attributes: + width (float): Width is the width of the media in pixels, dictating the scale of horizontal camera movements. + height (float): Height is the height of the media in pixels, dictating the scale of vertical camera movements. + scale (float): 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 (float): 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 (float): 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: float + height: float + scale: float + offset_x: float + offset_y: float + 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_request = cls( + width=width, + height=height, + scale=scale, + offset_x=offset_x, + offset_y=offset_y, + ) + + + viewport_request.additional_properties = d + return viewport_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/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) From 88df5734b929bb021cbdc316072eeae202e15929 Mon Sep 17 00:00:00 2001 From: Ben Morton Date: Mon, 16 Nov 2026 16:08:17 +0000 Subject: [PATCH 02/23] [FLIX-282](Story) Update GRC API schema with additional metadata and panel typings --- flixpy/flix/extension/extension_api.yaml | 97 +++++++----- .../extension_api/models/__init__.py | 8 +- .../extension_api/models/keyframe.py | 64 -------- .../models/panel_revision_details_dto.py | 139 ++++++++---------- .../panel_revision_details_dto_metadata.py | 9 +- .../models/panel_update_metadata_response.py | 14 +- .../panel_update_metadata_response_item.py | 98 ++++++++++++ ...update_metadata_response_item_metadata.py} | 27 ++-- 8 files changed, 257 insertions(+), 199 deletions(-) delete mode 100644 flixpy/flix/extension/extension_api/models/keyframe.py create mode 100644 flixpy/flix/extension/extension_api/models/panel_update_metadata_response_item.py rename flixpy/flix/extension/extension_api/models/{panel_update_metadata_response_results_item.py => panel_update_metadata_response_item_metadata.py} (53%) diff --git a/flixpy/flix/extension/extension_api.yaml b/flixpy/flix/extension/extension_api.yaml index 9a9d5a3..c4438c5 100644 --- a/flixpy/flix/extension/extension_api.yaml +++ b/flixpy/flix/extension/extension_api.yaml @@ -1619,24 +1619,46 @@ components: required: - paths - origin - Keyframe: - type: object - properties: {} PanelRevisionDetailsDto: type: object properties: panelId: - type: number + type: integer description: The identifier of this panel. revisionId: - type: number + type: integer description: The panel revision of this panel instance. panelPosition: - type: number + type: integer description: The position of the panel in the sequence revision it belongs to. assetId: - type: number + 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. + 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 @@ -1648,30 +1670,12 @@ components: owner: type: string description: The user that originally created this "panel revision". - showId: - type: number - description: The show this panel belongs to. - sequenceId: - type: number - description: The sequence this panel belongs to. 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. - trimInFrame: - type: number - description: TrimInFrame is the trim in of this panel revision in a given sequence revision if this is an animated panel. - trimOutFrame: - type: number - description: TrimOutFrame is the trim out of this panel revision in a given sequence revision if this is an animated panel. - in: - type: number - description: The sequence frame in which this panel begins. - out: - type: number - description: The sequence frame in which this panel ends. layerTransform: type: boolean description: Whether the panel revision had a layer transform applied to it in Storyboard Pro. @@ -1689,41 +1693,34 @@ components: description: The camera move keyframes on this panel revisions. type: array items: - $ref: '#/components/schemas/Keyframe' + $ref: '#/components/schemas/KeyframeRequest' origin: type: string description: Where the panel comes from e.g. "manual import". shotName: type: string description: Sequence Revision shot this panel belongs to. - metadata: - type: object - additionalProperties: - type: string - description: Metadata of the panel revision. Can be updated via GRC API by extensions. required: - panelId - revisionId - panelPosition - assetId + - showId + - sequenceId + - trimInFrame + - trimOutFrame + - metadata - createdDate - revisionDate - owner - - showId - - sequenceId - hidden - duration - - trimInFrame - - trimOutFrame - - in - - out - layerTransform - dialogue - originSbp - keyframes - origin - shotName - - metadata PanelDetailsResponse: type: object properties: @@ -1764,6 +1761,28 @@ components: 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: @@ -1775,7 +1794,7 @@ components: com.myextension:status: inprogress type: array items: - type: object + $ref: '#/components/schemas/PanelUpdateMetadataResponseItem' required: - results PanelTrackRequest: diff --git a/flixpy/flix/extension/extension_api/models/__init__.py b/flixpy/flix/extension/extension_api/models/__init__.py index 44befad..e804f2c 100644 --- a/flixpy/flix/extension/extension_api/models/__init__.py +++ b/flixpy/flix/extension/extension_api/models/__init__.py @@ -24,7 +24,6 @@ from .full_panel_annotate_request import FullPanelAnnotateRequest from .full_panel_request import FullPanelRequest from .info_response import InfoResponse -from .keyframe import Keyframe from .keyframe_request import KeyframeRequest from .open_file_event import OpenFileEvent from .open_file_panel_data import OpenFilePanelData @@ -47,7 +46,8 @@ 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_results_item import PanelUpdateMetadataResponseResultsItem +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 @@ -144,7 +144,6 @@ "FullPanelAnnotateRequest", "FullPanelRequest", "InfoResponse", - "Keyframe", "KeyframeRequest", "OpenFileEvent", "OpenFilePanelData", @@ -167,7 +166,8 @@ "PanelUpdateMetadataRequest", "PanelUpdateMetadataRequestMetadata", "PanelUpdateMetadataResponse", - "PanelUpdateMetadataResponseResultsItem", + "PanelUpdateMetadataResponseItem", + "PanelUpdateMetadataResponseItemMetadata", "PingEvent", "PreferencesControllerLookupPreferencesResponse200", "ProjectDetailsDto", diff --git a/flixpy/flix/extension/extension_api/models/keyframe.py b/flixpy/flix/extension/extension_api/models/keyframe.py deleted file mode 100644 index f7904f3..0000000 --- a/flixpy/flix/extension/extension_api/models/keyframe.py +++ /dev/null @@ -1,64 +0,0 @@ -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="Keyframe") - - - -@_attrs_define -class Keyframe: - - - 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) - keyframe = cls( - ) - - - keyframe.additional_properties = d - return keyframe - - @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.py b/flixpy/flix/extension/extension_api/models/panel_revision_details_dto.py index 4c75b54..f9e3c9d 100644 --- a/flixpy/flix/extension/extension_api/models/panel_revision_details_dto.py +++ b/flixpy/flix/extension/extension_api/models/panel_revision_details_dto.py @@ -12,7 +12,7 @@ import datetime if TYPE_CHECKING: - from ..models.keyframe import Keyframe + from ..models.keyframe_request import KeyframeRequest from ..models.panel_revision_details_dto_metadata import PanelRevisionDetailsDtoMetadata from ..models.panel_revision_details_dto_origin_sbp import PanelRevisionDetailsDtoOriginSbp @@ -28,57 +28,58 @@ class PanelRevisionDetailsDto: """ Attributes: - panel_id (float): The identifier of this panel. - revision_id (float): The panel revision of this panel instance. - panel_position (float): The position of the panel in the sequence revision it belongs to. - asset_id (float): The identifier for the asset associated with this panel. + 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". - show_id (float): The show this panel belongs to. - sequence_id (float): The sequence this panel belongs to. hidden (bool): Flag that indicates if a panel has been hidden in a sequence revision. duration (float): The duration of the panel in frames. - trim_in_frame (float): TrimInFrame is the trim in of this panel revision in a given sequence revision if this is - an animated panel. - trim_out_frame (float): TrimOutFrame is the trim out of this panel revision in a given sequence revision if this - is an animated panel. - in_ (float): The sequence frame in which this panel begins. - out (float): The sequence frame in which this panel ends. 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. origin_sbp (PanelRevisionDetailsDtoOriginSbp): 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. - keyframes (list[Keyframe]): The camera move keyframes on this panel revisions. + keyframes (list[KeyframeRequest]): 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. - metadata (PanelRevisionDetailsDtoMetadata): Metadata of the panel revision. Can be updated via GRC API by - extensions. """ - panel_id: float - revision_id: float - panel_position: float - asset_id: float + 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 - show_id: float - sequence_id: float hidden: bool duration: float - trim_in_frame: float - trim_out_frame: float - in_: float - out: float layer_transform: bool dialogue: str origin_sbp: PanelRevisionDetailsDtoOriginSbp - keyframes: list[Keyframe] + keyframes: list[KeyframeRequest] origin: str shot_name: str - metadata: PanelRevisionDetailsDtoMetadata additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -86,7 +87,7 @@ class PanelRevisionDetailsDto: def to_dict(self) -> dict[str, Any]: - from ..models.keyframe import Keyframe # noqa: PLC0415 + from ..models.keyframe_request import KeyframeRequest # noqa: PLC0415 from ..models.panel_revision_details_dto_metadata import PanelRevisionDetailsDtoMetadata # noqa: PLC0415 from ..models.panel_revision_details_dto_origin_sbp import PanelRevisionDetailsDtoOriginSbp # noqa: PLC0415 panel_id = self.panel_id @@ -97,27 +98,25 @@ def to_dict(self) -> dict[str, Any]: asset_id = self.asset_id - created_date = self.created_date.isoformat() - - revision_date = self.revision_date.isoformat() - - owner = self.owner - show_id = self.show_id sequence_id = self.sequence_id - hidden = self.hidden - - duration = self.duration - trim_in_frame = self.trim_in_frame trim_out_frame = self.trim_out_frame - in_ = self.in_ + metadata = self.metadata.to_dict() + + created_date = self.created_date.isoformat() + + revision_date = self.revision_date.isoformat() + + owner = self.owner - out = self.out + hidden = self.hidden + + duration = self.duration layer_transform = self.layer_transform @@ -136,8 +135,6 @@ def to_dict(self) -> dict[str, Any]: shot_name = self.shot_name - metadata = self.metadata.to_dict() - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -146,24 +143,22 @@ def to_dict(self) -> dict[str, Any]: "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, - "showId": show_id, - "sequenceId": sequence_id, "hidden": hidden, "duration": duration, - "trimInFrame": trim_in_frame, - "trimOutFrame": trim_out_frame, - "in": in_, - "out": out, "layerTransform": layer_transform, "dialogue": dialogue, "originSbp": origin_sbp, "keyframes": keyframes, "origin": origin, "shotName": shot_name, - "metadata": metadata, }) return field_dict @@ -172,7 +167,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.keyframe import Keyframe # noqa: PLC0415 + from ..models.keyframe_request import KeyframeRequest # noqa: PLC0415 from ..models.panel_revision_details_dto_metadata import PanelRevisionDetailsDtoMetadata # noqa: PLC0415 from ..models.panel_revision_details_dto_origin_sbp import PanelRevisionDetailsDtoOriginSbp # noqa: PLC0415 d = dict(src_dict) @@ -184,33 +179,34 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: asset_id = d.pop("assetId") - created_date = datetime.datetime.fromisoformat(d.pop("createdDate")) + show_id = d.pop("showId") + sequence_id = d.pop("sequenceId") + trim_in_frame = d.pop("trimInFrame") + trim_out_frame = d.pop("trimOutFrame") - revision_date = datetime.datetime.fromisoformat(d.pop("revisionDate")) + metadata = PanelRevisionDetailsDtoMetadata.from_dict(d.pop("metadata")) - owner = d.pop("owner") + created_date = datetime.datetime.fromisoformat(d.pop("createdDate")) - show_id = d.pop("showId") - sequence_id = d.pop("sequenceId") - hidden = d.pop("hidden") - duration = d.pop("duration") + revision_date = datetime.datetime.fromisoformat(d.pop("revisionDate")) + - trim_in_frame = d.pop("trimInFrame") - trim_out_frame = d.pop("trimOutFrame") - in_ = d.pop("in") + owner = d.pop("owner") - out = d.pop("out") + hidden = d.pop("hidden") + + duration = d.pop("duration") layer_transform = d.pop("layerTransform") @@ -224,7 +220,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: keyframes = [] _keyframes = d.pop("keyframes") for keyframes_item_data in (_keyframes): - keyframes_item = Keyframe.from_dict(keyframes_item_data) + keyframes_item = KeyframeRequest.from_dict(keyframes_item_data) @@ -235,34 +231,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: shot_name = d.pop("shotName") - metadata = PanelRevisionDetailsDtoMetadata.from_dict(d.pop("metadata")) - - - - 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, - show_id=show_id, - sequence_id=sequence_id, hidden=hidden, duration=duration, - trim_in_frame=trim_in_frame, - trim_out_frame=trim_out_frame, - in_=in_, - out=out, layer_transform=layer_transform, dialogue=dialogue, origin_sbp=origin_sbp, keyframes=keyframes, origin=origin, shot_name=shot_name, - metadata=metadata, ) 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 index aa3201b..24d836b 100644 --- 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 @@ -20,7 +20,14 @@ @_attrs_define class PanelRevisionDetailsDtoMetadata: - """ Metadata of the panel revision. Can be updated via GRC API by extensions. + """ 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} """ 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 index abdc124..eba365e 100644 --- a/flixpy/flix/extension/extension_api/models/panel_update_metadata_response.py +++ b/flixpy/flix/extension/extension_api/models/panel_update_metadata_response.py @@ -11,7 +11,7 @@ from typing import cast if TYPE_CHECKING: - from ..models.panel_update_metadata_response_results_item import PanelUpdateMetadataResponseResultsItem + from ..models.panel_update_metadata_response_item import PanelUpdateMetadataResponseItem @@ -25,11 +25,11 @@ class PanelUpdateMetadataResponse: """ Attributes: - results (list[PanelUpdateMetadataResponseResultsItem]): List of metadata update results. Each includes panel id - and updated metadata. Example: [{'id': '1', 'metadata': {'com.myextension:status': 'inprogress'}}]. + 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[PanelUpdateMetadataResponseResultsItem] + results: list[PanelUpdateMetadataResponseItem] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -37,7 +37,7 @@ class PanelUpdateMetadataResponse: def to_dict(self) -> dict[str, Any]: - from ..models.panel_update_metadata_response_results_item import PanelUpdateMetadataResponseResultsItem # noqa: PLC0415 + 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() @@ -58,12 +58,12 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.panel_update_metadata_response_results_item import PanelUpdateMetadataResponseResultsItem # noqa: PLC0415 + 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 = PanelUpdateMetadataResponseResultsItem.from_dict(results_item_data) + results_item = PanelUpdateMetadataResponseItem.from_dict(results_item_data) 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_results_item.py b/flixpy/flix/extension/extension_api/models/panel_update_metadata_response_item_metadata.py similarity index 53% rename from flixpy/flix/extension/extension_api/models/panel_update_metadata_response_results_item.py rename to flixpy/flix/extension/extension_api/models/panel_update_metadata_response_item_metadata.py index 049e9d6..6553c7c 100644 --- a/flixpy/flix/extension/extension_api/models/panel_update_metadata_response_results_item.py +++ b/flixpy/flix/extension/extension_api/models/panel_update_metadata_response_item_metadata.py @@ -14,15 +14,24 @@ -T = TypeVar("T", bound="PanelUpdateMetadataResponseResultsItem") +T = TypeVar("T", bound="PanelUpdateMetadataResponseItemMetadata") @_attrs_define -class PanelUpdateMetadataResponseResultsItem: - +class PanelUpdateMetadataResponseItemMetadata: + """ Arbitrary key-value metadata to merge into the entity. Each value must be a string, or `null` to delete that key. - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + **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) @@ -40,21 +49,21 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - panel_update_metadata_response_results_item = cls( + panel_update_metadata_response_item_metadata = cls( ) - panel_update_metadata_response_results_item.additional_properties = d - return panel_update_metadata_response_results_item + 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) -> Any: + def __getitem__(self, key: str) -> str: return self.additional_properties[key] - def __setitem__(self, key: str, value: Any) -> None: + def __setitem__(self, key: str, value: str) -> None: self.additional_properties[key] = value def __delitem__(self, key: str) -> None: From b0ad53441cb5a1b7e4969805cc4f5ac77ab9c358 Mon Sep 17 00:00:00 2001 From: Ben Morton Date: Mon, 16 Nov 2026 17:13:48 +0000 Subject: [PATCH 03/23] [FLIX-282](Story) Update the flix-sdk GRCAPI client to support newly added methods Update the flix-sdk with custom types for the new GRCAPI models Co-authored-by: AI --- flixpy/flix/extension/client.py | 247 ++++++++++++++++++++++++++- flixpy/flix/extension/types.py | 290 ++++++++++++++++++++++++++++++-- 2 files changed, 521 insertions(+), 16 deletions(-) diff --git a/flixpy/flix/extension/client.py b/flixpy/flix/extension/client.py index f1df560..c8b52d0 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,25 @@ 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_bool(value: bool | None) -> str | api_types.Unset: + if value is None: + return api_types.UNSET + return "true" if value else "false" + + +def _query_ids(ids: Iterable[int] | None) -> str | api_types.Unset: + if ids is None: + return api_types.UNSET + return ",".join(str(panel_id) for panel_id in ids) + + +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) @@ -121,7 +140,7 @@ async def __aiter__(self) -> AsyncIterator[_ET_co]: if isinstance(event, self._event_types): yield event - if self._queue is not None: + if self._queue is not None: # pyright: ignore[reportUnnecessaryComparison] self._queue.task_done() @@ -162,6 +181,9 @@ def __init__( log_paths: list[str] | None = None, version: str | None = None, base_url: str = BASE_URL, + actions: list[types.CustomActionRegistrationRequest] | None = None, + icon_svg: str | None = None, + short_name: str | None = None, ) -> None: """Initialise an Extension. @@ -172,6 +194,10 @@ 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. + The list can later be replaced with [set_actions][flix.Extension.set_actions]. + 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,11 +205,14 @@ def __init__( self.version = version self.base_url = base_url self.log_paths = log_paths + self.actions = list(actions) if actions else [] + self.icon_svg = icon_svg + self.short_name = short_name self.panel_browser_status = types.PanelBrowserStatus() self.project = types.ProjectDetails() self._online = False - self._client = extension_api.Client(base_url=self.base_url) + self._client = extension_api.Client(base_url=self.base_url) # pyright: ignore[reportCallIssue] self._registered_client: extension_api.AuthenticatedClient | None = None self.sio = socketio.AsyncClient() self._register_events() @@ -252,6 +281,8 @@ 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, ], ) await self.sio.emit("subscribe", data=events.to_dict()) @@ -371,6 +402,11 @@ 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 self.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, ), ), ) @@ -540,6 +576,211 @@ async def download( return types.DownloadResponse.from_dict(resp) + async def set_actions( + self, + actions: list[types.CustomActionRegistrationRequest], + ) -> list[types.ActionRegistrationResponse]: + """Update the list of custom actions registered for this extension. + + 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, which may differ from what + was requested (for example, the server may force a default `type`). + """ + from .extension_api.api.api_registration import ( + registration_controller_set_client_actions, + ) + + resp = _assert_response( + models.ActionsUpdateResponse, + await registration_controller_set_client_actions.asyncio_detailed( + client=await self._get_registered_client(), + json_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 = list(actions) + return [types.ActionRegistrationResponse.from_dict(action) for action in resp.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. + + 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. + + Raises: + errors.FlixHTTPError: If the Flix Client is not currently in the Panel Browser. + """ + 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=_query_bool(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]: + """Merge custom metadata into panels in the open sequence revision. + + Keys that are not provided are left unchanged. Use namespaced keys (for example, + `com.example.extension:status`) to avoid conflicts with other extensions. + + 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. + + Raises: + errors.FlixHTTPError: If the Flix Client is not currently in the Panel Browser. + """ + 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(), + json_body=models.PanelUpdateMetadataRequest( + metadata=models.PanelUpdateMetadataRequestMetadata.from_dict(dict(metadata)), + ), + selected=_query_bool(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_panel_track( + self, + event: str, + *, + show_id: int, + sequence_id: int, + panel_id: int, + ) -> None: + if not self.online: + raise errors.FlixError("extension is not connected to the Flix Client") + + request = models.PanelTrackRequest( + show_id=show_id, + sequence_id=sequence_id, + panel_id=panel_id, + ) + await self.sio.emit(event, data=request.to_dict()) + + 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_panel_track( + "trackPanel", + show_id=show_id, + sequence_id=sequence_id, + panel_id=panel_id, + ) + + 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_panel_track( + "untrackPanel", + show_id=show_id, + sequence_id=sequence_id, + panel_id=panel_id, + ) + + async def get_project_metadata(self) -> types.ProjectMetadata: + """Get the custom metadata of the show, episode, sequence and sequence revision. + + Raises: + errors.FlixHTTPError: If the Flix Client is not logged in to a server. + """ + 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. + + Args: + metadata: The metadata to merge into the current project. + + Raises: + errors.FlixHTTPError: If the request is invalid, the entities are not in the + current project context, or the Flix Client is not logged in. + """ + 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(), + json_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/types.py b/flixpy/flix/extension/types.py index 07b9c2e..40417ac 100644 --- a/flixpy/flix/extension/types.py +++ b/flixpy/flix/extension/types.py @@ -4,7 +4,7 @@ import dataclasses import enum -from typing import Any, Self +from typing import TYPE_CHECKING, Any, TypeVar, Self from ..lib import types as flix_types from .extension_api import models @@ -16,10 +16,15 @@ SourceFilePreviewMode, SourceFileType, ) -from .extension_api.types import Unset +from .extension_api.types import UNSET, Unset + +if TYPE_CHECKING: + import datetime __all__ = [ "ActionEvent", + "ActionEventPanel", + "ActionRegistrationResponse", "ActionState", "ActionType", "ActionsInProgress", @@ -28,17 +33,24 @@ "ClientEventType", "ClientPingEvent", "ConnectionEvent", + "CustomActionRegistrationRequest", "DownloadResponse", "Event", "OpenEvent", "OpenPanelData", + "OpenShot", "OpenSourceFileEvent", "PanelBrowserStatus", + "PanelMetadataUpdate", + "PanelMetadataUpdateEvent", "PanelRequestResponse", + "PanelRevisionDetails", "PanelSelection", "ProjectDetails", "ProjectEvent", "ProjectIds", + "ProjectMetadata", + "ProjectMetadataUpdateEvent", "RevisionStatus", "SourceFile", "SourceFilePreviewMode", @@ -49,6 +61,18 @@ "VersionResponse", ] +_T = TypeVar("_T") + + +def _or_unset(value: _T | None) -> _T | Unset: + """Convert an optional value into the Unset sentinel used by the generated models.""" + return UNSET if value is None else value + + +def _none_if_unset(value: _T | Unset) -> _T | None: + """Convert the Unset sentinel used by the generated models into None.""" + return None if isinstance(value, Unset) else value + @dataclasses.dataclass class SourceFile: @@ -85,6 +109,7 @@ def from_model(cls, data: models.ProjectDetailsDto) -> Self: tracking_code=data.show.tracking_code, aspect_ratio=data.show.aspect_ratio, title=data.show.title or "", + metadata=data.show.metadata.to_dict(), _client=None, ) @@ -95,6 +120,7 @@ def from_model(cls, data: models.ProjectDetailsDto) -> Self: 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(), _show=show, _client=None, ) @@ -106,6 +132,7 @@ def from_model(cls, data: models.ProjectDetailsDto) -> Self: 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(), _show=show, _episode=episode, _client=None, @@ -117,6 +144,7 @@ def from_model(cls, data: models.ProjectDetailsDto) -> Self: published=rev.published, comment=rev.comment or "", created_date=rev.created_date, + metadata=rev.metadata.to_dict(), owner=flix_types.User(rev.owner, _client=None) if rev.owner else None, _sequence=sequence, _client=None, @@ -146,12 +174,12 @@ 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: if (data := event_data.get("data")) and isinstance(data, dict) and "type" in data: - return cls(type=str(data.pop("type")), additional_properties=data) + return cls(type=str(data.pop("type")), additional_properties=data) # pyright: ignore[reportUnknownArgumentType, reportUnknownMemberType] else: raise ValueError("unexpected event format") from e @@ -170,6 +198,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 +222,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 +255,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 +290,102 @@ 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: + """Custom metadata for the entities in the currently open project. + + Each field maps metadata keys to values. A field that is None is not present: + it is left out of an update, or was not included in an event from the Flix Client. + When updating, a value of None deletes that key. + """ + + 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) else data.show.metadata.to_dict(), + episode=None + if isinstance(data.episode, Unset) + else data.episode.metadata.to_dict(), + sequence=None + if isinstance(data.sequence, Unset) + else data.sequence.metadata.to_dict(), + sequence_revision=None + if isinstance(data.sequence_revision, Unset) + else data.sequence_revision.metadata.to_dict(), + ), + additional_properties=data.additional_properties, + ) + + @dataclasses.dataclass class ProjectIds: show_id: int | None @@ -254,15 +403,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 +418,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 @@ -336,6 +485,7 @@ class OpenPanelData: is_animated: bool source_file_asset_id: int | None annotation_asset_id: int | None + shot_id: int | None @classmethod def from_dict(cls, data: models.OpenFilePanelData) -> Self: @@ -345,6 +495,26 @@ def from_dict(cls, data: models.OpenFilePanelData) -> Self: is_animated=data.is_animated, source_file_asset_id=data.source_file.asset_id if data.source_file else None, annotation_asset_id=data.annotation_asset_id or None, + shot_id=_none_if_unset(data.shot_id), + ) + + +@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 +522,7 @@ def from_dict(cls, data: models.OpenFilePanelData) -> Self: class OpenEvent(ClientEvent): project: ProjectIds panels: list[OpenPanelData] + shots: list[OpenShot] @classmethod def from_dict(cls, event_type: str, data: models.OpenFileEvent) -> Self: @@ -359,6 +530,7 @@ 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, ) @@ -419,3 +591,95 @@ def from_model(cls, data: models.InfoResponse) -> Self: flix_version=data.flix_version, supported_api_versions=data.supported_api_versions, ) + + +@dataclasses.dataclass +class CustomActionRegistrationRequest: + """An action that an extension asks the Flix Client to show in the Panel Browser.""" + + id: str + name: str + description: str | None = None + icon_svg: str | None = None + type: models.CustomActionRegistrationRequestType | None = None + + def to_model(self) -> models.CustomActionRegistrationRequest: + return models.CustomActionRegistrationRequest( + id=self.id, + name=self.name, + description=_or_unset(self.description), + icon_svg=_or_unset(self.icon_svg), + type=_or_unset(self.type), + ) + + +@dataclasses.dataclass +class ActionRegistrationResponse: + """An action as registered with the Flix Client.""" + + id: str + name: str + description: str | None + icon_svg: str | None + type: models.ActionRegistrationResponseType | None + + @classmethod + def from_dict(cls, data: models.ActionRegistrationResponse) -> Self: + return cls( + id=data.id, + name=data.name, + description=_none_if_unset(data.description), + icon_svg=_none_if_unset(data.icon_svg), + type=_none_if_unset(data.type), + ) + + +@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: datetime.datetime + revision_date: datetime.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] + 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(), + keyframes=[keyframe.to_dict() for keyframe in data.keyframes], + origin=data.origin, + shot_name=data.shot_name, + metadata=data.metadata.to_dict(), + ) From b90926a3955d64389888728bb694747eb4c6378a Mon Sep 17 00:00:00 2001 From: Ben Morton Date: Mon, 16 Nov 2026 17:38:00 +0000 Subject: [PATCH 04/23] [FLIX-282](Story) Update keyframe and viewport models to specify integer values and update GRCAPI schema --- flixpy/flix/extension/extension_api.yaml | 36 +++++----- .../extension_api/models/__init__.py | 8 +-- .../{keyframe_request.py => keyframe_dto.py} | 65 +++++++++---------- .../models/open_file_panel_data.py | 14 ++-- .../models/panel_request_item.py | 14 ++-- .../models/panel_revision_details_dto.py | 12 ++-- .../{viewport_request.py => viewport_dto.py} | 33 +++++----- 7 files changed, 90 insertions(+), 92 deletions(-) rename flixpy/flix/extension/extension_api/models/{keyframe_request.py => keyframe_dto.py} (64%) rename flixpy/flix/extension/extension_api/models/{viewport_request.py => viewport_dto.py} (76%) diff --git a/flixpy/flix/extension/extension_api.yaml b/flixpy/flix/extension/extension_api.yaml index c4438c5..e4b1e29 100644 --- a/flixpy/flix/extension/extension_api.yaml +++ b/flixpy/flix/extension/extension_api.yaml @@ -873,31 +873,31 @@ components: type: integer required: - assetId - ViewportRequest: + ViewportDto: type: object properties: width: - type: number + type: integer description: Width is the width of the media in pixels, dictating the scale of horizontal camera movements. height: - type: number + type: integer description: Height is the height of the media in pixels, dictating the scale of vertical camera movements. scale: - type: number + type: integer 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: number + 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: number + 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. @@ -909,45 +909,45 @@ components: - scale - offsetX - offsetY - KeyframeRequest: + KeyframeDto: type: object properties: anchorPointHorizontal: - type: number + 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: number + 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: number + 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: number + 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: number + type: integer description: How much to rotate the image clockwise in degrees. default: 0 scale: - type: number + type: integer description: A vertical and horizontal scale, 100 meaning no scaling. default: 0 startKey: - type: number + type: integer description: The frame of the panel revision that the information of this keyframe relates to, starting at 0. default: 0 viewport: @@ -958,7 +958,7 @@ components: the keyframes associated with this descriptor and the keyframes of the source panel. default: null allOf: - - $ref: '#/components/schemas/ViewportRequest' + - $ref: '#/components/schemas/ViewportDto' required: - anchorPointHorizontal - anchorPointVertical @@ -996,7 +996,7 @@ components: keyframes: type: array items: - $ref: '#/components/schemas/KeyframeRequest' + $ref: '#/components/schemas/KeyframeDto' shotName: type: string required: @@ -1462,7 +1462,7 @@ components: description: The camera move keyframes on this panel revisions. type: array items: - $ref: '#/components/schemas/KeyframeRequest' + $ref: '#/components/schemas/KeyframeDto' originSbp: type: object additionalProperties: @@ -1693,7 +1693,7 @@ components: description: The camera move keyframes on this panel revisions. type: array items: - $ref: '#/components/schemas/KeyframeRequest' + $ref: '#/components/schemas/KeyframeDto' origin: type: string description: Where the panel comes from e.g. "manual import". diff --git a/flixpy/flix/extension/extension_api/models/__init__.py b/flixpy/flix/extension/extension_api/models/__init__.py index e804f2c..8c4dc22 100644 --- a/flixpy/flix/extension/extension_api/models/__init__.py +++ b/flixpy/flix/extension/extension_api/models/__init__.py @@ -24,7 +24,7 @@ from .full_panel_annotate_request import FullPanelAnnotateRequest from .full_panel_request import FullPanelRequest from .info_response import InfoResponse -from .keyframe_request import KeyframeRequest +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 @@ -97,7 +97,7 @@ from .updated_panel_metadata_dto import UpdatedPanelMetadataDto from .updated_panel_metadata_dto_metadata import UpdatedPanelMetadataDtoMetadata from .version_event import VersionEvent -from .viewport_request import ViewportRequest +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 @@ -144,7 +144,7 @@ "FullPanelAnnotateRequest", "FullPanelRequest", "InfoResponse", - "KeyframeRequest", + "KeyframeDto", "OpenFileEvent", "OpenFilePanelData", "OpenFilePanelDataOriginSbp", @@ -217,7 +217,7 @@ "UpdatedPanelMetadataDto", "UpdatedPanelMetadataDtoMetadata", "VersionEvent", - "ViewportRequest", + "ViewportDto", "WebsocketEvent", "WebsocketEventDataType0", "WebsocketEventDataType0Type", diff --git a/flixpy/flix/extension/extension_api/models/keyframe_request.py b/flixpy/flix/extension/extension_api/models/keyframe_dto.py similarity index 64% rename from flixpy/flix/extension/extension_api/models/keyframe_request.py rename to flixpy/flix/extension/extension_api/models/keyframe_dto.py index 783840e..0a37d92 100644 --- a/flixpy/flix/extension/extension_api/models/keyframe_request.py +++ b/flixpy/flix/extension/extension_api/models/keyframe_dto.py @@ -12,50 +12,49 @@ from typing import cast if TYPE_CHECKING: - from ..models.viewport_request import ViewportRequest + from ..models.viewport_dto import ViewportDto -T = TypeVar("T", bound="KeyframeRequest") +T = TypeVar("T", bound="KeyframeDto") @_attrs_define -class KeyframeRequest: +class KeyframeDto: """ Attributes: - anchor_point_horizontal (float): The horizontal value of the point that CenterHoriz, CenterVert and Rotation are + 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.0. - anchor_point_vertical (float): The vertical value of the point that CenterHoriz, CenterVert and Rotation are + 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.0. - center_horizontal (float): The horizontal position of the camera in fractions of the viewport width, relative to + 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.0. - center_vertical (float): 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.0. - rotation (float): How much to rotate the image clockwise in degrees. Default: 0.0. - scale (float): A vertical and horizontal scale, 100 meaning no scaling. Default: 0.0. - start_key (float): The frame of the panel revision that the information of this keyframe relates to, starting at - 0. Default: 0.0. - viewport (ViewportRequest | Unset): + 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: float = 0.0 - anchor_point_vertical: float = 0.0 - center_horizontal: float = 0.0 - center_vertical: float = 0.0 - rotation: float = 0.0 - scale: float = 0.0 - start_key: float = 0.0 - viewport: ViewportRequest | Unset = 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) @@ -63,7 +62,7 @@ class KeyframeRequest: def to_dict(self) -> dict[str, Any]: - from ..models.viewport_request import ViewportRequest # noqa: PLC0415 + from ..models.viewport_dto import ViewportDto # noqa: PLC0415 anchor_point_horizontal = self.anchor_point_horizontal anchor_point_vertical = self.anchor_point_vertical @@ -103,7 +102,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.viewport_request import ViewportRequest # noqa: PLC0415 + from ..models.viewport_dto import ViewportDto # noqa: PLC0415 d = dict(src_dict) anchor_point_horizontal = d.pop("anchorPointHorizontal") @@ -120,16 +119,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: start_key = d.pop("startKey") _viewport = d.pop("viewport", UNSET) - viewport: ViewportRequest | Unset + viewport: ViewportDto | Unset if isinstance(_viewport, Unset): viewport = UNSET else: - viewport = ViewportRequest.from_dict(_viewport) + viewport = ViewportDto.from_dict(_viewport) - keyframe_request = cls( + keyframe_dto = cls( anchor_point_horizontal=anchor_point_horizontal, anchor_point_vertical=anchor_point_vertical, center_horizontal=center_horizontal, @@ -141,8 +140,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) - keyframe_request.additional_properties = d - return keyframe_request + keyframe_dto.additional_properties = d + return keyframe_dto @property def additional_keys(self) -> list[str]: 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 1353a9a..8b231ad 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,7 +12,7 @@ from typing import cast if TYPE_CHECKING: - from ..models.keyframe_request import KeyframeRequest + from ..models.keyframe_dto import KeyframeDto from ..models.open_file_panel_data_origin_sbp import OpenFilePanelDataOriginSbp from ..models.open_source_file_data import OpenSourceFileData @@ -38,7 +38,7 @@ class OpenFilePanelData: shot_id (int | Unset): dialogue (str | Unset): origin_sbp (OpenFilePanelDataOriginSbp | Unset): - keyframes (list[KeyframeRequest] | Unset): + keyframes (list[KeyframeDto] | Unset): shot_name (str | Unset): """ @@ -52,7 +52,7 @@ class OpenFilePanelData: shot_id: int | Unset = UNSET dialogue: str | Unset = UNSET origin_sbp: OpenFilePanelDataOriginSbp | Unset = UNSET - keyframes: list[KeyframeRequest] | Unset = UNSET + keyframes: list[KeyframeDto] | Unset = UNSET shot_name: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -61,7 +61,7 @@ class OpenFilePanelData: def to_dict(self) -> dict[str, Any]: - from ..models.keyframe_request import KeyframeRequest # noqa: PLC0415 + 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 @@ -127,7 +127,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.keyframe_request import KeyframeRequest # noqa: PLC0415 + 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) @@ -163,11 +163,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _keyframes = d.pop("keyframes", UNSET) - keyframes: list[KeyframeRequest] | Unset = UNSET + keyframes: list[KeyframeDto] | Unset = UNSET if _keyframes is not UNSET: keyframes = [] for keyframes_item_data in _keyframes: - keyframes_item = KeyframeRequest.from_dict(keyframes_item_data) + keyframes_item = KeyframeDto.from_dict(keyframes_item_data) 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 ca7a389..8647ad8 100644 --- a/flixpy/flix/extension/extension_api/models/panel_request_item.py +++ b/flixpy/flix/extension/extension_api/models/panel_request_item.py @@ -12,7 +12,7 @@ from typing import cast if TYPE_CHECKING: - from ..models.keyframe_request import KeyframeRequest + from ..models.keyframe_dto import KeyframeDto from ..models.panel_request_item_metadata import PanelRequestItemMetadata from ..models.panel_request_item_origin_sbp import PanelRequestItemOriginSbp @@ -43,7 +43,7 @@ class PanelRequestItem: 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[KeyframeRequest] | Unset): The camera move keyframes on this panel revisions. + 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. @@ -64,7 +64,7 @@ class PanelRequestItem: trim_in_frame: int | Unset = UNSET trim_out_frame: int | Unset = UNSET metadata: PanelRequestItemMetadata | Unset = UNSET - keyframes: list[KeyframeRequest] | Unset = UNSET + keyframes: list[KeyframeDto] | Unset = UNSET origin_sbp: PanelRequestItemOriginSbp | Unset = UNSET source_media: str | Unset = UNSET dialogue: str | Unset = UNSET @@ -77,7 +77,7 @@ class PanelRequestItem: def to_dict(self) -> dict[str, Any]: - from ..models.keyframe_request import KeyframeRequest # noqa: PLC0415 + 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 @@ -150,7 +150,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.keyframe_request import KeyframeRequest # noqa: PLC0415 + 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) @@ -175,11 +175,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _keyframes = d.pop("keyframes", UNSET) - keyframes: list[KeyframeRequest] | Unset = UNSET + keyframes: list[KeyframeDto] | Unset = UNSET if _keyframes is not UNSET: keyframes = [] for keyframes_item_data in _keyframes: - keyframes_item = KeyframeRequest.from_dict(keyframes_item_data) + keyframes_item = KeyframeDto.from_dict(keyframes_item_data) 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 index f9e3c9d..66de425 100644 --- a/flixpy/flix/extension/extension_api/models/panel_revision_details_dto.py +++ b/flixpy/flix/extension/extension_api/models/panel_revision_details_dto.py @@ -12,7 +12,7 @@ import datetime if TYPE_CHECKING: - from ..models.keyframe_request import KeyframeRequest + from ..models.keyframe_dto import KeyframeDto from ..models.panel_revision_details_dto_metadata import PanelRevisionDetailsDtoMetadata from ..models.panel_revision_details_dto_origin_sbp import PanelRevisionDetailsDtoOriginSbp @@ -55,7 +55,7 @@ class PanelRevisionDetailsDto: origin_sbp (PanelRevisionDetailsDtoOriginSbp): 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. - keyframes (list[KeyframeRequest]): The camera move keyframes on this panel revisions. + 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. """ @@ -77,7 +77,7 @@ class PanelRevisionDetailsDto: layer_transform: bool dialogue: str origin_sbp: PanelRevisionDetailsDtoOriginSbp - keyframes: list[KeyframeRequest] + keyframes: list[KeyframeDto] origin: str shot_name: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -87,7 +87,7 @@ class PanelRevisionDetailsDto: def to_dict(self) -> dict[str, Any]: - from ..models.keyframe_request import KeyframeRequest # noqa: PLC0415 + 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 import PanelRevisionDetailsDtoOriginSbp # noqa: PLC0415 panel_id = self.panel_id @@ -167,7 +167,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.keyframe_request import KeyframeRequest # noqa: PLC0415 + 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 import PanelRevisionDetailsDtoOriginSbp # noqa: PLC0415 d = dict(src_dict) @@ -220,7 +220,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: keyframes = [] _keyframes = d.pop("keyframes") for keyframes_item_data in (_keyframes): - keyframes_item = KeyframeRequest.from_dict(keyframes_item_data) + keyframes_item = KeyframeDto.from_dict(keyframes_item_data) diff --git a/flixpy/flix/extension/extension_api/models/viewport_request.py b/flixpy/flix/extension/extension_api/models/viewport_dto.py similarity index 76% rename from flixpy/flix/extension/extension_api/models/viewport_request.py rename to flixpy/flix/extension/extension_api/models/viewport_dto.py index 62e5dd2..ef2be64 100644 --- a/flixpy/flix/extension/extension_api/models/viewport_request.py +++ b/flixpy/flix/extension/extension_api/models/viewport_dto.py @@ -14,38 +14,37 @@ -T = TypeVar("T", bound="ViewportRequest") +T = TypeVar("T", bound="ViewportDto") @_attrs_define -class ViewportRequest: +class ViewportDto: """ Attributes: - width (float): Width is the width of the media in pixels, dictating the scale of horizontal camera movements. - height (float): Height is the height of the media in pixels, dictating the scale of vertical camera movements. - scale (float): Stretch (Scale in API) specifies how much the source artwork has been stretched within this - media. + 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 (float): OffsetX is the horizontal offset of the source artwork within this media, if this media has - been padded. + 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 (float): OffsetY is the vertical offset of the source artwork within this media, if this media has been + 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: float - height: float - scale: float - offset_x: float - offset_y: float + width: int + height: int + scale: int + offset_x: int + offset_y: int additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -91,7 +90,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: offset_y = d.pop("offsetY") - viewport_request = cls( + viewport_dto = cls( width=width, height=height, scale=scale, @@ -100,8 +99,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) - viewport_request.additional_properties = d - return viewport_request + viewport_dto.additional_properties = d + return viewport_dto @property def additional_keys(self) -> list[str]: From 00e41450632111b3a2053bcdfd9fb3bce32089fe Mon Sep 17 00:00:00 2001 From: Ben Morton Date: Tue, 17 Nov 2026 19:14:43 +0000 Subject: [PATCH 05/23] [FLIX-282](Story) Add action ID to the open event --- flixpy/flix/extension/extension_api.yaml | 2 ++ .../extension/extension_api/models/open_file_event.py | 9 +++++++++ flixpy/flix/extension/types.py | 2 ++ 3 files changed, 13 insertions(+) diff --git a/flixpy/flix/extension/extension_api.yaml b/flixpy/flix/extension/extension_api.yaml index e4b1e29..11ab48f 100644 --- a/flixpy/flix/extension/extension_api.yaml +++ b/flixpy/flix/extension/extension_api.yaml @@ -1053,6 +1053,8 @@ components: type: array items: $ref: '#/components/schemas/OpenFileShotData' + actionId: + type: string required: - project - panels 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 9a06de4..fa8dceb 100644 --- a/flixpy/flix/extension/extension_api/models/open_file_event.py +++ b/flixpy/flix/extension/extension_api/models/open_file_event.py @@ -33,12 +33,14 @@ class OpenFileEvent: 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) @@ -70,6 +72,8 @@ def to_dict(self) -> dict[str, Any]: 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) @@ -80,6 +84,8 @@ def to_dict(self) -> dict[str, Any]: }) 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 @@ -127,11 +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/types.py b/flixpy/flix/extension/types.py index 40417ac..a9d2ef4 100644 --- a/flixpy/flix/extension/types.py +++ b/flixpy/flix/extension/types.py @@ -523,6 +523,7 @@ 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: @@ -532,6 +533,7 @@ def from_dict(cls, event_type: str, data: models.OpenFileEvent) -> Self: 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=_none_if_unset(data.action_id), ) From 8b5c703514b6704d484c4865e40ded08790a6772 Mon Sep 17 00:00:00 2001 From: Ben Morton Date: Tue, 17 Nov 2026 19:24:24 +0000 Subject: [PATCH 06/23] [FLIX-282](Story) Add skip panel reuse to import panels method --- flixpy/flix/extension/client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flixpy/flix/extension/client.py b/flixpy/flix/extension/client.py index c8b52d0..e5b9b79 100644 --- a/flixpy/flix/extension/client.py +++ b/flixpy/flix/extension/client.py @@ -496,6 +496,7 @@ async def import_panels( source_file: types.SourceFile | None = None, start_index: int | None = None, replace_panels: bool = False, + skip_panel_reuse: bool = False, ) -> types.PanelRequestResponse: """Instructs the Flix Client to import the given files as panel revisions. @@ -523,6 +524,7 @@ 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 not replace_panels: From d4ae3898b4ee60bff4aa6313f4bd84515eece9e5 Mon Sep 17 00:00:00 2001 From: Ben Morton Date: Wed, 18 Nov 2026 18:28:15 +0000 Subject: [PATCH 07/23] [FLIX-282](Story) Fix linter errors flagged by ruff Add ruff to the makefile typecheck command --- flixpy/Makefile | 2 ++ flixpy/flix/extension/client.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) 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 e5b9b79..2725041 100644 --- a/flixpy/flix/extension/client.py +++ b/flixpy/flix/extension/client.py @@ -496,7 +496,7 @@ async def import_panels( source_file: types.SourceFile | None = None, start_index: int | None = None, replace_panels: bool = False, - skip_panel_reuse: bool = False, + skip_panel_reuse: bool | None = None, ) -> types.PanelRequestResponse: """Instructs the Flix Client to import the given files as panel revisions. @@ -507,6 +507,9 @@ 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, From 914c3d3278d687f152b20aeef5a51eb4a8cec065 Mon Sep 17 00:00:00 2001 From: Ben Morton Date: Wed, 18 Nov 2026 18:29:59 +0000 Subject: [PATCH 08/23] [FLIX-282](Story) Fix type error with updated import panels method --- flixpy/flix/extension/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flixpy/flix/extension/client.py b/flixpy/flix/extension/client.py index 2725041..c500bc6 100644 --- a/flixpy/flix/extension/client.py +++ b/flixpy/flix/extension/client.py @@ -527,7 +527,7 @@ 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, + skip_panel_reuse=skip_panel_reuse if skip_panel_reuse is not None else api_types.UNSET, ) if not replace_panels: From 8afbe75154d0664c3b2290e4b02a4af28654aecc Mon Sep 17 00:00:00 2001 From: Ben Morton Date: Thu, 19 Nov 2026 11:27:43 +0000 Subject: [PATCH 09/23] [FLIX-282](Story) Remove pyright ignore commands --- flixpy/flix/extension/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flixpy/flix/extension/types.py b/flixpy/flix/extension/types.py index a9d2ef4..c9a0584 100644 --- a/flixpy/flix/extension/types.py +++ b/flixpy/flix/extension/types.py @@ -179,7 +179,7 @@ def parse_event(cls, event_data: dict[str, Any]) -> ClientEvent: # noqa: PLR091 ws_event = models.WebsocketEvent.from_dict(event_data) except (ValueError, LookupError, TypeError) as e: if (data := event_data.get("data")) and isinstance(data, dict) and "type" in data: - return cls(type=str(data.pop("type")), additional_properties=data) # pyright: ignore[reportUnknownArgumentType, reportUnknownMemberType] + return cls(type=str(data.pop("type")), additional_properties=data) else: raise ValueError("unexpected event format") from e From 8cfb7a443401233a3a16a59fdc77306fce81bea5 Mon Sep 17 00:00:00 2001 From: Ben Morton Date: Thu, 19 Nov 2026 17:07:00 +0000 Subject: [PATCH 10/23] [FLIX-282](Story) Remove redundant pyright ignore comments Remove extraneous utility methods Update to use a single class for action registrations Update some comment texts --- flixpy/flix/extension/client.py | 96 ++++++-------- flixpy/flix/extension/extension_api.yaml | 53 +++----- .../extension_api/models/__init__.py | 12 +- ...tion_request.py => action_registration.py} | 44 +++--- .../models/action_registration_response.py | 125 ------------------ ...se_type.py => action_registration_type.py} | 2 +- .../models/actions_update_request.py | 12 +- .../models/actions_update_response.py | 12 +- ...custom_action_registration_request_type.py | 8 -- .../models/registration_request.py | 14 +- flixpy/flix/extension/types.py | 66 +++------ flixpy/flix/lib/types.py | 2 - 12 files changed, 122 insertions(+), 324 deletions(-) rename flixpy/flix/extension/extension_api/models/{custom_action_registration_request.py => action_registration.py} (81%) delete mode 100644 flixpy/flix/extension/extension_api/models/action_registration_response.py rename flixpy/flix/extension/extension_api/models/{action_registration_response_type.py => action_registration_type.py} (73%) delete mode 100644 flixpy/flix/extension/extension_api/models/custom_action_registration_request_type.py diff --git a/flixpy/flix/extension/client.py b/flixpy/flix/extension/client.py index c500bc6..35664c4 100644 --- a/flixpy/flix/extension/client.py +++ b/flixpy/flix/extension/client.py @@ -47,16 +47,15 @@ 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_bool(value: bool | None) -> str | api_types.Unset: - if value is None: - return api_types.UNSET - return "true" if value else "false" - - def _query_ids(ids: Iterable[int] | None) -> str | api_types.Unset: if ids is None: return api_types.UNSET - return ",".join(str(panel_id) for panel_id in ids) + + panel_ids = [str(panel_id) for panel_id in ids] + if len(panel_ids) == 0: + return api_types.UNSET + + return ",".join(panel_ids) def _query_range(panel_range: tuple[int, int] | None) -> str | api_types.Unset: @@ -140,7 +139,7 @@ async def __aiter__(self) -> AsyncIterator[_ET_co]: if isinstance(event, self._event_types): yield event - if self._queue is not None: # pyright: ignore[reportUnnecessaryComparison] + if self._queue is not None: self._queue.task_done() @@ -181,7 +180,7 @@ def __init__( log_paths: list[str] | None = None, version: str | None = None, base_url: str = BASE_URL, - actions: list[types.CustomActionRegistrationRequest] | None = None, + actions: list[types.ActionRegistration] | None = None, icon_svg: str | None = None, short_name: str | None = None, ) -> None: @@ -195,7 +194,6 @@ def __init__( 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. - The list can later be replaced with [set_actions][flix.Extension.set_actions]. 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. @@ -205,14 +203,14 @@ def __init__( self.version = version self.base_url = base_url self.log_paths = log_paths - self.actions = list(actions) if actions else [] + 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 - self._client = extension_api.Client(base_url=self.base_url) # pyright: ignore[reportCallIssue] + self._client = extension_api.Client(base_url=self.base_url) self._registered_client: extension_api.AuthenticatedClient | None = None self.sio = socketio.AsyncClient() self._register_events() @@ -285,6 +283,8 @@ async def _on_connect(self) -> None: 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: @@ -583,8 +583,8 @@ async def download( async def set_actions( self, - actions: list[types.CustomActionRegistrationRequest], - ) -> list[types.ActionRegistrationResponse]: + actions: list[types.ActionRegistration], + ) -> list[types.ActionRegistration]: """Update the list of custom actions registered for this extension. Args: @@ -592,8 +592,7 @@ async def set_actions( This replaces any previously registered actions. Returns: - The actions as registered by the Flix Client, which may differ from what - was requested (for example, the server may force a default `type`). + The actions as registered by the Flix Client. """ from .extension_api.api.api_registration import ( registration_controller_set_client_actions, @@ -610,8 +609,8 @@ async def set_actions( ) # keep the stored actions in step, so that re-registering uses the latest list - self.actions = list(actions) - return [types.ActionRegistrationResponse.from_dict(action) for action in resp.actions] + self.actions = [types.ActionRegistration.from_dict(action) for action in resp.actions] + return self.actions async def get_panels( self, @@ -633,9 +632,6 @@ async def get_panels( Returns: The panel revisions that match the filters. - - Raises: - errors.FlixHTTPError: If the Flix Client is not currently in the Panel Browser. """ from .extension_api.api.panel_management import panel_controller_get @@ -643,7 +639,7 @@ async def get_panels( models.PanelDetailsResponse, await panel_controller_get.asyncio_detailed( client=await self._get_registered_client(), - selected=_query_bool(selected), + selected=selected, range_=_query_range(panel_range), panel_ids=_query_ids(panel_ids), ), @@ -659,9 +655,10 @@ async def update_panel_metadata( panel_ids: Iterable[int] | None = None, panel_range: tuple[int, int] | None = None, ) -> list[types.PanelMetadataUpdate]: - """Merge custom metadata into panels in the open sequence revision. + """Update metadata associated with panels in the current sequence revision. - Keys that are not provided are left unchanged. Use namespaced keys (for example, + 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. Args: @@ -674,9 +671,6 @@ async def update_panel_metadata( Returns: The metadata of each panel after the update. - - Raises: - errors.FlixHTTPError: If the Flix Client is not currently in the Panel Browser. """ from .extension_api.api.panel_management import panel_controller_update_metadata @@ -687,7 +681,7 @@ async def update_panel_metadata( json_body=models.PanelUpdateMetadataRequest( metadata=models.PanelUpdateMetadataRequestMetadata.from_dict(dict(metadata)), ), - selected=_query_bool(selected), + selected=selected, range_=_query_range(panel_range), panel_ids=_query_ids(panel_ids), ), @@ -695,23 +689,11 @@ async def update_panel_metadata( return [types.PanelMetadataUpdate.from_model(result) for result in resp.results] - async def _emit_panel_track( - self, - event: str, - *, - show_id: int, - sequence_id: int, - panel_id: int, - ) -> None: + 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") - request = models.PanelTrackRequest( - show_id=show_id, - sequence_id=sequence_id, - panel_id=panel_id, - ) - await self.sio.emit(event, data=request.to_dict()) + 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. @@ -722,11 +704,13 @@ async def track_panel(self, *, show_id: int, sequence_id: int, panel_id: int) -> Raises: errors.FlixError: If the extension is not connected to the Flix Client. """ - await self._emit_panel_track( + await self._emit_socket_message( "trackPanel", - show_id=show_id, - sequence_id=sequence_id, - panel_id=panel_id, + 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: @@ -738,19 +722,17 @@ async def untrack_panel(self, *, show_id: int, sequence_id: int, panel_id: int) Raises: errors.FlixError: If the extension is not connected to the Flix Client. """ - await self._emit_panel_track( + await self._emit_socket_message( "untrackPanel", - show_id=show_id, - sequence_id=sequence_id, - panel_id=panel_id, + 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. - - Raises: - errors.FlixHTTPError: If the Flix Client is not logged in to a server. - """ + """Get the custom metadata of the show, episode, sequence and sequence revision.""" from .extension_api.api.project_metadata import project_metadata_controller_get resp = _assert_response( @@ -771,10 +753,6 @@ async def update_project_metadata(self, metadata: types.ProjectMetadata) -> None Args: metadata: The metadata to merge into the current project. - - Raises: - errors.FlixHTTPError: If the request is invalid, the entities are not in the - current project context, or the Flix Client is not logged in. """ from .extension_api.api.project_metadata import ( project_metadata_controller_update_metadata, diff --git a/flixpy/flix/extension/extension_api.yaml b/flixpy/flix/extension/extension_api.yaml index 11ab48f..365d397 100644 --- a/flixpy/flix/extension/extension_api.yaml +++ b/flixpy/flix/extension/extension_api.yaml @@ -1275,9 +1275,22 @@ components: $ref: '#/components/schemas/SequenceRevisionDetailsDto' required: - success - CustomActionRegistrationRequest: + 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. @@ -1292,13 +1305,6 @@ components: 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. - type: - type: string - description: |- - Context/location of the action within the application. - For now only PanelBrowserAction is supported and will be set regardless of provided value. - enum: - - PanelBrowserAction required: - id - name @@ -1323,7 +1329,7 @@ components: description: List of actions available for this extension. type: array items: - $ref: '#/components/schemas/CustomActionRegistrationRequest' + $ref: '#/components/schemas/ActionRegistration' iconSvg: type: string description: |- @@ -1389,34 +1395,9 @@ components: description: List of actions to be updated for this API client. type: array items: - $ref: '#/components/schemas/CustomActionRegistrationRequest' + $ref: '#/components/schemas/ActionRegistration' required: - actions - ActionRegistrationResponse: - type: object - properties: - id: - type: string - description: The 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. - type: - type: string - description: |- - Context/location of the action within the application. - For now only PanelBrowserAction is supported and will be set regardless of provided value. - enum: - - PanelBrowserAction - required: - - id - - name ActionsUpdateResponse: type: object properties: @@ -1424,7 +1405,7 @@ components: description: The list of actions registered for this API consumer's extension. type: array items: - $ref: '#/components/schemas/ActionRegistrationResponse' + $ref: '#/components/schemas/ActionRegistration' required: - actions PanelRequestItem: diff --git a/flixpy/flix/extension/extension_api/models/__init__.py b/flixpy/flix/extension/extension_api/models/__init__.py index 8c4dc22..272de69 100644 --- a/flixpy/flix/extension/extension_api/models/__init__.py +++ b/flixpy/flix/extension/extension_api/models/__init__.py @@ -3,8 +3,8 @@ from .action_event import ActionEvent from .action_event_panel_response import ActionEventPanelResponse from .action_event_panel_response_metadata import ActionEventPanelResponseMetadata -from .action_registration_response import ActionRegistrationResponse -from .action_registration_response_type import ActionRegistrationResponseType +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 @@ -14,8 +14,6 @@ from .bulk_panel_annotate_request import BulkPanelAnnotateRequest from .bulk_panel_request import BulkPanelRequest from .client_event_type import ClientEventType -from .custom_action_registration_request import CustomActionRegistrationRequest -from .custom_action_registration_request_type import CustomActionRegistrationRequestType from .download_request import DownloadRequest from .download_response import DownloadResponse from .episode_details_dto import EpisodeDetailsDto @@ -123,8 +121,8 @@ "ActionEvent", "ActionEventPanelResponse", "ActionEventPanelResponseMetadata", - "ActionRegistrationResponse", - "ActionRegistrationResponseType", + "ActionRegistration", + "ActionRegistrationType", "ActionsInProgressResponse", "ActionState", "ActionsUpdateRequest", @@ -134,8 +132,6 @@ "BulkPanelAnnotateRequest", "BulkPanelRequest", "ClientEventType", - "CustomActionRegistrationRequest", - "CustomActionRegistrationRequestType", "DownloadRequest", "DownloadResponse", "EpisodeDetailsDto", diff --git a/flixpy/flix/extension/extension_api/models/custom_action_registration_request.py b/flixpy/flix/extension/extension_api/models/action_registration.py similarity index 81% rename from flixpy/flix/extension/extension_api/models/custom_action_registration_request.py rename to flixpy/flix/extension/extension_api/models/action_registration.py index 438209a..9852adb 100644 --- a/flixpy/flix/extension/extension_api/models/custom_action_registration_request.py +++ b/flixpy/flix/extension/extension_api/models/action_registration.py @@ -8,7 +8,7 @@ from ..types import UNSET, Unset -from ..models.custom_action_registration_request_type import CustomActionRegistrationRequestType +from ..models.action_registration_type import ActionRegistrationType from ..types import UNSET, Unset @@ -16,28 +16,28 @@ -T = TypeVar("T", bound="CustomActionRegistrationRequest") +T = TypeVar("T", bound="ActionRegistration") @_attrs_define -class CustomActionRegistrationRequest: +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. - type_ (CustomActionRegistrationRequestType | Unset): Context/location of the action within the application. - For now only PanelBrowserAction is supported and will be set regardless of provided value. """ id: str name: str + type_: ActionRegistrationType | Unset = UNSET description: str | Unset = UNSET icon_svg: str | Unset = UNSET - type_: CustomActionRegistrationRequestType | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -49,15 +49,15 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description = self.description - - icon_svg = self.icon_svg - 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) @@ -65,12 +65,12 @@ def to_dict(self) -> dict[str, Any]: "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 - if type_ is not UNSET: - field_dict["type"] = type_ return field_dict @@ -83,31 +83,31 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name") - description = d.pop("description", UNSET) - - icon_svg = d.pop("iconSvg", UNSET) - _type_ = d.pop("type", UNSET) - type_: CustomActionRegistrationRequestType | Unset + type_: ActionRegistrationType | Unset if isinstance(_type_, Unset): type_ = UNSET else: - type_ = CustomActionRegistrationRequestType(_type_) + type_ = ActionRegistrationType(_type_) - custom_action_registration_request = cls( + 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, - type_=type_, ) - custom_action_registration_request.additional_properties = d - return custom_action_registration_request + action_registration.additional_properties = d + return action_registration @property def additional_keys(self) -> list[str]: diff --git a/flixpy/flix/extension/extension_api/models/action_registration_response.py b/flixpy/flix/extension/extension_api/models/action_registration_response.py deleted file mode 100644 index 635c66d..0000000 --- a/flixpy/flix/extension/extension_api/models/action_registration_response.py +++ /dev/null @@ -1,125 +0,0 @@ -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_response_type import ActionRegistrationResponseType -from ..types import UNSET, Unset - - - - - - -T = TypeVar("T", bound="ActionRegistrationResponse") - - - -@_attrs_define -class ActionRegistrationResponse: - """ - Attributes: - id (str): The unique identifier for this action. - name (str): The user-friendly name for this action to be displayed in the UI. - 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. - type_ (ActionRegistrationResponseType | Unset): Context/location of the action within the application. - For now only PanelBrowserAction is supported and will be set regardless of provided value. - """ - - id: str - name: str - description: str | Unset = UNSET - icon_svg: str | Unset = UNSET - type_: ActionRegistrationResponseType | 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 - - description = self.description - - icon_svg = self.icon_svg - - type_: str | Unset = UNSET - if not isinstance(self.type_, Unset): - type_ = self.type_.value - - - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({ - "id": id, - "name": name, - }) - if description is not UNSET: - field_dict["description"] = description - if icon_svg is not UNSET: - field_dict["iconSvg"] = icon_svg - if type_ is not UNSET: - field_dict["type"] = type_ - - 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") - - description = d.pop("description", UNSET) - - icon_svg = d.pop("iconSvg", UNSET) - - _type_ = d.pop("type", UNSET) - type_: ActionRegistrationResponseType | Unset - if isinstance(_type_, Unset): - type_ = UNSET - else: - type_ = ActionRegistrationResponseType(_type_) - - - - - action_registration_response = cls( - id=id, - name=name, - description=description, - icon_svg=icon_svg, - type_=type_, - ) - - - action_registration_response.additional_properties = d - return action_registration_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_registration_response_type.py b/flixpy/flix/extension/extension_api/models/action_registration_type.py similarity index 73% rename from flixpy/flix/extension/extension_api/models/action_registration_response_type.py rename to flixpy/flix/extension/extension_api/models/action_registration_type.py index 4794bca..a91e307 100644 --- a/flixpy/flix/extension/extension_api/models/action_registration_response_type.py +++ b/flixpy/flix/extension/extension_api/models/action_registration_type.py @@ -1,7 +1,7 @@ from enum import Enum -class ActionRegistrationResponseType(str, Enum): +class ActionRegistrationType(str, Enum): PANEL_BROWSER_ACTION = "PanelBrowserAction" def __str__(self) -> str: diff --git a/flixpy/flix/extension/extension_api/models/actions_update_request.py b/flixpy/flix/extension/extension_api/models/actions_update_request.py index 3f7e90c..a4d47d0 100644 --- a/flixpy/flix/extension/extension_api/models/actions_update_request.py +++ b/flixpy/flix/extension/extension_api/models/actions_update_request.py @@ -11,7 +11,7 @@ from typing import cast if TYPE_CHECKING: - from ..models.custom_action_registration_request import CustomActionRegistrationRequest + from ..models.action_registration import ActionRegistration @@ -25,10 +25,10 @@ class ActionsUpdateRequest: """ Attributes: - actions (list[CustomActionRegistrationRequest]): List of actions to be updated for this API client. + actions (list[ActionRegistration]): List of actions to be updated for this API client. """ - actions: list[CustomActionRegistrationRequest] + actions: list[ActionRegistration] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -36,7 +36,7 @@ class ActionsUpdateRequest: def to_dict(self) -> dict[str, Any]: - from ..models.custom_action_registration_request import CustomActionRegistrationRequest # noqa: PLC0415 + from ..models.action_registration import ActionRegistration # noqa: PLC0415 actions = [] for actions_item_data in self.actions: actions_item = actions_item_data.to_dict() @@ -57,12 +57,12 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.custom_action_registration_request import CustomActionRegistrationRequest # noqa: PLC0415 + 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 = CustomActionRegistrationRequest.from_dict(actions_item_data) + actions_item = ActionRegistration.from_dict(actions_item_data) diff --git a/flixpy/flix/extension/extension_api/models/actions_update_response.py b/flixpy/flix/extension/extension_api/models/actions_update_response.py index 1b12cf9..5362bcf 100644 --- a/flixpy/flix/extension/extension_api/models/actions_update_response.py +++ b/flixpy/flix/extension/extension_api/models/actions_update_response.py @@ -11,7 +11,7 @@ from typing import cast if TYPE_CHECKING: - from ..models.action_registration_response import ActionRegistrationResponse + from ..models.action_registration import ActionRegistration @@ -25,10 +25,10 @@ class ActionsUpdateResponse: """ Attributes: - actions (list[ActionRegistrationResponse]): The list of actions registered for this API consumer's extension. + actions (list[ActionRegistration]): The list of actions registered for this API consumer's extension. """ - actions: list[ActionRegistrationResponse] + actions: list[ActionRegistration] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -36,7 +36,7 @@ class ActionsUpdateResponse: def to_dict(self) -> dict[str, Any]: - from ..models.action_registration_response import ActionRegistrationResponse # noqa: PLC0415 + from ..models.action_registration import ActionRegistration # noqa: PLC0415 actions = [] for actions_item_data in self.actions: actions_item = actions_item_data.to_dict() @@ -57,12 +57,12 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.action_registration_response import ActionRegistrationResponse # noqa: PLC0415 + 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 = ActionRegistrationResponse.from_dict(actions_item_data) + actions_item = ActionRegistration.from_dict(actions_item_data) diff --git a/flixpy/flix/extension/extension_api/models/custom_action_registration_request_type.py b/flixpy/flix/extension/extension_api/models/custom_action_registration_request_type.py deleted file mode 100644 index 164a277..0000000 --- a/flixpy/flix/extension/extension_api/models/custom_action_registration_request_type.py +++ /dev/null @@ -1,8 +0,0 @@ -from enum import Enum - - -class CustomActionRegistrationRequestType(str, Enum): - PANEL_BROWSER_ACTION = "PanelBrowserAction" - - def __str__(self) -> str: - return str(self.value) diff --git a/flixpy/flix/extension/extension_api/models/registration_request.py b/flixpy/flix/extension/extension_api/models/registration_request.py index 52ad3ec..583e85e 100644 --- a/flixpy/flix/extension/extension_api/models/registration_request.py +++ b/flixpy/flix/extension/extension_api/models/registration_request.py @@ -12,7 +12,7 @@ from typing import cast if TYPE_CHECKING: - from ..models.custom_action_registration_request import CustomActionRegistrationRequest + from ..models.action_registration import ActionRegistration @@ -30,7 +30,7 @@ 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[CustomActionRegistrationRequest] | Unset): List of actions available for this extension. + 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. @@ -41,7 +41,7 @@ class RegistrationRequest: client_uid: str version: str | Unset = UNSET log_paths: list[str] | Unset = UNSET - actions: list[CustomActionRegistrationRequest] | 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) @@ -51,7 +51,7 @@ class RegistrationRequest: def to_dict(self) -> dict[str, Any]: - from ..models.custom_action_registration_request import CustomActionRegistrationRequest # noqa: PLC0415 + from ..models.action_registration import ActionRegistration # noqa: PLC0415 name = self.name client_uid = self.client_uid @@ -101,7 +101,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.custom_action_registration_request import CustomActionRegistrationRequest # noqa: PLC0415 + from ..models.action_registration import ActionRegistration # noqa: PLC0415 d = dict(src_dict) name = d.pop("name") @@ -113,11 +113,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _actions = d.pop("actions", UNSET) - actions: list[CustomActionRegistrationRequest] | Unset = UNSET + actions: list[ActionRegistration] | Unset = UNSET if _actions is not UNSET: actions = [] for actions_item_data in _actions: - actions_item = CustomActionRegistrationRequest.from_dict(actions_item_data) + actions_item = ActionRegistration.from_dict(actions_item_data) diff --git a/flixpy/flix/extension/types.py b/flixpy/flix/extension/types.py index c9a0584..9568d54 100644 --- a/flixpy/flix/extension/types.py +++ b/flixpy/flix/extension/types.py @@ -4,11 +4,12 @@ import dataclasses import enum -from typing import TYPE_CHECKING, Any, TypeVar, 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, @@ -24,7 +25,8 @@ __all__ = [ "ActionEvent", "ActionEventPanel", - "ActionRegistrationResponse", + "ActionRegistration", + "ActionRegistrationType", "ActionState", "ActionType", "ActionsInProgress", @@ -33,7 +35,6 @@ "ClientEventType", "ClientPingEvent", "ConnectionEvent", - "CustomActionRegistrationRequest", "DownloadResponse", "Event", "OpenEvent", @@ -61,18 +62,6 @@ "VersionResponse", ] -_T = TypeVar("_T") - - -def _or_unset(value: _T | None) -> _T | Unset: - """Convert an optional value into the Unset sentinel used by the generated models.""" - return UNSET if value is None else value - - -def _none_if_unset(value: _T | Unset) -> _T | None: - """Convert the Unset sentinel used by the generated models into None.""" - return None if isinstance(value, Unset) else value - @dataclasses.dataclass class SourceFile: @@ -320,11 +309,11 @@ def from_dict(cls, event_type: str, data: models.PanelMetadataUpdateEvent) -> Se @dataclasses.dataclass class ProjectMetadata: - """Custom metadata for the entities in the currently open project. + """Combined metadata for each of the entities in the currently open project. - Each field maps metadata keys to values. A field that is None is not present: - it is left out of an update, or was not included in an event from the Flix Client. - When updating, a value of None deletes that key. + Each loaded entity in the current project has it's 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 @@ -495,7 +484,7 @@ def from_dict(cls, data: models.OpenFilePanelData) -> Self: is_animated=data.is_animated, source_file_asset_id=data.source_file.asset_id if data.source_file else None, annotation_asset_id=data.annotation_asset_id or None, - shot_id=_none_if_unset(data.shot_id), + shot_id=data.shot_id or None, ) @@ -533,7 +522,7 @@ def from_dict(cls, event_type: str, data: models.OpenFileEvent) -> Self: 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=_none_if_unset(data.action_id), + action_id=data.action_id if data.action_id else None, ) @@ -596,43 +585,32 @@ def from_model(cls, data: models.InfoResponse) -> Self: @dataclasses.dataclass -class CustomActionRegistrationRequest: - """An action that an extension asks the Flix Client to show in the Panel Browser.""" +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: models.CustomActionRegistrationRequestType | None = None + type: ActionRegistrationType | None = None - def to_model(self) -> models.CustomActionRegistrationRequest: - return models.CustomActionRegistrationRequest( + def to_model(self) -> models.ActionRegistration: + return models.ActionRegistration( id=self.id, name=self.name, - description=_or_unset(self.description), - icon_svg=_or_unset(self.icon_svg), - type=_or_unset(self.type), + description=self.description if self.description else UNSET, + icon_svg=self.icon_svg if self.icon_svg else UNSET, + type=self.type if self.type else UNSET, ) - -@dataclasses.dataclass -class ActionRegistrationResponse: - """An action as registered with the Flix Client.""" - - id: str - name: str - description: str | None - icon_svg: str | None - type: models.ActionRegistrationResponseType | None - @classmethod - def from_dict(cls, data: models.ActionRegistrationResponse) -> Self: + def from_dict(cls, data: models.ActionRegistration) -> Self: return cls( id=data.id, name=data.name, - description=_none_if_unset(data.description), - icon_svg=_none_if_unset(data.icon_svg), - type=_none_if_unset(data.type), + description=data.description if data.description else None, + icon_svg=data.icon_svg if data.icon_svg else None, + type=data.type if data.type else None, ) 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 From 348be977499b2cfe7afe7336391c2683555bda05 Mon Sep 17 00:00:00 2001 From: Ben Morton Date: Thu, 19 Nov 2026 17:19:38 +0000 Subject: [PATCH 11/23] [FLIX-282](Story) Update to mark metadata as optional in project details Add Flix version requirement to newer GRCAPI functionality --- flixpy/flix/extension/client.py | 13 +++++- flixpy/flix/extension/extension_api.yaml | 4 -- .../models/episode_details_dto.py | 41 +++++++++++------- .../models/sequence_details_dto.py | 43 +++++++++++-------- .../models/sequence_revision_details_dto.py | 43 +++++++++++-------- .../extension_api/models/show_details_dto.py | 41 +++++++++++------- flixpy/flix/extension/types.py | 17 +++++--- 7 files changed, 124 insertions(+), 78 deletions(-) diff --git a/flixpy/flix/extension/client.py b/flixpy/flix/extension/client.py index 35664c4..08aa769 100644 --- a/flixpy/flix/extension/client.py +++ b/flixpy/flix/extension/client.py @@ -587,6 +587,8 @@ async def set_actions( ) -> 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. @@ -624,6 +626,8 @@ async def get_panels( 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. @@ -661,6 +665,8 @@ async def update_panel_metadata( 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. @@ -732,7 +738,10 @@ async def untrack_panel(self, *, show_id: int, sequence_id: int, panel_id: int) ) async def get_project_metadata(self) -> types.ProjectMetadata: - """Get the custom metadata of the show, episode, sequence and sequence revision.""" + """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( @@ -751,6 +760,8 @@ async def update_project_metadata(self, metadata: types.ProjectMetadata) -> None 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. """ diff --git a/flixpy/flix/extension/extension_api.yaml b/flixpy/flix/extension/extension_api.yaml index 365d397..b4d4fc6 100644 --- a/flixpy/flix/extension/extension_api.yaml +++ b/flixpy/flix/extension/extension_api.yaml @@ -1125,7 +1125,6 @@ components: description: The configured default aspect ratio for the sequence. required: - id - - metadata - trackingCode - title - aspectRatio @@ -1165,7 +1164,6 @@ components: description: The episode's display title. required: - id - - metadata - trackingCode - createdDate - owner @@ -1208,7 +1206,6 @@ components: description: The aspect ratio used by the sequence. required: - id - - metadata - trackingCode - createdDate - owner @@ -1254,7 +1251,6 @@ components: type: string required: - id - - metadata - createdDate - owner - published 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 ddb69fa..04d6373 100644 --- a/flixpy/flix/extension/extension_api/models/episode_details_dto.py +++ b/flixpy/flix/extension/extension_api/models/episode_details_dto.py @@ -8,6 +8,7 @@ from ..types import UNSET, Unset +from ..types import UNSET, Unset from typing import cast import datetime @@ -27,25 +28,25 @@ class EpisodeDetailsDto: """ Attributes: id (int): The Flix identifier for the episode. - metadata (EpisodeDetailsDtoMetadata): Arbitrary key-value metadata to merge into the entity. Each value must be - a string, or `null` to delete that key. + tracking_code (str): The episode's tracking code. + 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}. - tracking_code (str): The episode's tracking code. - 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. """ id: int - metadata: EpisodeDetailsDtoMetadata tracking_code: str created_date: datetime.datetime owner: str title: None | str + metadata: EpisodeDetailsDtoMetadata | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -56,8 +57,6 @@ def to_dict(self) -> dict[str, Any]: from ..models.episode_details_dto_metadata import EpisodeDetailsDtoMetadata # noqa: PLC0415 id = self.id - metadata = self.metadata.to_dict() - tracking_code = self.tracking_code created_date = self.created_date.isoformat() @@ -67,17 +66,22 @@ 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) field_dict.update({ "id": id, - "metadata": metadata, "trackingCode": tracking_code, "createdDate": created_date, "owner": owner, "title": title, }) + if metadata is not UNSET: + field_dict["metadata"] = metadata return field_dict @@ -89,11 +93,6 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) id = d.pop("id") - metadata = EpisodeDetailsDtoMetadata.from_dict(d.pop("metadata")) - - - - tracking_code = d.pop("trackingCode") created_date = datetime.datetime.fromisoformat(d.pop("createdDate")) @@ -111,13 +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): + metadata = UNSET + else: + metadata = EpisodeDetailsDtoMetadata.from_dict(_metadata) + + + + episode_details_dto = cls( id=id, - metadata=metadata, tracking_code=tracking_code, created_date=created_date, owner=owner, title=title, + metadata=metadata, ) 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 d198e54..82c6222 100644 --- a/flixpy/flix/extension/extension_api/models/sequence_details_dto.py +++ b/flixpy/flix/extension/extension_api/models/sequence_details_dto.py @@ -8,6 +8,7 @@ from ..types import UNSET, Unset +from ..types import UNSET, Unset from typing import cast import datetime @@ -27,27 +28,27 @@ class SequenceDetailsDto: """ Attributes: id (int): The Flix identifier for the sequence. - metadata (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}. tracking_code (str): The sequence's tracking code. 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 - metadata: SequenceDetailsDtoMetadata tracking_code: str 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) @@ -58,8 +59,6 @@ def to_dict(self) -> dict[str, Any]: from ..models.sequence_details_dto_metadata import SequenceDetailsDtoMetadata # noqa: PLC0415 id = self.id - metadata = self.metadata.to_dict() - tracking_code = self.tracking_code created_date = self.created_date.isoformat() @@ -71,18 +70,23 @@ def to_dict(self) -> dict[str, Any]: 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) field_dict.update({ "id": id, - "metadata": metadata, "trackingCode": tracking_code, "createdDate": created_date, "owner": owner, "title": title, "aspectRatio": aspect_ratio, }) + if metadata is not UNSET: + field_dict["metadata"] = metadata return field_dict @@ -94,11 +98,6 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) id = d.pop("id") - metadata = SequenceDetailsDtoMetadata.from_dict(d.pop("metadata")) - - - - tracking_code = d.pop("trackingCode") created_date = datetime.datetime.fromisoformat(d.pop("createdDate")) @@ -118,14 +117,24 @@ def _parse_title(data: object) -> None | str: aspect_ratio = d.pop("aspectRatio") + _metadata = d.pop("metadata", UNSET) + metadata: SequenceDetailsDtoMetadata | Unset + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = SequenceDetailsDtoMetadata.from_dict(_metadata) + + + + sequence_details_dto = cls( id=id, - metadata=metadata, 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_revision_details_dto.py b/flixpy/flix/extension/extension_api/models/sequence_revision_details_dto.py index 972e011..dec0fa9 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,6 +8,7 @@ from ..types import UNSET, Unset +from ..types import UNSET, Unset from typing import cast import datetime @@ -27,28 +28,28 @@ class SequenceRevisionDetailsDto: """ Attributes: id (int): The Flix identifier for the sequence revision. - metadata (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}. created_date (datetime.datetime | None): The date the sequence revision was created. 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 - metadata: SequenceRevisionDetailsDtoMetadata created_date: datetime.datetime | None 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) @@ -59,8 +60,6 @@ def to_dict(self) -> dict[str, Any]: from ..models.sequence_revision_details_dto_metadata import SequenceRevisionDetailsDtoMetadata # noqa: PLC0415 id = self.id - metadata = self.metadata.to_dict() - created_date: None | str if isinstance(self.created_date, datetime.datetime): created_date = self.created_date.isoformat() @@ -77,18 +76,23 @@ def to_dict(self) -> dict[str, Any]: + 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({ "id": id, - "metadata": metadata, "createdDate": created_date, "owner": owner, "published": published, "comment": comment, "shotNames": shot_names, }) + if metadata is not UNSET: + field_dict["metadata"] = metadata return field_dict @@ -100,11 +104,6 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) id = d.pop("id") - metadata = SequenceRevisionDetailsDtoMetadata.from_dict(d.pop("metadata")) - - - - def _parse_created_date(data: object) -> datetime.datetime | None: if data is None: return data @@ -132,14 +131,24 @@ def _parse_created_date(data: object) -> datetime.datetime | None: shot_names = cast(list[str], d.pop("shotNames")) + _metadata = d.pop("metadata", UNSET) + metadata: SequenceRevisionDetailsDtoMetadata | Unset + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = SequenceRevisionDetailsDtoMetadata.from_dict(_metadata) + + + + sequence_revision_details_dto = cls( id=id, - metadata=metadata, 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/show_details_dto.py b/flixpy/flix/extension/extension_api/models/show_details_dto.py index 06c7bc1..56e63da 100644 --- a/flixpy/flix/extension/extension_api/models/show_details_dto.py +++ b/flixpy/flix/extension/extension_api/models/show_details_dto.py @@ -8,6 +8,7 @@ from ..types import UNSET, Unset +from ..types import UNSET, Unset from typing import cast if TYPE_CHECKING: @@ -26,25 +27,25 @@ class ShowDetailsDto: """ Attributes: id (int): The Flix identifier for the show. - metadata (ShowDetailsDtoMetadata): Arbitrary key-value metadata to merge into the entity. Each value must be a - string, or `null` to delete that key. + 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 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}. - 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 active sequence or show. - default_aspect_ratio (float): The configured default aspect ratio for the sequence. """ id: int - metadata: ShowDetailsDtoMetadata 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) @@ -55,8 +56,6 @@ def to_dict(self) -> dict[str, Any]: from ..models.show_details_dto_metadata import ShowDetailsDtoMetadata # noqa: PLC0415 id = self.id - metadata = self.metadata.to_dict() - tracking_code = self.tracking_code title: None | str @@ -66,17 +65,22 @@ def to_dict(self) -> dict[str, Any]: 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) field_dict.update({ "id": id, - "metadata": metadata, "trackingCode": tracking_code, "title": title, "aspectRatio": aspect_ratio, "defaultAspectRatio": default_aspect_ratio, }) + if metadata is not UNSET: + field_dict["metadata"] = metadata return field_dict @@ -88,11 +92,6 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) id = d.pop("id") - metadata = ShowDetailsDtoMetadata.from_dict(d.pop("metadata")) - - - - tracking_code = d.pop("trackingCode") def _parse_title(data: object) -> None | str: @@ -107,13 +106,23 @@ def _parse_title(data: object) -> None | str: default_aspect_ratio = d.pop("defaultAspectRatio") + _metadata = d.pop("metadata", UNSET) + metadata: ShowDetailsDtoMetadata | Unset + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = ShowDetailsDtoMetadata.from_dict(_metadata) + + + + show_details_dto = cls( id=id, - metadata=metadata, tracking_code=tracking_code, title=title, aspect_ratio=aspect_ratio, default_aspect_ratio=default_aspect_ratio, + metadata=metadata, ) diff --git a/flixpy/flix/extension/types.py b/flixpy/flix/extension/types.py index 9568d54..eec4250 100644 --- a/flixpy/flix/extension/types.py +++ b/flixpy/flix/extension/types.py @@ -98,7 +98,7 @@ def from_model(cls, data: models.ProjectDetailsDto) -> Self: tracking_code=data.show.tracking_code, aspect_ratio=data.show.aspect_ratio, title=data.show.title or "", - metadata=data.show.metadata.to_dict(), + metadata=data.show.metadata.to_dict() if data.show.metadata else None, _client=None, ) @@ -109,7 +109,7 @@ def from_model(cls, data: models.ProjectDetailsDto) -> Self: 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(), + metadata=data.episode.metadata.to_dict() if data.episode.metadata else None, _show=show, _client=None, ) @@ -121,7 +121,7 @@ def from_model(cls, data: models.ProjectDetailsDto) -> Self: 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(), + metadata=data.sequence.metadata.to_dict() if data.sequence.metadata else None, _show=show, _episode=episode, _client=None, @@ -133,7 +133,7 @@ def from_model(cls, data: models.ProjectDetailsDto) -> Self: published=rev.published, comment=rev.comment or "", created_date=rev.created_date, - metadata=rev.metadata.to_dict(), + 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, @@ -360,15 +360,18 @@ def from_dict(cls, event_type: str, data: models.ProjectMetadataUpdateEvent) -> type=event_type, success=data.success, metadata=ProjectMetadata( - show=None if isinstance(data.show, Unset) else data.show.metadata.to_dict(), + 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) + if isinstance(data.episode, Unset) or isinstance(data.episode.metadata, Unset) else data.episode.metadata.to_dict(), sequence=None - if isinstance(data.sequence, Unset) + 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, From 87ec806599e42f5cdeb9de123baa0bb827f0e870 Mon Sep 17 00:00:00 2001 From: Ben Morton Date: Fri, 20 Nov 2026 20:43:13 +0000 Subject: [PATCH 12/23] [FLIX-282](Story) Code review feedback --- flixpy/flix/extension/client.py | 6 +----- flixpy/flix/extension/types.py | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/flixpy/flix/extension/client.py b/flixpy/flix/extension/client.py index 08aa769..62a92d0 100644 --- a/flixpy/flix/extension/client.py +++ b/flixpy/flix/extension/client.py @@ -51,11 +51,7 @@ def _query_ids(ids: Iterable[int] | None) -> str | api_types.Unset: if ids is None: return api_types.UNSET - panel_ids = [str(panel_id) for panel_id in ids] - if len(panel_ids) == 0: - return api_types.UNSET - - return ",".join(panel_ids) + return ",".join(map(str, ids)) or api_types.UNSET def _query_range(panel_range: tuple[int, int] | None) -> str | api_types.Unset: diff --git a/flixpy/flix/extension/types.py b/flixpy/flix/extension/types.py index eec4250..952b0a2 100644 --- a/flixpy/flix/extension/types.py +++ b/flixpy/flix/extension/types.py @@ -311,7 +311,7 @@ def from_dict(cls, event_type: str, data: models.PanelMetadataUpdateEvent) -> Se class ProjectMetadata: """Combined metadata for each of the entities in the currently open project. - Each loaded entity in the current project has it's metadata mapped into a dictionary under the + 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. """ From e888331e5781070547e8ea24cbcd90736debdd47 Mon Sep 17 00:00:00 2001 From: Ben Morton Date: Mon, 23 Nov 2026 17:10:41 +0000 Subject: [PATCH 13/23] [FLIX-282](Story) Update to support null values for panel details origin SBP field --- flixpy/flix/extension/extension_api.yaml | 1 + .../extension_api/models/__init__.py | 4 +-- .../models/panel_revision_details_dto.py | 33 ++++++++++++++----- ...revision_details_dto_origin_sbp_type_0.py} | 10 +++--- flixpy/flix/extension/types.py | 4 +-- 5 files changed, 35 insertions(+), 17 deletions(-) rename flixpy/flix/extension/extension_api/models/{panel_revision_details_dto_origin_sbp.py => panel_revision_details_dto_origin_sbp_type_0.py} (81%) diff --git a/flixpy/flix/extension/extension_api.yaml b/flixpy/flix/extension/extension_api.yaml index b4d4fc6..33e89d8 100644 --- a/flixpy/flix/extension/extension_api.yaml +++ b/flixpy/flix/extension/extension_api.yaml @@ -1665,6 +1665,7 @@ components: 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. diff --git a/flixpy/flix/extension/extension_api/models/__init__.py b/flixpy/flix/extension/extension_api/models/__init__.py index 272de69..8e6cbe2 100644 --- a/flixpy/flix/extension/extension_api/models/__init__.py +++ b/flixpy/flix/extension/extension_api/models/__init__.py @@ -38,7 +38,7 @@ 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 import PanelRevisionDetailsDtoOriginSbp +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 @@ -156,7 +156,7 @@ "PanelRequestSourceFile", "PanelRevisionDetailsDto", "PanelRevisionDetailsDtoMetadata", - "PanelRevisionDetailsDtoOriginSbp", + "PanelRevisionDetailsDtoOriginSbpType0", "PanelSelectionResponse", "PanelTrackRequest", "PanelUpdateMetadataRequest", 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 index 66de425..b6fff5e 100644 --- a/flixpy/flix/extension/extension_api/models/panel_revision_details_dto.py +++ b/flixpy/flix/extension/extension_api/models/panel_revision_details_dto.py @@ -14,7 +14,7 @@ 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 import PanelRevisionDetailsDtoOriginSbp + from ..models.panel_revision_details_dto_origin_sbp_type_0 import PanelRevisionDetailsDtoOriginSbpType0 @@ -52,8 +52,8 @@ class PanelRevisionDetailsDto: 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. - origin_sbp (PanelRevisionDetailsDtoOriginSbp): Contains information about panel revisions imported from - Storyboard Pro. + origin_sbp (None | 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. keyframes (list[KeyframeDto]): The camera move keyframes on this panel revisions. origin (str): Where the panel comes from e.g. "manual import". @@ -76,7 +76,7 @@ class PanelRevisionDetailsDto: duration: float layer_transform: bool dialogue: str - origin_sbp: PanelRevisionDetailsDtoOriginSbp + origin_sbp: None | PanelRevisionDetailsDtoOriginSbpType0 keyframes: list[KeyframeDto] origin: str shot_name: str @@ -89,7 +89,7 @@ class PanelRevisionDetailsDto: 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 import PanelRevisionDetailsDtoOriginSbp # 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 @@ -122,7 +122,11 @@ def to_dict(self) -> dict[str, Any]: dialogue = self.dialogue - origin_sbp = self.origin_sbp.to_dict() + origin_sbp: dict[str, Any] | None + if isinstance(self.origin_sbp, PanelRevisionDetailsDtoOriginSbpType0): + origin_sbp = self.origin_sbp.to_dict() + else: + origin_sbp = self.origin_sbp keyframes = [] for keyframes_item_data in self.keyframes: @@ -169,7 +173,7 @@ def to_dict(self) -> dict[str, Any]: 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 import PanelRevisionDetailsDtoOriginSbp # 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") @@ -212,10 +216,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: dialogue = d.pop("dialogue") - origin_sbp = PanelRevisionDetailsDtoOriginSbp.from_dict(d.pop("originSbp")) + def _parse_origin_sbp(data: object) -> None | PanelRevisionDetailsDtoOriginSbpType0: + if data is None: + 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, data) + + origin_sbp = _parse_origin_sbp(d.pop("originSbp")) + keyframes = [] _keyframes = d.pop("keyframes") diff --git a/flixpy/flix/extension/extension_api/models/panel_revision_details_dto_origin_sbp.py b/flixpy/flix/extension/extension_api/models/panel_revision_details_dto_origin_sbp_type_0.py similarity index 81% rename from flixpy/flix/extension/extension_api/models/panel_revision_details_dto_origin_sbp.py rename to flixpy/flix/extension/extension_api/models/panel_revision_details_dto_origin_sbp_type_0.py index f9378ff..d047da5 100644 --- a/flixpy/flix/extension/extension_api/models/panel_revision_details_dto_origin_sbp.py +++ b/flixpy/flix/extension/extension_api/models/panel_revision_details_dto_origin_sbp_type_0.py @@ -14,12 +14,12 @@ -T = TypeVar("T", bound="PanelRevisionDetailsDtoOriginSbp") +T = TypeVar("T", bound="PanelRevisionDetailsDtoOriginSbpType0") @_attrs_define -class PanelRevisionDetailsDtoOriginSbp: +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. @@ -43,12 +43,12 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - panel_revision_details_dto_origin_sbp = cls( + panel_revision_details_dto_origin_sbp_type_0 = cls( ) - panel_revision_details_dto_origin_sbp.additional_properties = d - return panel_revision_details_dto_origin_sbp + 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]: diff --git a/flixpy/flix/extension/types.py b/flixpy/flix/extension/types.py index 952b0a2..457c501 100644 --- a/flixpy/flix/extension/types.py +++ b/flixpy/flix/extension/types.py @@ -636,7 +636,7 @@ class PanelRevisionDetails: trim_out_frame: int layer_transform: bool dialogue: str - origin_sbp: dict[str, str] + origin_sbp: dict[str, str] | None keyframes: list[dict[str, Any]] origin: str shot_name: str @@ -660,7 +660,7 @@ def from_dict(cls, data: models.PanelRevisionDetailsDto) -> Self: trim_out_frame=data.trim_out_frame, layer_transform=data.layer_transform, dialogue=data.dialogue, - origin_sbp=data.origin_sbp.to_dict(), + 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, From d1c105d69261e81a75724481551a3a547708a9ba Mon Sep 17 00:00:00 2001 From: Ben Morton Date: Tue, 24 Nov 2026 15:08:48 +0000 Subject: [PATCH 14/23] [FLIX-282](Story) Fix lint and type errors after rebase --- flixpy/flix/extension/client.py | 16 +++++++------- .../event_controller_handle_connection.py | 2 +- flixpy/flix/extension/types.py | 22 +++++++++---------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/flixpy/flix/extension/client.py b/flixpy/flix/extension/client.py index 62a92d0..be52627 100644 --- a/flixpy/flix/extension/client.py +++ b/flixpy/flix/extension/client.py @@ -169,7 +169,7 @@ class Extension: ``` """ - def __init__( + def __init__( # noqa: PLR0917 self, name: str, client_uid: str, @@ -485,7 +485,7 @@ 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, @@ -512,7 +512,7 @@ async def import_panels( panel_controller_update, ) - json_body = models.BulkPanelRequest( + body = models.BulkPanelRequest( paths=paths, origin=origin, source_file=models.PanelRequestSourceFile( @@ -530,14 +530,14 @@ async def import_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 ), ) @@ -600,7 +600,7 @@ async def set_actions( models.ActionsUpdateResponse, await registration_controller_set_client_actions.asyncio_detailed( client=await self._get_registered_client(), - json_body=models.ActionsUpdateRequest( + body=models.ActionsUpdateRequest( actions=[action.to_model() for action in actions], ), ), @@ -680,7 +680,7 @@ async def update_panel_metadata( models.PanelUpdateMetadataResponse, await panel_controller_update_metadata.asyncio_detailed( client=await self._get_registered_client(), - json_body=models.PanelUpdateMetadataRequest( + body=models.PanelUpdateMetadataRequest( metadata=models.PanelUpdateMetadataRequestMetadata.from_dict(dict(metadata)), ), selected=selected, @@ -767,7 +767,7 @@ async def update_project_metadata(self, metadata: types.ProjectMetadata) -> None resp = await project_metadata_controller_update_metadata.asyncio_detailed( client=await self._get_registered_client(), - json_body=metadata.to_model(), + body=metadata.to_model(), ) _assert_ok(resp) 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 index db9ca8d..079f502 100644 --- 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 @@ -53,7 +53,7 @@ def _get_kwargs( def _parse_response(*, client: AuthenticatedClient | Client, response: httpx2.Response) -> SSEEvent | None: if response.status_code == 200: - response_200 = SSEEvent.from_dict(response.text) + response_200 = SSEEvent.from_dict(response.json()) diff --git a/flixpy/flix/extension/types.py b/flixpy/flix/extension/types.py index 457c501..1d251d2 100644 --- a/flixpy/flix/extension/types.py +++ b/flixpy/flix/extension/types.py @@ -20,7 +20,7 @@ from .extension_api.types import UNSET, Unset if TYPE_CHECKING: - import datetime + import datetime as dt __all__ = [ "ActionEvent", @@ -525,7 +525,7 @@ def from_dict(cls, event_type: str, data: models.OpenFileEvent) -> Self: 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 if data.action_id else None, + action_id=data.action_id or None, ) @@ -595,15 +595,15 @@ class ActionRegistration: name: str description: str | None = None icon_svg: str | None = None - type: ActionRegistrationType | None = None + type_: ActionRegistrationType | None = None def to_model(self) -> models.ActionRegistration: return models.ActionRegistration( id=self.id, name=self.name, - description=self.description if self.description else UNSET, - icon_svg=self.icon_svg if self.icon_svg else UNSET, - type=self.type if self.type else UNSET, + description=self.description or UNSET, + icon_svg=self.icon_svg or UNSET, + type_=self.type_ or UNSET, ) @classmethod @@ -611,9 +611,9 @@ def from_dict(cls, data: models.ActionRegistration) -> Self: return cls( id=data.id, name=data.name, - description=data.description if data.description else None, - icon_svg=data.icon_svg if data.icon_svg else None, - type=data.type if data.type else None, + description=data.description or None, + icon_svg=data.icon_svg or None, + type_=data.type_ or None, ) @@ -625,8 +625,8 @@ class PanelRevisionDetails: revision_id: int panel_position: int asset_id: int - created_date: datetime.datetime - revision_date: datetime.datetime + created_date: dt.datetime + revision_date: dt.datetime owner: str show_id: int sequence_id: int From 0229faf79192d4c66b2b726942314b4627e655fa Mon Sep 17 00:00:00 2001 From: Ben Morton Date: Tue, 24 Nov 2026 15:27:29 +0000 Subject: [PATCH 15/23] [FLIX-282](Story) Add workaround for SSE endpoint --- flixpy/flix/extension/extension_api_config.yaml | 2 ++ 1 file changed, 2 insertions(+) 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 From 9143d904f2438b00a35706301973e826ea6b739d Mon Sep 17 00:00:00 2001 From: Ben Morton Date: Wed, 25 Nov 2026 17:35:04 +0000 Subject: [PATCH 16/23] [FLIX-282](Story) Add template override to workaround nullable values fields in the extension schema Update schema to set not required on nullable values --- flixpy/flix/extension/extension_api.yaml | 33 ++++----- .../models/action_event_panel_response.py | 2 +- .../models/action_registration.py | 2 +- .../models/bulk_panel_request.py | 2 +- .../models/episode_details_dto.py | 2 +- .../models/full_panel_request.py | 2 +- .../extension_api/models/keyframe_dto.py | 2 +- .../extension_api/models/open_file_event.py | 2 +- .../models/open_file_panel_data.py | 20 +++-- .../models/panel_request_item.py | 4 +- .../models/panel_revision_details_dto.py | 64 ++++++++-------- .../models/project_details_dto.py | 73 ++++++++++++++----- .../models/project_details_metadata_dto.py | 8 +- .../models/project_metadata_update_event.py | 8 +- .../models/sequence_details_dto.py | 2 +- .../models/sequence_revision_details_dto.py | 2 +- .../extension_api/models/show_details_dto.py | 2 +- .../property_macros.py.jinja | 12 +++ flixpy/flix/extension/types.py | 32 ++++++-- 19 files changed, 173 insertions(+), 101 deletions(-) create mode 100644 flixpy/flix/extension/extension_api_templates/property_templates/property_macros.py.jinja diff --git a/flixpy/flix/extension/extension_api.yaml b/flixpy/flix/extension/extension_api.yaml index 33e89d8..db13c7c 100644 --- a/flixpy/flix/extension/extension_api.yaml +++ b/flixpy/flix/extension/extension_api.yaml @@ -978,17 +978,17 @@ components: type: integer assetId: type: integer + sourceFile: + nullable: true + type: object + allOf: + - $ref: '#/components/schemas/OpenSourceFileData' annotationAssetId: type: integer shotId: type: integer isAnimated: type: boolean - sourceFile: - nullable: true - type: object - allOf: - - $ref: '#/components/schemas/OpenSourceFileData' dialogue: type: string originSbp: @@ -1005,7 +1005,6 @@ components: - revisionId - assetId - isAnimated - - sourceFile PsConfiguration: type: object properties: @@ -1625,6 +1624,14 @@ components: 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: @@ -1661,14 +1668,6 @@ components: dialogue: type: string description: This dialogue associated with this 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. keyframes: description: The camera move keyframes on this panel revisions. type: array @@ -1697,7 +1696,6 @@ components: - duration - layerTransform - dialogue - - originSbp - keyframes - origin - shotName @@ -1890,11 +1888,6 @@ components: type: object allOf: - $ref: '#/components/schemas/SequenceRevisionDetailsDto' - required: - - show - - episode - - sequence - - sequenceRevision PanelSelectionResponse: type: object properties: 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 index fa1c1bf..4b868ca 100644 --- a/flixpy/flix/extension/extension_api/models/action_event_panel_response.py +++ b/flixpy/flix/extension/extension_api/models/action_event_panel_response.py @@ -82,7 +82,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _metadata = d.pop("metadata", UNSET) metadata: ActionEventPanelResponseMetadata | Unset - if isinstance(_metadata, Unset): + if isinstance(_metadata, Unset) or _metadata is None: metadata = UNSET else: metadata = ActionEventPanelResponseMetadata.from_dict(_metadata) diff --git a/flixpy/flix/extension/extension_api/models/action_registration.py b/flixpy/flix/extension/extension_api/models/action_registration.py index 9852adb..ad55008 100644 --- a/flixpy/flix/extension/extension_api/models/action_registration.py +++ b/flixpy/flix/extension/extension_api/models/action_registration.py @@ -85,7 +85,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _type_ = d.pop("type", UNSET) type_: ActionRegistrationType | Unset - if isinstance(_type_, Unset): + if isinstance(_type_, Unset) or _type_ is None: type_ = UNSET else: type_ = ActionRegistrationType(_type_) 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 18684b8..72089d2 100644 --- a/flixpy/flix/extension/extension_api/models/bulk_panel_request.py +++ b/flixpy/flix/extension/extension_api/models/bulk_panel_request.py @@ -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/episode_details_dto.py b/flixpy/flix/extension/extension_api/models/episode_details_dto.py index 04d6373..0277c61 100644 --- a/flixpy/flix/extension/extension_api/models/episode_details_dto.py +++ b/flixpy/flix/extension/extension_api/models/episode_details_dto.py @@ -112,7 +112,7 @@ def _parse_title(data: object) -> None | str: _metadata = d.pop("metadata", UNSET) metadata: EpisodeDetailsDtoMetadata | Unset - if isinstance(_metadata, Unset): + if isinstance(_metadata, Unset) or _metadata is None: metadata = UNSET else: metadata = EpisodeDetailsDtoMetadata.from_dict(_metadata) 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 index 0a37d92..9e2e3bd 100644 --- a/flixpy/flix/extension/extension_api/models/keyframe_dto.py +++ b/flixpy/flix/extension/extension_api/models/keyframe_dto.py @@ -120,7 +120,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _viewport = d.pop("viewport", UNSET) viewport: ViewportDto | Unset - if isinstance(_viewport, Unset): + if isinstance(_viewport, Unset) or _viewport is None: viewport = UNSET else: viewport = ViewportDto.from_dict(_viewport) 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 fa8dceb..35d375b 100644 --- a/flixpy/flix/extension/extension_api/models/open_file_event.py +++ b/flixpy/flix/extension/extension_api/models/open_file_event.py @@ -125,7 +125,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _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) 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 8b231ad..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 @@ -33,7 +33,7 @@ class OpenFilePanelData: revision_id (int): asset_id (int): is_animated (bool): - source_file (OpenSourceFileData): + source_file (OpenSourceFileData | Unset): annotation_asset_id (int | Unset): shot_id (int | Unset): dialogue (str | Unset): @@ -47,7 +47,7 @@ class OpenFilePanelData: revision_id: int asset_id: int is_animated: bool - source_file: OpenSourceFileData + source_file: OpenSourceFileData | Unset = UNSET annotation_asset_id: int | Unset = UNSET shot_id: int | Unset = UNSET dialogue: str | Unset = UNSET @@ -74,7 +74,9 @@ def to_dict(self) -> dict[str, Any]: is_animated = self.is_animated - source_file = self.source_file.to_dict() + source_file: dict[str, Any] | Unset = UNSET + if not isinstance(self.source_file, Unset): + source_file = self.source_file.to_dict() annotation_asset_id = self.annotation_asset_id @@ -106,8 +108,9 @@ def to_dict(self) -> dict[str, Any]: "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: @@ -141,7 +144,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: is_animated = d.pop("isAnimated") - source_file = OpenSourceFileData.from_dict(d.pop("sourceFile")) + _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) @@ -154,7 +162,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _origin_sbp = d.pop("originSbp", UNSET) origin_sbp: OpenFilePanelDataOriginSbp | Unset - if isinstance(_origin_sbp, Unset): + if isinstance(_origin_sbp, Unset) or _origin_sbp is None: origin_sbp = UNSET else: origin_sbp = OpenFilePanelDataOriginSbp.from_dict(_origin_sbp) 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 8647ad8..fffc690 100644 --- a/flixpy/flix/extension/extension_api/models/panel_request_item.py +++ b/flixpy/flix/extension/extension_api/models/panel_request_item.py @@ -166,7 +166,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _metadata = d.pop("metadata", UNSET) metadata: PanelRequestItemMetadata | Unset - if isinstance(_metadata, Unset): + if isinstance(_metadata, Unset) or _metadata is None: metadata = UNSET else: metadata = PanelRequestItemMetadata.from_dict(_metadata) @@ -188,7 +188,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _origin_sbp = d.pop("originSbp", UNSET) origin_sbp: PanelRequestItemOriginSbp | Unset - if isinstance(_origin_sbp, Unset): + if isinstance(_origin_sbp, Unset) or _origin_sbp is None: origin_sbp = UNSET else: origin_sbp = PanelRequestItemOriginSbp.from_dict(_origin_sbp) 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 index b6fff5e..afbedb7 100644 --- a/flixpy/flix/extension/extension_api/models/panel_revision_details_dto.py +++ b/flixpy/flix/extension/extension_api/models/panel_revision_details_dto.py @@ -8,6 +8,7 @@ from ..types import UNSET, Unset +from ..types import UNSET, Unset from typing import cast import datetime @@ -52,12 +53,12 @@ class PanelRevisionDetailsDto: 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. - origin_sbp (None | 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. 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 @@ -76,10 +77,10 @@ class PanelRevisionDetailsDto: duration: float layer_transform: bool dialogue: str - origin_sbp: None | PanelRevisionDetailsDtoOriginSbpType0 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) @@ -122,12 +123,6 @@ def to_dict(self) -> dict[str, Any]: dialogue = self.dialogue - origin_sbp: dict[str, Any] | None - if isinstance(self.origin_sbp, PanelRevisionDetailsDtoOriginSbpType0): - origin_sbp = self.origin_sbp.to_dict() - else: - origin_sbp = self.origin_sbp - keyframes = [] for keyframes_item_data in self.keyframes: keyframes_item = keyframes_item_data.to_dict() @@ -139,6 +134,14 @@ def to_dict(self) -> dict[str, Any]: 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) @@ -159,11 +162,12 @@ def to_dict(self) -> dict[str, Any]: "duration": duration, "layerTransform": layer_transform, "dialogue": dialogue, - "originSbp": origin_sbp, "keyframes": keyframes, "origin": origin, "shotName": shot_name, }) + if origin_sbp is not UNSET: + field_dict["originSbp"] = origin_sbp return field_dict @@ -216,9 +220,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: dialogue = d.pop("dialogue") - def _parse_origin_sbp(data: object) -> None | PanelRevisionDetailsDtoOriginSbpType0: + 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() @@ -229,25 +249,11 @@ def _parse_origin_sbp(data: object) -> None | PanelRevisionDetailsDtoOriginSbpTy return origin_sbp_type_0 except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | PanelRevisionDetailsDtoOriginSbpType0, data) - - origin_sbp = _parse_origin_sbp(d.pop("originSbp")) + return cast(None | PanelRevisionDetailsDtoOriginSbpType0 | Unset, data) - - keyframes = [] - _keyframes = d.pop("keyframes") - for keyframes_item_data in (_keyframes): - keyframes_item = KeyframeDto.from_dict(keyframes_item_data) + origin_sbp = _parse_origin_sbp(d.pop("originSbp", UNSET)) - - keyframes.append(keyframes_item) - - - origin = d.pop("origin") - - shot_name = d.pop("shotName") - panel_revision_details_dto = cls( panel_id=panel_id, revision_id=revision_id, @@ -265,10 +271,10 @@ def _parse_origin_sbp(data: object) -> None | PanelRevisionDetailsDtoOriginSbpTy duration=duration, layer_transform=layer_transform, dialogue=dialogue, - origin_sbp=origin_sbp, keyframes=keyframes, origin=origin, shot_name=shot_name, + origin_sbp=origin_sbp, ) 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 249b312..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 (ShowDetailsDto): - episode (EpisodeDetailsDto): - sequence (SequenceDetailsDto): - sequence_revision (SequenceRevisionDetailsDto): + show (ShowDetailsDto | Unset): + episode (EpisodeDetailsDto | Unset): + sequence (SequenceDetailsDto | Unset): + sequence_revision (SequenceRevisionDetailsDto | Unset): """ - show: ShowDetailsDto - episode: EpisodeDetailsDto - sequence: SequenceDetailsDto - sequence_revision: 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,23 +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 = self.show.to_dict() + show: dict[str, Any] | Unset = UNSET + if not isinstance(self.show, Unset): + show = self.show.to_dict() - episode = self.episode.to_dict() + episode: dict[str, Any] | Unset = UNSET + if not isinstance(self.episode, Unset): + episode = self.episode.to_dict() - sequence = self.sequence.to_dict() + sequence: dict[str, Any] | Unset = UNSET + if not isinstance(self.sequence, Unset): + sequence = self.sequence.to_dict() - sequence_revision = self.sequence_revision.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({ - "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 @@ -78,22 +91,42 @@ 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) - show = ShowDetailsDto.from_dict(d.pop("show")) + _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 = EpisodeDetailsDto.from_dict(d.pop("episode")) + _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 = SequenceDetailsDto.from_dict(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) - sequence_revision = SequenceRevisionDetailsDto.from_dict(d.pop("sequenceRevision")) + _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) 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 index 54468a2..326517f 100644 --- a/flixpy/flix/extension/extension_api/models/project_details_metadata_dto.py +++ b/flixpy/flix/extension/extension_api/models/project_details_metadata_dto.py @@ -117,7 +117,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _show = d.pop("show", UNSET) show: ProjectDetailsMetadataDtoShow | Unset - if isinstance(_show, Unset): + if isinstance(_show, Unset) or _show is None: show = UNSET else: show = ProjectDetailsMetadataDtoShow.from_dict(_show) @@ -127,7 +127,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _episode = d.pop("episode", UNSET) episode: ProjectDetailsMetadataDtoEpisode | Unset - if isinstance(_episode, Unset): + if isinstance(_episode, Unset) or _episode is None: episode = UNSET else: episode = ProjectDetailsMetadataDtoEpisode.from_dict(_episode) @@ -137,7 +137,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _sequence = d.pop("sequence", UNSET) sequence: ProjectDetailsMetadataDtoSequence | Unset - if isinstance(_sequence, Unset): + if isinstance(_sequence, Unset) or _sequence is None: sequence = UNSET else: sequence = ProjectDetailsMetadataDtoSequence.from_dict(_sequence) @@ -147,7 +147,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _sequence_revision = d.pop("sequenceRevision", UNSET) sequence_revision: ProjectDetailsMetadataDtoSequenceRevision | Unset - if isinstance(_sequence_revision, Unset): + if isinstance(_sequence_revision, Unset) or _sequence_revision is None: sequence_revision = UNSET else: sequence_revision = ProjectDetailsMetadataDtoSequenceRevision.from_dict(_sequence_revision) 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 index 7449d56..8550228 100644 --- a/flixpy/flix/extension/extension_api/models/project_metadata_update_event.py +++ b/flixpy/flix/extension/extension_api/models/project_metadata_update_event.py @@ -100,7 +100,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _show = d.pop("show", UNSET) show: ShowDetailsDto | Unset - if isinstance(_show, Unset): + if isinstance(_show, Unset) or _show is None: show = UNSET else: show = ShowDetailsDto.from_dict(_show) @@ -110,7 +110,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _episode = d.pop("episode", UNSET) episode: EpisodeDetailsDto | Unset - if isinstance(_episode, Unset): + if isinstance(_episode, Unset) or _episode is None: episode = UNSET else: episode = EpisodeDetailsDto.from_dict(_episode) @@ -120,7 +120,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _sequence = d.pop("sequence", UNSET) sequence: SequenceDetailsDto | Unset - if isinstance(_sequence, Unset): + if isinstance(_sequence, Unset) or _sequence is None: sequence = UNSET else: sequence = SequenceDetailsDto.from_dict(_sequence) @@ -130,7 +130,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _sequence_revision = d.pop("sequenceRevision", UNSET) sequence_revision: SequenceRevisionDetailsDto | Unset - if isinstance(_sequence_revision, Unset): + if isinstance(_sequence_revision, Unset) or _sequence_revision is None: sequence_revision = UNSET else: sequence_revision = SequenceRevisionDetailsDto.from_dict(_sequence_revision) 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 82c6222..2344622 100644 --- a/flixpy/flix/extension/extension_api/models/sequence_details_dto.py +++ b/flixpy/flix/extension/extension_api/models/sequence_details_dto.py @@ -119,7 +119,7 @@ def _parse_title(data: object) -> None | str: _metadata = d.pop("metadata", UNSET) metadata: SequenceDetailsDtoMetadata | Unset - if isinstance(_metadata, Unset): + if isinstance(_metadata, Unset) or _metadata is None: metadata = UNSET else: metadata = SequenceDetailsDtoMetadata.from_dict(_metadata) 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 dec0fa9..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 @@ -133,7 +133,7 @@ def _parse_created_date(data: object) -> datetime.datetime | None: _metadata = d.pop("metadata", UNSET) metadata: SequenceRevisionDetailsDtoMetadata | Unset - if isinstance(_metadata, Unset): + if isinstance(_metadata, Unset) or _metadata is None: metadata = UNSET else: metadata = SequenceRevisionDetailsDtoMetadata.from_dict(_metadata) 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 56e63da..af48235 100644 --- a/flixpy/flix/extension/extension_api/models/show_details_dto.py +++ b/flixpy/flix/extension/extension_api/models/show_details_dto.py @@ -108,7 +108,7 @@ def _parse_title(data: object) -> None | str: _metadata = d.pop("metadata", UNSET) metadata: ShowDetailsDtoMetadata | Unset - if isinstance(_metadata, Unset): + if isinstance(_metadata, Unset) or _metadata is None: metadata = UNSET else: metadata = ShowDetailsDtoMetadata.from_dict(_metadata) 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 1d251d2..52a0ed2 100644 --- a/flixpy/flix/extension/types.py +++ b/flixpy/flix/extension/types.py @@ -92,7 +92,7 @@ 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 not isinstance(data.show, Unset): show = flix_types.Show( show_id=data.show.id, tracking_code=data.show.tracking_code, @@ -102,7 +102,7 @@ def from_model(cls, data: models.ProjectDetailsDto) -> Self: _client=None, ) - if data.episode is not None: + if not isinstance(data.episode, Unset): episode = flix_types.Episode( episode_id=data.episode.id, tracking_code=data.episode.tracking_code, @@ -114,7 +114,7 @@ def from_model(cls, data: models.ProjectDetailsDto) -> Self: _client=None, ) - if data.sequence is not None: + if not isinstance(data.sequence, Unset): sequence = flix_types.Sequence( sequence_id=data.sequence.id, tracking_code=data.sequence.tracking_code, @@ -127,7 +127,7 @@ def from_model(cls, data: models.ProjectDetailsDto) -> Self: _client=None, ) - if (rev := data.sequence_revision) is not None: + if not isinstance((rev := data.sequence_revision), Unset): sequence_revision = flix_types.SequenceRevision( revision_number=rev.id, published=rev.published, @@ -473,21 +473,39 @@ 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, ) @@ -660,7 +678,9 @@ def from_dict(cls, data: models.PanelRevisionDetailsDto) -> Self: 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, + origin_sbp=data.origin_sbp.to_dict() + if not isinstance(data.origin_sbp, Unset) and data.origin_sbp is not None + else None, keyframes=[keyframe.to_dict() for keyframe in data.keyframes], origin=data.origin, shot_name=data.shot_name, From f5bf166da6b2c7e453f5df10ce5f544c0adf00d1 Mon Sep 17 00:00:00 2001 From: Ben Morton Date: Thu, 26 Nov 2026 15:42:55 +0000 Subject: [PATCH 17/23] [FLIX-282](Story) Simplify origin_sbp processing --- flixpy/flix/extension/types.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/flixpy/flix/extension/types.py b/flixpy/flix/extension/types.py index 52a0ed2..a721514 100644 --- a/flixpy/flix/extension/types.py +++ b/flixpy/flix/extension/types.py @@ -678,9 +678,7 @@ def from_dict(cls, data: models.PanelRevisionDetailsDto) -> Self: trim_out_frame=data.trim_out_frame, layer_transform=data.layer_transform, dialogue=data.dialogue, - origin_sbp=data.origin_sbp.to_dict() - if not isinstance(data.origin_sbp, Unset) and data.origin_sbp is not None - else None, + 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, From 10ffbdfd6b6d59a51db744e5dc4419eda9ff0c1c Mon Sep 17 00:00:00 2001 From: Ben Morton Date: Fri, 27 Nov 2026 12:03:17 +0000 Subject: [PATCH 18/23] [FLIX-282](Story) Update checks following code review --- flixpy/flix/extension/types.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flixpy/flix/extension/types.py b/flixpy/flix/extension/types.py index a721514..a9e9203 100644 --- a/flixpy/flix/extension/types.py +++ b/flixpy/flix/extension/types.py @@ -92,7 +92,7 @@ def from_model(cls, data: models.ProjectDetailsDto) -> Self: sequence: flix_types.Sequence | None = None sequence_revision: flix_types.SequenceRevision | None = None - if not isinstance(data.show, Unset): + if data.show: show = flix_types.Show( show_id=data.show.id, tracking_code=data.show.tracking_code, @@ -102,7 +102,7 @@ def from_model(cls, data: models.ProjectDetailsDto) -> Self: _client=None, ) - if not isinstance(data.episode, Unset): + if data.episode: episode = flix_types.Episode( episode_id=data.episode.id, tracking_code=data.episode.tracking_code, @@ -114,7 +114,7 @@ def from_model(cls, data: models.ProjectDetailsDto) -> Self: _client=None, ) - if not isinstance(data.sequence, Unset): + if data.sequence: sequence = flix_types.Sequence( sequence_id=data.sequence.id, tracking_code=data.sequence.tracking_code, @@ -127,7 +127,7 @@ def from_model(cls, data: models.ProjectDetailsDto) -> Self: _client=None, ) - if not isinstance((rev := data.sequence_revision), Unset): + if (rev := data.sequence_revision): sequence_revision = flix_types.SequenceRevision( revision_number=rev.id, published=rev.published, From 70d83222e42cbb582bf9c2328c06f3ecf9cf4227 Mon Sep 17 00:00:00 2001 From: Ben Morton Date: Mon, 30 Nov 2026 08:44:32 +0000 Subject: [PATCH 19/23] [FLIX-282](Story) Fix formatting error --- flixpy/flix/extension/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flixpy/flix/extension/types.py b/flixpy/flix/extension/types.py index a9e9203..28479b6 100644 --- a/flixpy/flix/extension/types.py +++ b/flixpy/flix/extension/types.py @@ -127,7 +127,7 @@ def from_model(cls, data: models.ProjectDetailsDto) -> Self: _client=None, ) - if (rev := data.sequence_revision): + if rev := data.sequence_revision: sequence_revision = flix_types.SequenceRevision( revision_number=rev.id, published=rev.published, From 52cde2c9f4a6878db88f4a106df1bca76322dde2 Mon Sep 17 00:00:00 2001 From: Ben Morton Date: Tue, 1 Dec 2026 11:11:12 +0000 Subject: [PATCH 20/23] [FLIX-282](Story) Update to cache pending actions if unable to update in the set_actions call --- flixpy/flix/extension/client.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/flixpy/flix/extension/client.py b/flixpy/flix/extension/client.py index be52627..5b6279f 100644 --- a/flixpy/flix/extension/client.py +++ b/flixpy/flix/extension/client.py @@ -212,6 +212,7 @@ def __init__( # noqa: PLR0917 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 @@ -283,6 +284,10 @@ async def _on_connect(self) -> None: # skip the online check when emitting the subscriptions after the initial connection await self.sio.emit("subscribe", data=events.to_dict()) + # update the client actions if any were set while the extension was disconnected + if self._pending_actions != None: + await self.set_actions(self._pending_actions) + async def _on_disconnect(self) -> None: logger.warning("disconnected from Flix Client") self._reset_status() @@ -389,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 we were able to register + actions = self._pending_actions or self.actions + resp = _assert_response( models.RegistrationResponse, await registration_controller_register_client.asyncio_detailed( @@ -398,7 +406,7 @@ 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 self.actions] + actions=[action.to_model() for action in actions] if self.actions else api_types.UNSET, icon_svg=self.icon_svg or api_types.UNSET, @@ -407,6 +415,9 @@ async def _get_registered_client(self) -> extension_api.AuthenticatedClient: ), ) + # 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 @@ -596,6 +607,9 @@ async def set_actions( 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( @@ -608,6 +622,7 @@ async def set_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( From 35bfdcea3eabeb894921a88826757242cfc4eb47 Mon Sep 17 00:00:00 2001 From: Ben Morton Date: Tue, 1 Dec 2026 11:14:39 +0000 Subject: [PATCH 21/23] [FLIX-282](Story) Fix linter errors --- flixpy/flix/extension/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flixpy/flix/extension/client.py b/flixpy/flix/extension/client.py index 5b6279f..9ed9ed2 100644 --- a/flixpy/flix/extension/client.py +++ b/flixpy/flix/extension/client.py @@ -285,7 +285,7 @@ async def _on_connect(self) -> None: await self.sio.emit("subscribe", data=events.to_dict()) # update the client actions if any were set while the extension was disconnected - if self._pending_actions != None: + if self._pending_actions is not None: await self.set_actions(self._pending_actions) async def _on_disconnect(self) -> None: @@ -394,7 +394,7 @@ 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 we were able to register + # tegister the pending action list, if set_actions was called before registration actions = self._pending_actions or self.actions resp = _assert_response( From 5ec2fe34216a5ef1adab28fe27bc5cb31b8616df Mon Sep 17 00:00:00 2001 From: Ben Morton Date: Tue, 1 Dec 2026 12:42:22 +0000 Subject: [PATCH 22/23] [FLIX-282](Story) Move pending actions check to status update rather than on connect --- flixpy/flix/extension/client.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flixpy/flix/extension/client.py b/flixpy/flix/extension/client.py index 9ed9ed2..db3ec0a 100644 --- a/flixpy/flix/extension/client.py +++ b/flixpy/flix/extension/client.py @@ -223,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: + 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) @@ -284,10 +288,6 @@ async def _on_connect(self) -> None: # skip the online check when emitting the subscriptions after the initial connection await self.sio.emit("subscribe", data=events.to_dict()) - # 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) - async def _on_disconnect(self) -> None: logger.warning("disconnected from Flix Client") self._reset_status() From 4373d0e8e575d59e3896887a306955cbfeb6f528 Mon Sep 17 00:00:00 2001 From: Ben Morton Date: Tue, 1 Dec 2026 13:00:35 +0000 Subject: [PATCH 23/23] [FLIX-282](Story) Add missing await --- flixpy/flix/extension/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flixpy/flix/extension/client.py b/flixpy/flix/extension/client.py index db3ec0a..2a21fb8 100644 --- a/flixpy/flix/extension/client.py +++ b/flixpy/flix/extension/client.py @@ -226,7 +226,7 @@ async def _update_status(self) -> None: # update the client actions if any were set while the extension was disconnected if self._pending_actions is not None: - self.set_actions(self._pending_actions) + 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)