From f5321f9b29083f9ea4c028e7484504875e04a758 Mon Sep 17 00:00:00 2001 From: poleli Date: Wed, 11 Sep 2024 14:48:07 +0800 Subject: [PATCH] [VideoTranslation] Initial add TypedSpec and swagger (#29572) --- cSpell.json | 8 + .../Speech.VideoTranslation/client.tsp | 13 + ...onOperations_CreateOrReplaceIteration.json | 68 ++ .../IterationOperations_GetIteration.json | 37 + .../IterationOperations_ListIteration.json | 65 + .../OperationOperations_GetOperation.json | 19 + ...Operations_CreateOrReplaceTranslation.json | 83 ++ ...anslationOperations_DeleteTranslation.json | 15 + .../TranslationOperations_GetTranslation.json | 57 + ...TranslationOperations_ListTranslation.json | 130 ++ .../Speech.VideoTranslation/main.tsp | 320 +++++ .../Speech.VideoTranslation/tspconfig.yaml | 15 + .../2024-05-20-preview/VideoTranslation.json | 1065 +++++++++++++++++ ...onOperations_CreateOrReplaceIteration.json | 68 ++ .../IterationOperations_GetIteration.json | 37 + .../IterationOperations_ListIteration.json | 65 + .../OperationOperations_GetOperation.json | 19 + ...Operations_CreateOrReplaceTranslation.json | 83 ++ ...anslationOperations_DeleteTranslation.json | 15 + .../TranslationOperations_GetTranslation.json | 57 + ...TranslationOperations_ListTranslation.json | 130 ++ .../Speech/VideoTranslation/readme.md | 24 + 22 files changed, 2393 insertions(+) create mode 100644 specification/cognitiveservices/Speech.VideoTranslation/client.tsp create mode 100644 specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/IterationOperations_CreateOrReplaceIteration.json create mode 100644 specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/IterationOperations_GetIteration.json create mode 100644 specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/IterationOperations_ListIteration.json create mode 100644 specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/OperationOperations_GetOperation.json create mode 100644 specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/TranslationOperations_CreateOrReplaceTranslation.json create mode 100644 specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/TranslationOperations_DeleteTranslation.json create mode 100644 specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/TranslationOperations_GetTranslation.json create mode 100644 specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/TranslationOperations_ListTranslation.json create mode 100644 specification/cognitiveservices/Speech.VideoTranslation/main.tsp create mode 100644 specification/cognitiveservices/Speech.VideoTranslation/tspconfig.yaml create mode 100644 specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/VideoTranslation.json create mode 100644 specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/IterationOperations_CreateOrReplaceIteration.json create mode 100644 specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/IterationOperations_GetIteration.json create mode 100644 specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/IterationOperations_ListIteration.json create mode 100644 specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/OperationOperations_GetOperation.json create mode 100644 specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/TranslationOperations_CreateOrReplaceTranslation.json create mode 100644 specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/TranslationOperations_DeleteTranslation.json create mode 100644 specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/TranslationOperations_GetTranslation.json create mode 100644 specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/TranslationOperations_ListTranslation.json create mode 100644 specification/cognitiveservices/data-plane/Speech/VideoTranslation/readme.md diff --git a/cSpell.json b/cSpell.json index 6c30e5d30d0e..e43c3b9465c8 100644 --- a/cSpell.json +++ b/cSpell.json @@ -852,6 +852,14 @@ "bicho" ] }, + { + "filename": "**/specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/VideoTranslation.json", + "words": [ + "videotranslation", + "webvtt", + "Webvtt" + ] + }, { "filename": "**/specification/network/resource-manager/Microsoft.Network/stable/**/webapplicationfirewall.json", "words": [ diff --git a/specification/cognitiveservices/Speech.VideoTranslation/client.tsp b/specification/cognitiveservices/Speech.VideoTranslation/client.tsp new file mode 100644 index 000000000000..f17e0c25f964 --- /dev/null +++ b/specification/cognitiveservices/Speech.VideoTranslation/client.tsp @@ -0,0 +1,13 @@ +import "@azure-tools/typespec-client-generator-core"; +import "@typespec/rest"; +import "@typespec/http"; +import "@typespec/versioning"; +import "./main.tsp"; + +using Azure.ClientGenerator.Core; + +@TypeSpec.Versioning.useDependency(Azure.Core.Versions.v1_0_Preview_2) +@TypeSpec.Versioning.useDependency( + Microsoft.Speech.VideoTranslation.ApiVersions.v2024_05_20_preview +) +namespace Microsoft.Speech.VideoTranslationClient; diff --git a/specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/IterationOperations_CreateOrReplaceIteration.json b/specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/IterationOperations_CreateOrReplaceIteration.json new file mode 100644 index 000000000000..a0a866d77bd2 --- /dev/null +++ b/specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/IterationOperations_CreateOrReplaceIteration.json @@ -0,0 +1,68 @@ +{ + "title": "Create Iteration", + "operationId": "IterationOperations_CreateOrReplaceIteration", + "parameters": { + "Endpoint": "https://eastus.api.cognitive.microsoft.com/", + "api-version": "2024-05-20-preview", + "translationId": "TranslateMyZhCNVideo", + "iterationId": "TranslateMyZhCNVideo-ContentEditing-2", + "Ocp-Apim-Subscription-Key": "{API Key}", + "Operation-Id": "Create-TranslateMyZhCNVideo-ContentEditing-2", + "resource": { + "description": "Fix segment duration issue and update subtitle max char.", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 60, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + } + }, + "Content-Type": "application/json" + }, + "responses": { + "200": { + "headers": { + "Operation-Location": "https://eastus.api.cognitive.microsoft.com/videotranslation/operations/Create-TranslateMyZhCNVideo-ContentEditing-2?api-version=2024-02-01-preview", + "Operation-Id": "TranslateMyZhCNVideo-ContentEditing-1" + }, + "body": { + "id": "TranslateMyZhCNVideo-ContentEditing-2", + "description": "Fix segment duration issue and update subtitle max char.", + "status": "NotStarted", + "createdDateTime": "2023-04-10T05:30:00.000Z", + "lastActionDateTime": "2023-04-10T05:15:30.000Z", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + } + } + }, + "201": { + "headers": { + "Operation-Location": "https://eastus.api.cognitive.microsoft.com/videotranslation/operations/Create-TranslateMyZhCNVideo-ContentEditing-2?api-version=2024-02-01-preview", + "Operation-Id": "TranslateMyZhCNVideo-ContentEditing-1" + }, + "body": { + "id": "TranslateMyZhCNVideo-ContentEditing-2", + "description": "Fix segment duration issue and update subtitle max char.", + "status": "NotStarted", + "createdDateTime": "2023-04-10T05:30:00.000Z", + "lastActionDateTime": "2023-04-10T05:15:30.000Z", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + } + } + } + } +} diff --git a/specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/IterationOperations_GetIteration.json b/specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/IterationOperations_GetIteration.json new file mode 100644 index 000000000000..9ba712ddc804 --- /dev/null +++ b/specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/IterationOperations_GetIteration.json @@ -0,0 +1,37 @@ +{ + "title": "Get Iteration", + "operationId": "IterationOperations_GetIteration", + "parameters": { + "Endpoint": "https://eastus.api.cognitive.microsoft.com/", + "api-version": "2024-05-20-preview", + "translationId": "TranslateMyZhCNVideo", + "Ocp-Apim-Subscription-Key": "{API Key}", + "iterationId": "TranslateMyZhCNVideo-Iteration-1" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "TranslateMyZhCNVideo-Iteration-1", + "description": "Translate video from en-US to zh-CN, fix segment issue.", + "status": "Succeeded", + "createdDateTime": "2023-04-10T05:30:00.000Z", + "lastActionDateTime": "2023-04-10T05:15:30.000Z", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + }, + "result": { + "translatedVideoFileUrl": "https://xxx.blob.core.windows.net/container1/video.mp4?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "sourceLocaleSubtitleWebvttFileUrl": "https://xxx.blob.core.windows.net/container1/sourceLocale.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "targetLocaleSubtitleWebvttFileUrl": "https://xxx.blob.core.windows.net/container1/targetLocale.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "metadataJsonWebvttFileUrl": "https://xxx.blob.core.windows.net/container1/metadataJsonLocale.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx" + } + } + } + } +} diff --git a/specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/IterationOperations_ListIteration.json b/specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/IterationOperations_ListIteration.json new file mode 100644 index 000000000000..56712fe02a7a --- /dev/null +++ b/specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/IterationOperations_ListIteration.json @@ -0,0 +1,65 @@ +{ + "title": "List Iteration", + "operationId": "IterationOperations_ListIteration", + "parameters": { + "Endpoint": "https://eastus.api.cognitive.microsoft.com/", + "api-version": "2024-05-20-preview", + "translationId": "TranslateMyZhCNVideo", + "Ocp-Apim-Subscription-Key": "{API Key}" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "id": "Initial", + "description": "Translate video from en-US to zh-CN, fix segment issue.", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + }, + "status": "Succeeded", + "createdDateTime": "2023-04-10T05:30:00.000Z", + "lastActionDateTime": "2023-04-10T05:15:30.000Z" + }, + { + "id": "TranslateMyZhCNVideo-Iteration-1", + "description": "Translate video from en-US to zh-CN.", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + }, + "status": "Failed", + "createdDateTime": "2023-04-01T05:30:00.000Z", + "lastActionDateTime": "2023-04-10T05:15:30.000Z" + }, + { + "id": "TranslateMyZhCNVideo-Iteration-2", + "description": "Translate video from en-US to zh-CN.", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + }, + "status": "Running", + "createdDateTime": "2023-04-01T05:30:00.000Z", + "lastActionDateTime": "2023-04-10T05:15:30.000Z" + } + ], + "nextLink": "https://eastus.api.cognitive.microsoft.com/video-translation/translations/TranslateMyZhCNVideo/iterations?skip=2&maxpagesize=2&api-version=2024-05-20-preview" + } + } + } +} diff --git a/specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/OperationOperations_GetOperation.json b/specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/OperationOperations_GetOperation.json new file mode 100644 index 000000000000..ce5779709faf --- /dev/null +++ b/specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/OperationOperations_GetOperation.json @@ -0,0 +1,19 @@ +{ + "title": "Get Operation", + "operationId": "OperationOperations_GetOperation", + "parameters": { + "Endpoint": "https://eastus.api.cognitive.microsoft.com/", + "api-version": "2024-05-20-preview", + "operationId": "TranslateMyZhCNVideo-DeleteTranslate", + "Ocp-Apim-Subscription-Key": "{API Key}" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "TranslateMyZhCNVideo-DeleteTranslate", + "status": "Running" + } + } + } +} diff --git a/specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/TranslationOperations_CreateOrReplaceTranslation.json b/specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/TranslationOperations_CreateOrReplaceTranslation.json new file mode 100644 index 000000000000..54ff4ec4a903 --- /dev/null +++ b/specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/TranslationOperations_CreateOrReplaceTranslation.json @@ -0,0 +1,83 @@ +{ + "title": "Create Translation", + "operationId": "TranslationOperations_CreateOrReplaceTranslation", + "parameters": { + "Endpoint": "https://eastus.api.cognitive.microsoft.com/", + "api-version": "2024-05-20-preview", + "translationId": "TranslateMyZhCNVideo", + "Ocp-Apim-Subscription-Key": "{API Key}", + "Operation-Id": "Create-TranslateMyZhCNVideo", + "resource": { + "displayName": "hello.mp4", + "description": "Translate video from en-US to zh-CN.", + "input": { + "sourceLocale": "en-US", + "targetLocale": "zh-CN", + "voiceKind": "PlatformVoice", + "videoFileUrl": "https://mystorage.blob.core.windows.net/container1/video.mp4?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx" + } + }, + "Content-Type": "application/json" + }, + "responses": { + "200": { + "headers": { + "Operation-Location": "https://eastus.api.cognitive.microsoft.com/videotranslation/operations/Create-TranslateMyZhCNVideo?api-version=2024-02-01-preview", + "Operation-Id": "Create-TranslateMyZhCNVideo" + }, + "body": { + "id": "TranslateMyZhCNVideo", + "displayName": "hello.mp4", + "description": "Translate video from en-US to zh-CN.", + "input": { + "sourceLocale": "en-US", + "targetLocale": "zh-CN", + "voiceKind": "PlatformVoice", + "videoFileUrl": "https://mystorage.blob.core.windows.net/container1/video.mp4?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx" + }, + "createdDateTime": "2023-04-01T05:30:00.000Z", + "latestIteration": { + "id": "Initial", + "status": "NotStarted", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + } + } + } + }, + "201": { + "headers": { + "Operation-Location": "https://eastus.api.cognitive.microsoft.com/videotranslation/operations/Create-TranslateMyZhCNVideo?api-version=2024-02-01-preview", + "Operation-Id": "Create-TranslateMyZhCNVideo" + }, + "body": { + "id": "TranslateMyZhCNVideo", + "description": "Translate video from en-US to zh-CN.", + "input": { + "sourceLocale": "en-US", + "targetLocale": "zh-CN", + "voiceKind": "PlatformVoice", + "videoFileUrl": "https://mystorage.blob.core.windows.net/container1/video.mp4?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx" + }, + "createdDateTime": "2023-04-01T05:30:00.000Z", + "latestIteration": { + "id": "Initial", + "status": "NotStarted", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + } + } + } + } + } +} diff --git a/specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/TranslationOperations_DeleteTranslation.json b/specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/TranslationOperations_DeleteTranslation.json new file mode 100644 index 000000000000..d93945cef517 --- /dev/null +++ b/specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/TranslationOperations_DeleteTranslation.json @@ -0,0 +1,15 @@ +{ + "title": "Delete Translation", + "operationId": "TranslationOperations_DeleteTranslation", + "parameters": { + "Endpoint": "https://eastus.api.cognitive.microsoft.com/", + "api-version": "2024-05-20-preview", + "translationId": "TranslateMyZhCNVideo", + "Ocp-Apim-Subscription-Key": "{API Key}" + }, + "responses": { + "204": { + "headers": {} + } + } +} diff --git a/specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/TranslationOperations_GetTranslation.json b/specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/TranslationOperations_GetTranslation.json new file mode 100644 index 000000000000..5f0a6095f87d --- /dev/null +++ b/specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/TranslationOperations_GetTranslation.json @@ -0,0 +1,57 @@ +{ + "title": "Get Translation", + "operationId": "TranslationOperations_GetTranslation", + "parameters": { + "Endpoint": "https://eastus.api.cognitive.microsoft.com/", + "api-version": "2024-05-20-preview", + "translationId": "TranslateMyZhCNVideo", + "Ocp-Apim-Subscription-Key": "{API Key}" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "TranslateMyZhCNVideo", + "displayName": "hello.mp4", + "description": "Translate video from en-US to zh-CN.", + "input": { + "sourceLocale": "en-US", + "targetLocale": "zh-CN", + "voiceKind": "PlatformVoice", + "videoFileUrl": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx" + }, + "createdDateTime": "2023-04-01T05:30:00.000Z", + "latestIteration": { + "id": "xxx", + "description": "Iteration1", + "status": "Running", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + } + }, + "latestSucceededIteration": { + "id": "xxx", + "description": "Iteration1", + "input": { + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + }, + "result": { + "translatedVideoFileUrl": "https://xxx.blob.core.windows.net/container1/video.mp4?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "sourceLocaleSubtitleWebvttFileUrl": "https://xxx.blob.core.windows.net/container1/sourceLocale.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "targetLocaleSubtitleWebvttFileUrl": "https://xxx.blob.core.windows.net/container1/targetLocale.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "metadataJsonWebvttFileUrl": "https://xxx.blob.core.windows.net/container1/metadataJsonLocale.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "reportFileUrl": "https://xxx.blob.core.windows.net/container1/metadataJsonLocale.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx" + } + } + } + } + } +} diff --git a/specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/TranslationOperations_ListTranslation.json b/specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/TranslationOperations_ListTranslation.json new file mode 100644 index 000000000000..3aab4250550e --- /dev/null +++ b/specification/cognitiveservices/Speech.VideoTranslation/examples/2024-05-20-preview/TranslationOperations_ListTranslation.json @@ -0,0 +1,130 @@ +{ + "title": "List translations", + "operationId": "TranslationOperations_ListTranslation", + "parameters": { + "Endpoint": "https://eastus.api.cognitive.microsoft.com/", + "api-version": "2024-05-20-preview", + "Ocp-Apim-Subscription-Key": "{API Key}" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "id": "TranslateMyZhCNVideo1", + "displayName": "hello.mp4", + "description": "Translate video from en-US to zh-CN.", + "input": { + "sourceLocale": "en-US", + "targetLocale": "zh-CN", + "voiceKind": "PlatformVoice", + "videoFileUrl": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx" + }, + "createdDateTime": "2023-04-01T05:30:00.000Z", + "latestIteration": { + "id": "TranslateMyZhCNVideo1-Edit1", + "description": "Iteration1", + "status": "Running", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + } + }, + "latestSucceededIteration": { + "id": "xxx", + "description": "Iteration1", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + } + } + }, + { + "id": "TranslateMyZhCNVideo2", + "displayName": "hello.mp4", + "description": "Translate video from en-US to zh-CN.", + "input": { + "sourceLocale": "en-US", + "targetLocale": "zh-CN", + "voiceKind": "PlatformVoice", + "videoFileUrl": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx" + }, + "createdDateTime": "2023-04-01T05:30:00.000Z", + "latestIteration": { + "id": "TranslateMyZhCNVideo2-Edit2", + "description": "Iteration1", + "status": "Failed", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + } + }, + "latestSucceededIteration": { + "id": "xxx", + "description": "Iteration1", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + } + } + }, + { + "id": "TranslateMyZhCNVideo3", + "displayName": "hello.mp4", + "description": "Translate video from en-US to zh-CN.", + "input": { + "sourceLocale": "en-US", + "targetLocale": "zh-CN", + "voiceKind": "PlatformVoice", + "videoFileUrl": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx" + }, + "createdDateTime": "2023-04-01T05:30:00.000Z", + "latestIteration": { + "id": "Initial", + "description": "Iteration1", + "status": "Completed", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + } + }, + "latestSucceededIteration": { + "id": "Initial", + "description": "Iteration1", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + } + } + } + ], + "nextLink": "https://eastus.api.cognitive.microsoft.com/video-translation/translations?skip=2&maxpagesize=2&api-version=2024-05-20-preview" + } + } + } +} diff --git a/specification/cognitiveservices/Speech.VideoTranslation/main.tsp b/specification/cognitiveservices/Speech.VideoTranslation/main.tsp new file mode 100644 index 000000000000..988b53583084 --- /dev/null +++ b/specification/cognitiveservices/Speech.VideoTranslation/main.tsp @@ -0,0 +1,320 @@ +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-autorest"; +import "@typespec/openapi"; + +using Azure.Core; +using Azure.Core.Traits; +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using TypeSpec.OpenAPI; + +@doc("Video translation API to translate video from source locale to target locale.") +@versioned(VideoTranslation.ApiVersions) +@service({ + title: "Video Translation", +}) +@server( + "{endpoint}/videotranslation", + "Translate video from source locale to target locale.", + { + @doc("Supported Cognitive Services endpoints (protocol and hostname, for example: https://eastus.api.cognitive.microsoft.com).") + endpoint: string, + } +) +@useAuth(KeyAuth | AADToken) +@tag("VideoTranslation") +@info({ + contact: { + name: "Azure AI - Speech Services", + url: "https://learn.microsoft.com/azure/ai-services/speech-service/", + }, + license: { + name: "Copyright (c) Microsoft. All rights reserved.", + }, +}) +namespace Microsoft.Speech.VideoTranslation; + +@doc("Provide your Speech resource key here.") +model KeyAuth is ApiKeyAuth; + +#suppress "@azure-tools/typespec-azure-core/casing-style" "Supress casing style for AAD" +@doc("These are the [Microsoft identity platform](entra/identity-platform/v2-overview) flows.") +model AADToken + is OAuth2Auth<[ + { + type: OAuth2FlowType.implicit; + authorizationUrl: "https://login.microsoftonline.com/common/oauth2/authorize"; + scopes: ["https://cognitiveservices.azure.com/.default"]; + } + ]>; + +alias VideoTranslationServiceTraits = NoRepeatableRequests & + NoConditionalRequests & + NoClientRequestId; +alias ops = Azure.Core.ResourceOperations; + +enum ApiVersions { + @useDependency(Azure.Core.Versions.v1_0_Preview_2) + @doc("The 2024-05-20-preview version of the VideoTranslation service.") + v2024_05_20_preview: "2024-05-20-preview", +} + +@doc("Task status.") +union Status { + string, + + /** Not started status */ + NotStarted: "NotStarted", + + /** Running status */ + Running: "Running", + + /** Run succeeded status */ + Succeeded: "Succeeded", + + /** Run failed status */ + Failed: "Failed", + + /** Cancelled status */ + Canceled: "Canceled", +} + +@doc("TTS voice kind.") +union VoiceKind { + string, + + /** TTS platform voice */ + PlatformVoice: "PlatformVoice", + + /** TTS personal voice */ + PersonalVoice: "PersonalVoice", +} + +@doc("Webvtt file kind.") +union WebvttFileKind { + string, + + /** Source locale plain text subtitle webvtt file */ + SourceLocaleSubtitle: "SourceLocaleSubtitle", + + /** Target locale plain text subtitle webvtt file */ + TargetLocaleSubtitle: "TargetLocaleSubtitle", + + /** Target locale metadata JSON webvtt file */ + MetadataJson: "MetadataJson", +} + +@doc("Translation webvtt file.") +model WebvttFile { + @doc("Translation webvtt file url.") + url: url; + + @doc("Translation webvtt file kind.") + kind: WebvttFileKind; +} + +@doc("Locale name, for example: en-US") +@pattern("^[A-Za-z]{2,4}([_-][A-Za-z]{4})?([_-]([A-Za-z]{2}|[0-9]{3}))?$") +@minLength(5) +@maxLength(16) +scalar localeName extends string; + +@doc("Resource ID") +@pattern("^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$") +@minLength(3) +@maxLength(64) +scalar resourceId extends string; + +@doc("Translation input.") +model TranslationInput { + @doc("The source locale of the video file. Locale code follows BCP-47. You can find the text to speech locale list here https://learn.microsoft.com/azure/ai-services/speech-service/language-support?tabs=tts.") + sourceLocale: localeName; + + @doc("The target locale of the translation. Locale code follows BCP-47. You can find the text to speech locale list here https://learn.microsoft.com/azure/ai-services/speech-service/language-support?tabs=tts.") + targetLocale: localeName; + + @doc("Translation voice kind.") + voiceKind: VoiceKind; + + @doc("Translation video file url.") + videoFileUrl: url; + + @doc("Number of speakers in the video.") + speakerCount?: int32; + + @doc("Subtitle max display character count per segment.") + subtitleMaxCharCountPerSegment?: int32; + + @doc("Export subtitle in video.") + exportSubtitleInVideo?: boolean; +} + +@doc("Iteration result.") +model IterationResult { + @doc("Translated video file URL.") + translatedVideoFileUrl?: url; + + @doc("Source locale subtitle file URL.") + sourceLocaleSubtitleWebvttFileUrl?: url; + + @doc("Target locale subtitle file URL.") + targetLocaleSubtitleWebvttFileUrl?: url; + + @doc("Metadata json webvtt file URL.") + metadataJsonWebvttFileUrl?: url; + + @doc("Report file URL.") + reportFileUrl?: url; +} + +@doc("Iteration input.") +model IterationInput { + @doc("Webvtt file for content editing.") + webvttFile?: WebvttFile; + + @doc("Number of speakers in the video.") + speakerCount?: int32; + + @doc("Subtitle max display character count per segment.") + subtitleMaxCharCountPerSegment?: int32; + + @doc("Export subtitle in video.") + exportSubtitleInVideo?: boolean; +} + +@doc("Operation ID header.") +model OperationIdHeader { + @doc("Operation ID.") + @header("Operation-Id") + @visibility("create") + operationId: resourceId; +} + +@doc("Create translation resource for hosting iterations of translating one video file from source locale to target locale.") +@TypeSpec.Rest.resource("translations") +model Translation { + @doc("Translation resource ID.") + @key("translationId") + @visibility("read") + id: resourceId; + + @doc("Translation input.") + input: TranslationInput; + + @doc("Translation display name.") + displayName?: string; + + @doc("Translation description.") + description?: string; + + @doc("The timestamp when the object was created. The timestamp is encoded as ISO 8601 date and time format (\"YYYY-MM-DDThh:mm:ssZ\", see https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations).") + @visibility("read") + createdDateTime?: utcDateTime; + + @doc("Latest iteration of the translation.") + @visibility("read") + latestIteration?: Iteration; + + @doc("Latest completed iteration of the translation.") + @visibility("read") + latestSucceededIteration?: Iteration; + + @doc("Translation failure reason") + @visibility("read") + failureReason?: string; +} + +@doc("Do one iteration to translate one video file from source locale to target locale, webvtt for content editing is optional for requesting parameter.") +@TypeSpec.Rest.resource("iterations") +@TypeSpec.Rest.parentResource(Translation) +model Iteration { + @doc("Iteration ID") + @key("iterationId") + @visibility("read") + id: resourceId; + + @doc("Iteration input.") + input: IterationInput; + + @doc("Iteration description") + description?: string; + + @doc("Iteration status") + @visibility("read") + status?: Status; + + @doc("Iteration failure reason") + @visibility("read") + failureReason?: string; + + @doc("The timestamp when the object was created. The timestamp is encoded as ISO 8601 date and time format (\"YYYY-MM-DDThh:mm:ssZ\", see https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations).") + @visibility("read") + createdDateTime?: utcDateTime; + + @doc("The timestamp when the current status was entered. The timestamp is encoded as ISO 8601 date and time format (\"YYYY-MM-DDThh:mm:ssZ\", see https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations).") + @visibility("read") + lastActionDateTime?: utcDateTime; + + @doc("Iteration result.") + @visibility("read") + result?: IterationResult; +} + +@doc("Operation.") +@TypeSpec.Rest.resource("operations") +model Operation { + @doc("Operation ID") + @key("operationId") + @visibility("read") + id: resourceId; + + @doc("Operation status") + status?: Status; +} + +interface TranslationOperations { + // LongRunningResourceCreateOrReplace will generate PUT, to align with CNV other creation operation. + @doc("Creates a translation.") + @pollingOperation(OperationOperations.getOperation) + createOrReplaceTranslation is ops.LongRunningResourceCreateOrReplace< + Translation, + RequestHeadersTrait + >; + + @doc("Fetch a translation by ID.") + getTranslation is ops.ResourceRead; + + @doc("Delete a translation.") + deleteTranslation is ops.ResourceDelete; + + @doc("List translation resources.") + listTranslation is ops.ResourceList< + Translation, + ListQueryParametersTrait + >; +} + +interface IterationOperations { + // LongRunningResourceCreateOrReplace will generate PUT, to align with CNV other creation operation. + @doc("Creates an iteration.") + @pollingOperation(OperationOperations.getOperation) + createOrReplaceIteration is ops.LongRunningResourceCreateOrReplace< + Iteration, + RequestHeadersTrait + >; + + @doc("Fetch a iteration by ID.") + getIteration is ops.ResourceRead; + + @doc("List Iteration resources.") + listIteration is ops.ResourceList< + Iteration, + ListQueryParametersTrait + >; +} + +interface OperationOperations { + @doc("Fetch a operation by ID.") + getOperation is ops.ResourceRead; +} diff --git a/specification/cognitiveservices/Speech.VideoTranslation/tspconfig.yaml b/specification/cognitiveservices/Speech.VideoTranslation/tspconfig.yaml new file mode 100644 index 000000000000..8367bce57161 --- /dev/null +++ b/specification/cognitiveservices/Speech.VideoTranslation/tspconfig.yaml @@ -0,0 +1,15 @@ +parameters: + "service-dir": + default: "sdk/VideoTranslation" +emit: + - "@azure-tools/typespec-autorest" +linter: + extends: + - "@azure-tools/typespec-azure-rulesets/data-plane" +options: + "@azure-tools/typespec-autorest": + azure-resource-provider-folder: "data-plane" + emitter-output-dir: "{project-root}/.." + examples-directory: "examples" + omit-unreachable-types: true + output-file: "{azure-resource-provider-folder}/Speech/VideoTranslation/{version-status}/{version}/VideoTranslation.json" diff --git a/specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/VideoTranslation.json b/specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/VideoTranslation.json new file mode 100644 index 000000000000..bd251b3835cc --- /dev/null +++ b/specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/VideoTranslation.json @@ -0,0 +1,1065 @@ +{ + "swagger": "2.0", + "info": { + "title": "Video Translation", + "version": "2024-05-20-preview", + "description": "Video translation API to translate video from source locale to target locale.", + "contact": { + "name": "Azure AI - Speech Services", + "url": "https://learn.microsoft.com/azure/ai-services/speech-service/" + }, + "license": { + "name": "Copyright (c) Microsoft. All rights reserved." + }, + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "x-ms-parameterized-host": { + "hostTemplate": "{endpoint}/videotranslation", + "useSchemePrefix": false, + "parameters": [ + { + "name": "endpoint", + "in": "path", + "description": "Supported Cognitive Services endpoints (protocol and hostname, for example: https://eastus.api.cognitive.microsoft.com).", + "required": true, + "type": "string" + } + ] + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "security": [ + { + "KeyAuth": [] + }, + { + "AADToken": [ + "https://cognitiveservices.azure.com/.default" + ] + } + ], + "securityDefinitions": { + "AADToken": { + "type": "oauth2", + "description": "These are the [Microsoft identity platform](entra/identity-platform/v2-overview) flows.", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "scopes": { + "https://cognitiveservices.azure.com/.default": "" + } + }, + "KeyAuth": { + "type": "apiKey", + "description": "Provide your Speech resource key here.", + "name": "Ocp-Apim-Subscription-Key", + "in": "header" + } + }, + "tags": [ + { + "name": "VideoTranslation" + } + ], + "paths": { + "/operations/{operationId}": { + "get": { + "operationId": "OperationOperations_GetOperation", + "tags": [ + "VideoTranslation" + ], + "description": "Fetch a operation by ID.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "operationId", + "in": "path", + "description": "Operation ID", + "required": true, + "type": "string", + "minLength": 3, + "maxLength": 64, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/Operation" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Get Operation": { + "$ref": "./examples/OperationOperations_GetOperation.json" + } + } + } + }, + "/translations": { + "get": { + "operationId": "TranslationOperations_ListTranslation", + "tags": [ + "VideoTranslation" + ], + "description": "List translation resources.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "$ref": "#/parameters/Azure.Core.TopQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.SkipQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.MaxPageSizeQueryParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedTranslation" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "List translations": { + "$ref": "./examples/TranslationOperations_ListTranslation.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/translations/{translationId}": { + "get": { + "operationId": "TranslationOperations_GetTranslation", + "tags": [ + "VideoTranslation" + ], + "description": "Fetch a translation by ID.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "translationId", + "in": "path", + "description": "Translation resource ID.", + "required": true, + "type": "string", + "minLength": 3, + "maxLength": 64, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/Translation" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Get Translation": { + "$ref": "./examples/TranslationOperations_GetTranslation.json" + } + } + }, + "put": { + "operationId": "TranslationOperations_CreateOrReplaceTranslation", + "tags": [ + "VideoTranslation" + ], + "description": "Creates a translation.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "translationId", + "in": "path", + "description": "Translation resource ID.", + "required": true, + "type": "string", + "minLength": 3, + "maxLength": 64, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$" + }, + { + "$ref": "#/parameters/OperationIdHeader" + }, + { + "name": "resource", + "in": "body", + "description": "The resource instance.", + "required": true, + "schema": { + "$ref": "#/definitions/Translation" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/Translation" + }, + "headers": { + "Operation-Location": { + "type": "string", + "format": "uri", + "description": "The location for monitoring the operation state." + } + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/Translation" + }, + "headers": { + "Operation-Location": { + "type": "string", + "format": "uri", + "description": "The location for monitoring the operation state." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Create Translation": { + "$ref": "./examples/TranslationOperations_CreateOrReplaceTranslation.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "original-uri" + }, + "x-ms-long-running-operation": true + }, + "delete": { + "operationId": "TranslationOperations_DeleteTranslation", + "tags": [ + "VideoTranslation" + ], + "description": "Delete a translation.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "translationId", + "in": "path", + "description": "Translation resource ID.", + "required": true, + "type": "string", + "minLength": 3, + "maxLength": 64, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$" + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Delete Translation": { + "$ref": "./examples/TranslationOperations_DeleteTranslation.json" + } + } + } + }, + "/translations/{translationId}/iterations": { + "get": { + "operationId": "IterationOperations_ListIteration", + "tags": [ + "VideoTranslation" + ], + "description": "List Iteration resources.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "translationId", + "in": "path", + "description": "Translation resource ID.", + "required": true, + "type": "string", + "minLength": 3, + "maxLength": 64, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$" + }, + { + "$ref": "#/parameters/Azure.Core.TopQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.SkipQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.MaxPageSizeQueryParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedIteration" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "List Iteration": { + "$ref": "./examples/IterationOperations_ListIteration.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/translations/{translationId}/iterations/{iterationId}": { + "get": { + "operationId": "IterationOperations_GetIteration", + "tags": [ + "VideoTranslation" + ], + "description": "Fetch a iteration by ID.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "translationId", + "in": "path", + "description": "Translation resource ID.", + "required": true, + "type": "string", + "minLength": 3, + "maxLength": 64, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$" + }, + { + "name": "iterationId", + "in": "path", + "description": "Iteration ID", + "required": true, + "type": "string", + "minLength": 3, + "maxLength": 64, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/Iteration" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Get Iteration": { + "$ref": "./examples/IterationOperations_GetIteration.json" + } + } + }, + "put": { + "operationId": "IterationOperations_CreateOrReplaceIteration", + "tags": [ + "VideoTranslation" + ], + "description": "Creates an iteration.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "translationId", + "in": "path", + "description": "Translation resource ID.", + "required": true, + "type": "string", + "minLength": 3, + "maxLength": 64, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$" + }, + { + "name": "iterationId", + "in": "path", + "description": "Iteration ID", + "required": true, + "type": "string", + "minLength": 3, + "maxLength": 64, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$" + }, + { + "$ref": "#/parameters/OperationIdHeader" + }, + { + "name": "resource", + "in": "body", + "description": "The resource instance.", + "required": true, + "schema": { + "$ref": "#/definitions/Iteration" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/Iteration" + }, + "headers": { + "Operation-Location": { + "type": "string", + "format": "uri", + "description": "The location for monitoring the operation state." + } + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/Iteration" + }, + "headers": { + "Operation-Location": { + "type": "string", + "format": "uri", + "description": "The location for monitoring the operation state." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Create Iteration": { + "$ref": "./examples/IterationOperations_CreateOrReplaceIteration.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "original-uri" + }, + "x-ms-long-running-operation": true + } + } + }, + "definitions": { + "Azure.Core.Foundations.Error": { + "type": "object", + "description": "The error object.", + "properties": { + "code": { + "type": "string", + "description": "One of a server-defined set of error codes." + }, + "message": { + "type": "string", + "description": "A human-readable representation of the error." + }, + "target": { + "type": "string", + "description": "The target of the error." + }, + "details": { + "type": "array", + "description": "An array of details about specific errors that led to this reported error.", + "items": { + "$ref": "#/definitions/Azure.Core.Foundations.Error" + }, + "x-ms-identifiers": [] + }, + "innererror": { + "$ref": "#/definitions/Azure.Core.Foundations.InnerError", + "description": "An object containing more specific information than the current object about the error." + } + }, + "required": [ + "code", + "message" + ] + }, + "Azure.Core.Foundations.ErrorResponse": { + "type": "object", + "description": "A response containing error details.", + "properties": { + "error": { + "$ref": "#/definitions/Azure.Core.Foundations.Error", + "description": "The error object." + } + }, + "required": [ + "error" + ] + }, + "Azure.Core.Foundations.InnerError": { + "type": "object", + "description": "An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.", + "properties": { + "code": { + "type": "string", + "description": "One of a server-defined set of error codes." + }, + "innererror": { + "$ref": "#/definitions/Azure.Core.Foundations.InnerError", + "description": "Inner error." + } + } + }, + "Iteration": { + "type": "object", + "description": "Do one iteration to translate one video file from source locale to target locale, webvtt for content editing is optional for requesting parameter.", + "properties": { + "id": { + "$ref": "#/definitions/resourceId", + "description": "Iteration ID", + "readOnly": true + }, + "input": { + "$ref": "#/definitions/IterationInput", + "description": "Iteration input." + }, + "description": { + "type": "string", + "description": "Iteration description" + }, + "status": { + "$ref": "#/definitions/Status", + "description": "Iteration status", + "readOnly": true + }, + "failureReason": { + "type": "string", + "description": "Iteration failure reason", + "readOnly": true + }, + "createdDateTime": { + "type": "string", + "format": "date-time", + "description": "The timestamp when the object was created. The timestamp is encoded as ISO 8601 date and time format (\"YYYY-MM-DDThh:mm:ssZ\", see https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations).", + "readOnly": true + }, + "lastActionDateTime": { + "type": "string", + "format": "date-time", + "description": "The timestamp when the current status was entered. The timestamp is encoded as ISO 8601 date and time format (\"YYYY-MM-DDThh:mm:ssZ\", see https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations).", + "readOnly": true + }, + "result": { + "$ref": "#/definitions/IterationResult", + "description": "Iteration result.", + "readOnly": true + } + }, + "required": [ + "id", + "input" + ] + }, + "IterationInput": { + "type": "object", + "description": "Iteration input.", + "properties": { + "webvttFile": { + "$ref": "#/definitions/WebvttFile", + "description": "Webvtt file for content editing." + }, + "speakerCount": { + "type": "integer", + "format": "int32", + "description": "Number of speakers in the video." + }, + "subtitleMaxCharCountPerSegment": { + "type": "integer", + "format": "int32", + "description": "Subtitle max display character count per segment." + }, + "exportSubtitleInVideo": { + "type": "boolean", + "description": "Export subtitle in video." + } + } + }, + "IterationResult": { + "type": "object", + "description": "Iteration result.", + "properties": { + "translatedVideoFileUrl": { + "type": "string", + "format": "uri", + "description": "Translated video file URL." + }, + "sourceLocaleSubtitleWebvttFileUrl": { + "type": "string", + "format": "uri", + "description": "Source locale subtitle file URL." + }, + "targetLocaleSubtitleWebvttFileUrl": { + "type": "string", + "format": "uri", + "description": "Target locale subtitle file URL." + }, + "metadataJsonWebvttFileUrl": { + "type": "string", + "format": "uri", + "description": "Metadata json webvtt file URL." + }, + "reportFileUrl": { + "type": "string", + "format": "uri", + "description": "Report file URL." + } + } + }, + "Operation": { + "type": "object", + "description": "Operation.", + "properties": { + "id": { + "$ref": "#/definitions/resourceId", + "description": "Operation ID", + "readOnly": true + }, + "status": { + "$ref": "#/definitions/Status", + "description": "Operation status" + } + }, + "required": [ + "id" + ] + }, + "PagedIteration": { + "type": "object", + "description": "Paged collection of Iteration items", + "properties": { + "value": { + "type": "array", + "description": "The Iteration items on this page", + "items": { + "$ref": "#/definitions/Iteration" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PagedTranslation": { + "type": "object", + "description": "Paged collection of Translation items", + "properties": { + "value": { + "type": "array", + "description": "The Translation items on this page", + "items": { + "$ref": "#/definitions/Translation" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "Status": { + "type": "string", + "description": "Task status.", + "enum": [ + "NotStarted", + "Running", + "Succeeded", + "Failed", + "Canceled" + ], + "x-ms-enum": { + "name": "Status", + "modelAsString": true, + "values": [ + { + "name": "NotStarted", + "value": "NotStarted", + "description": "Not started status" + }, + { + "name": "Running", + "value": "Running", + "description": "Running status" + }, + { + "name": "Succeeded", + "value": "Succeeded", + "description": "Run succeeded status" + }, + { + "name": "Failed", + "value": "Failed", + "description": "Run failed status" + }, + { + "name": "Canceled", + "value": "Canceled", + "description": "Cancelled status" + } + ] + } + }, + "Translation": { + "type": "object", + "description": "Create translation resource for hosting iterations of translating one video file from source locale to target locale.", + "properties": { + "id": { + "$ref": "#/definitions/resourceId", + "description": "Translation resource ID.", + "readOnly": true + }, + "input": { + "$ref": "#/definitions/TranslationInput", + "description": "Translation input." + }, + "displayName": { + "type": "string", + "description": "Translation display name." + }, + "description": { + "type": "string", + "description": "Translation description." + }, + "createdDateTime": { + "type": "string", + "format": "date-time", + "description": "The timestamp when the object was created. The timestamp is encoded as ISO 8601 date and time format (\"YYYY-MM-DDThh:mm:ssZ\", see https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations).", + "readOnly": true + }, + "latestIteration": { + "$ref": "#/definitions/Iteration", + "description": "Latest iteration of the translation.", + "readOnly": true + }, + "latestSucceededIteration": { + "$ref": "#/definitions/Iteration", + "description": "Latest completed iteration of the translation.", + "readOnly": true + }, + "failureReason": { + "type": "string", + "description": "Translation failure reason", + "readOnly": true + } + }, + "required": [ + "id", + "input" + ] + }, + "TranslationInput": { + "type": "object", + "description": "Translation input.", + "properties": { + "sourceLocale": { + "$ref": "#/definitions/localeName", + "description": "The source locale of the video file. Locale code follows BCP-47. You can find the text to speech locale list here https://learn.microsoft.com/azure/ai-services/speech-service/language-support?tabs=tts." + }, + "targetLocale": { + "$ref": "#/definitions/localeName", + "description": "The target locale of the translation. Locale code follows BCP-47. You can find the text to speech locale list here https://learn.microsoft.com/azure/ai-services/speech-service/language-support?tabs=tts." + }, + "voiceKind": { + "$ref": "#/definitions/VoiceKind", + "description": "Translation voice kind." + }, + "videoFileUrl": { + "type": "string", + "format": "uri", + "description": "Translation video file url." + }, + "speakerCount": { + "type": "integer", + "format": "int32", + "description": "Number of speakers in the video." + }, + "subtitleMaxCharCountPerSegment": { + "type": "integer", + "format": "int32", + "description": "Subtitle max display character count per segment." + }, + "exportSubtitleInVideo": { + "type": "boolean", + "description": "Export subtitle in video." + } + }, + "required": [ + "sourceLocale", + "targetLocale", + "voiceKind", + "videoFileUrl" + ] + }, + "VoiceKind": { + "type": "string", + "description": "TTS voice kind.", + "enum": [ + "PlatformVoice", + "PersonalVoice" + ], + "x-ms-enum": { + "name": "VoiceKind", + "modelAsString": true, + "values": [ + { + "name": "PlatformVoice", + "value": "PlatformVoice", + "description": "TTS platform voice" + }, + { + "name": "PersonalVoice", + "value": "PersonalVoice", + "description": "TTS personal voice" + } + ] + } + }, + "WebvttFile": { + "type": "object", + "description": "Translation webvtt file.", + "properties": { + "url": { + "type": "string", + "format": "uri", + "description": "Translation webvtt file url." + }, + "kind": { + "$ref": "#/definitions/WebvttFileKind", + "description": "Translation webvtt file kind." + } + }, + "required": [ + "url", + "kind" + ] + }, + "WebvttFileKind": { + "type": "string", + "description": "Webvtt file kind.", + "enum": [ + "SourceLocaleSubtitle", + "TargetLocaleSubtitle", + "MetadataJson" + ], + "x-ms-enum": { + "name": "WebvttFileKind", + "modelAsString": true, + "values": [ + { + "name": "SourceLocaleSubtitle", + "value": "SourceLocaleSubtitle", + "description": "Source locale plain text subtitle webvtt file" + }, + { + "name": "TargetLocaleSubtitle", + "value": "TargetLocaleSubtitle", + "description": "Target locale plain text subtitle webvtt file" + }, + { + "name": "MetadataJson", + "value": "MetadataJson", + "description": "Target locale metadata JSON webvtt file" + } + ] + } + }, + "localeName": { + "type": "string", + "description": "Locale name, for example: en-US", + "minLength": 5, + "maxLength": 16, + "pattern": "^[A-Za-z]{2,4}([_-][A-Za-z]{4})?([_-]([A-Za-z]{2}|[0-9]{3}))?$" + }, + "resourceId": { + "type": "string", + "description": "Resource ID", + "minLength": 3, + "maxLength": 64, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$" + } + }, + "parameters": { + "Azure.Core.Foundations.ApiVersionParameter": { + "name": "api-version", + "in": "query", + "description": "The API version to use for this operation.", + "required": true, + "type": "string", + "minLength": 1, + "x-ms-parameter-location": "method", + "x-ms-client-name": "apiVersion" + }, + "Azure.Core.MaxPageSizeQueryParameter": { + "name": "maxpagesize", + "in": "query", + "description": "The maximum number of result items per page.", + "required": false, + "type": "integer", + "format": "int32", + "x-ms-parameter-location": "method" + }, + "Azure.Core.SkipQueryParameter": { + "name": "skip", + "in": "query", + "description": "The number of result items to skip.", + "required": false, + "type": "integer", + "format": "int32", + "default": 0, + "x-ms-parameter-location": "method" + }, + "Azure.Core.TopQueryParameter": { + "name": "top", + "in": "query", + "description": "The number of result items to return.", + "required": false, + "type": "integer", + "format": "int32", + "x-ms-parameter-location": "method" + }, + "OperationIdHeader": { + "name": "Operation-Id", + "in": "header", + "description": "Operation ID.", + "required": true, + "type": "string", + "minLength": 3, + "maxLength": 64, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$", + "x-ms-parameter-location": "method", + "x-ms-client-name": "operationId" + } + } +} diff --git a/specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/IterationOperations_CreateOrReplaceIteration.json b/specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/IterationOperations_CreateOrReplaceIteration.json new file mode 100644 index 000000000000..a0a866d77bd2 --- /dev/null +++ b/specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/IterationOperations_CreateOrReplaceIteration.json @@ -0,0 +1,68 @@ +{ + "title": "Create Iteration", + "operationId": "IterationOperations_CreateOrReplaceIteration", + "parameters": { + "Endpoint": "https://eastus.api.cognitive.microsoft.com/", + "api-version": "2024-05-20-preview", + "translationId": "TranslateMyZhCNVideo", + "iterationId": "TranslateMyZhCNVideo-ContentEditing-2", + "Ocp-Apim-Subscription-Key": "{API Key}", + "Operation-Id": "Create-TranslateMyZhCNVideo-ContentEditing-2", + "resource": { + "description": "Fix segment duration issue and update subtitle max char.", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 60, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + } + }, + "Content-Type": "application/json" + }, + "responses": { + "200": { + "headers": { + "Operation-Location": "https://eastus.api.cognitive.microsoft.com/videotranslation/operations/Create-TranslateMyZhCNVideo-ContentEditing-2?api-version=2024-02-01-preview", + "Operation-Id": "TranslateMyZhCNVideo-ContentEditing-1" + }, + "body": { + "id": "TranslateMyZhCNVideo-ContentEditing-2", + "description": "Fix segment duration issue and update subtitle max char.", + "status": "NotStarted", + "createdDateTime": "2023-04-10T05:30:00.000Z", + "lastActionDateTime": "2023-04-10T05:15:30.000Z", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + } + } + }, + "201": { + "headers": { + "Operation-Location": "https://eastus.api.cognitive.microsoft.com/videotranslation/operations/Create-TranslateMyZhCNVideo-ContentEditing-2?api-version=2024-02-01-preview", + "Operation-Id": "TranslateMyZhCNVideo-ContentEditing-1" + }, + "body": { + "id": "TranslateMyZhCNVideo-ContentEditing-2", + "description": "Fix segment duration issue and update subtitle max char.", + "status": "NotStarted", + "createdDateTime": "2023-04-10T05:30:00.000Z", + "lastActionDateTime": "2023-04-10T05:15:30.000Z", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/IterationOperations_GetIteration.json b/specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/IterationOperations_GetIteration.json new file mode 100644 index 000000000000..9ba712ddc804 --- /dev/null +++ b/specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/IterationOperations_GetIteration.json @@ -0,0 +1,37 @@ +{ + "title": "Get Iteration", + "operationId": "IterationOperations_GetIteration", + "parameters": { + "Endpoint": "https://eastus.api.cognitive.microsoft.com/", + "api-version": "2024-05-20-preview", + "translationId": "TranslateMyZhCNVideo", + "Ocp-Apim-Subscription-Key": "{API Key}", + "iterationId": "TranslateMyZhCNVideo-Iteration-1" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "TranslateMyZhCNVideo-Iteration-1", + "description": "Translate video from en-US to zh-CN, fix segment issue.", + "status": "Succeeded", + "createdDateTime": "2023-04-10T05:30:00.000Z", + "lastActionDateTime": "2023-04-10T05:15:30.000Z", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + }, + "result": { + "translatedVideoFileUrl": "https://xxx.blob.core.windows.net/container1/video.mp4?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "sourceLocaleSubtitleWebvttFileUrl": "https://xxx.blob.core.windows.net/container1/sourceLocale.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "targetLocaleSubtitleWebvttFileUrl": "https://xxx.blob.core.windows.net/container1/targetLocale.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "metadataJsonWebvttFileUrl": "https://xxx.blob.core.windows.net/container1/metadataJsonLocale.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx" + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/IterationOperations_ListIteration.json b/specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/IterationOperations_ListIteration.json new file mode 100644 index 000000000000..56712fe02a7a --- /dev/null +++ b/specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/IterationOperations_ListIteration.json @@ -0,0 +1,65 @@ +{ + "title": "List Iteration", + "operationId": "IterationOperations_ListIteration", + "parameters": { + "Endpoint": "https://eastus.api.cognitive.microsoft.com/", + "api-version": "2024-05-20-preview", + "translationId": "TranslateMyZhCNVideo", + "Ocp-Apim-Subscription-Key": "{API Key}" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "id": "Initial", + "description": "Translate video from en-US to zh-CN, fix segment issue.", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + }, + "status": "Succeeded", + "createdDateTime": "2023-04-10T05:30:00.000Z", + "lastActionDateTime": "2023-04-10T05:15:30.000Z" + }, + { + "id": "TranslateMyZhCNVideo-Iteration-1", + "description": "Translate video from en-US to zh-CN.", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + }, + "status": "Failed", + "createdDateTime": "2023-04-01T05:30:00.000Z", + "lastActionDateTime": "2023-04-10T05:15:30.000Z" + }, + { + "id": "TranslateMyZhCNVideo-Iteration-2", + "description": "Translate video from en-US to zh-CN.", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + }, + "status": "Running", + "createdDateTime": "2023-04-01T05:30:00.000Z", + "lastActionDateTime": "2023-04-10T05:15:30.000Z" + } + ], + "nextLink": "https://eastus.api.cognitive.microsoft.com/video-translation/translations/TranslateMyZhCNVideo/iterations?skip=2&maxpagesize=2&api-version=2024-05-20-preview" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/OperationOperations_GetOperation.json b/specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/OperationOperations_GetOperation.json new file mode 100644 index 000000000000..ce5779709faf --- /dev/null +++ b/specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/OperationOperations_GetOperation.json @@ -0,0 +1,19 @@ +{ + "title": "Get Operation", + "operationId": "OperationOperations_GetOperation", + "parameters": { + "Endpoint": "https://eastus.api.cognitive.microsoft.com/", + "api-version": "2024-05-20-preview", + "operationId": "TranslateMyZhCNVideo-DeleteTranslate", + "Ocp-Apim-Subscription-Key": "{API Key}" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "TranslateMyZhCNVideo-DeleteTranslate", + "status": "Running" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/TranslationOperations_CreateOrReplaceTranslation.json b/specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/TranslationOperations_CreateOrReplaceTranslation.json new file mode 100644 index 000000000000..54ff4ec4a903 --- /dev/null +++ b/specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/TranslationOperations_CreateOrReplaceTranslation.json @@ -0,0 +1,83 @@ +{ + "title": "Create Translation", + "operationId": "TranslationOperations_CreateOrReplaceTranslation", + "parameters": { + "Endpoint": "https://eastus.api.cognitive.microsoft.com/", + "api-version": "2024-05-20-preview", + "translationId": "TranslateMyZhCNVideo", + "Ocp-Apim-Subscription-Key": "{API Key}", + "Operation-Id": "Create-TranslateMyZhCNVideo", + "resource": { + "displayName": "hello.mp4", + "description": "Translate video from en-US to zh-CN.", + "input": { + "sourceLocale": "en-US", + "targetLocale": "zh-CN", + "voiceKind": "PlatformVoice", + "videoFileUrl": "https://mystorage.blob.core.windows.net/container1/video.mp4?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx" + } + }, + "Content-Type": "application/json" + }, + "responses": { + "200": { + "headers": { + "Operation-Location": "https://eastus.api.cognitive.microsoft.com/videotranslation/operations/Create-TranslateMyZhCNVideo?api-version=2024-02-01-preview", + "Operation-Id": "Create-TranslateMyZhCNVideo" + }, + "body": { + "id": "TranslateMyZhCNVideo", + "displayName": "hello.mp4", + "description": "Translate video from en-US to zh-CN.", + "input": { + "sourceLocale": "en-US", + "targetLocale": "zh-CN", + "voiceKind": "PlatformVoice", + "videoFileUrl": "https://mystorage.blob.core.windows.net/container1/video.mp4?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx" + }, + "createdDateTime": "2023-04-01T05:30:00.000Z", + "latestIteration": { + "id": "Initial", + "status": "NotStarted", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + } + } + } + }, + "201": { + "headers": { + "Operation-Location": "https://eastus.api.cognitive.microsoft.com/videotranslation/operations/Create-TranslateMyZhCNVideo?api-version=2024-02-01-preview", + "Operation-Id": "Create-TranslateMyZhCNVideo" + }, + "body": { + "id": "TranslateMyZhCNVideo", + "description": "Translate video from en-US to zh-CN.", + "input": { + "sourceLocale": "en-US", + "targetLocale": "zh-CN", + "voiceKind": "PlatformVoice", + "videoFileUrl": "https://mystorage.blob.core.windows.net/container1/video.mp4?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx" + }, + "createdDateTime": "2023-04-01T05:30:00.000Z", + "latestIteration": { + "id": "Initial", + "status": "NotStarted", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + } + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/TranslationOperations_DeleteTranslation.json b/specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/TranslationOperations_DeleteTranslation.json new file mode 100644 index 000000000000..d93945cef517 --- /dev/null +++ b/specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/TranslationOperations_DeleteTranslation.json @@ -0,0 +1,15 @@ +{ + "title": "Delete Translation", + "operationId": "TranslationOperations_DeleteTranslation", + "parameters": { + "Endpoint": "https://eastus.api.cognitive.microsoft.com/", + "api-version": "2024-05-20-preview", + "translationId": "TranslateMyZhCNVideo", + "Ocp-Apim-Subscription-Key": "{API Key}" + }, + "responses": { + "204": { + "headers": {} + } + } +} diff --git a/specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/TranslationOperations_GetTranslation.json b/specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/TranslationOperations_GetTranslation.json new file mode 100644 index 000000000000..5f0a6095f87d --- /dev/null +++ b/specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/TranslationOperations_GetTranslation.json @@ -0,0 +1,57 @@ +{ + "title": "Get Translation", + "operationId": "TranslationOperations_GetTranslation", + "parameters": { + "Endpoint": "https://eastus.api.cognitive.microsoft.com/", + "api-version": "2024-05-20-preview", + "translationId": "TranslateMyZhCNVideo", + "Ocp-Apim-Subscription-Key": "{API Key}" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "TranslateMyZhCNVideo", + "displayName": "hello.mp4", + "description": "Translate video from en-US to zh-CN.", + "input": { + "sourceLocale": "en-US", + "targetLocale": "zh-CN", + "voiceKind": "PlatformVoice", + "videoFileUrl": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx" + }, + "createdDateTime": "2023-04-01T05:30:00.000Z", + "latestIteration": { + "id": "xxx", + "description": "Iteration1", + "status": "Running", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + } + }, + "latestSucceededIteration": { + "id": "xxx", + "description": "Iteration1", + "input": { + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + }, + "result": { + "translatedVideoFileUrl": "https://xxx.blob.core.windows.net/container1/video.mp4?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "sourceLocaleSubtitleWebvttFileUrl": "https://xxx.blob.core.windows.net/container1/sourceLocale.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "targetLocaleSubtitleWebvttFileUrl": "https://xxx.blob.core.windows.net/container1/targetLocale.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "metadataJsonWebvttFileUrl": "https://xxx.blob.core.windows.net/container1/metadataJsonLocale.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "reportFileUrl": "https://xxx.blob.core.windows.net/container1/metadataJsonLocale.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx" + } + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/TranslationOperations_ListTranslation.json b/specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/TranslationOperations_ListTranslation.json new file mode 100644 index 000000000000..3aab4250550e --- /dev/null +++ b/specification/cognitiveservices/data-plane/Speech/VideoTranslation/preview/2024-05-20-preview/examples/TranslationOperations_ListTranslation.json @@ -0,0 +1,130 @@ +{ + "title": "List translations", + "operationId": "TranslationOperations_ListTranslation", + "parameters": { + "Endpoint": "https://eastus.api.cognitive.microsoft.com/", + "api-version": "2024-05-20-preview", + "Ocp-Apim-Subscription-Key": "{API Key}" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "id": "TranslateMyZhCNVideo1", + "displayName": "hello.mp4", + "description": "Translate video from en-US to zh-CN.", + "input": { + "sourceLocale": "en-US", + "targetLocale": "zh-CN", + "voiceKind": "PlatformVoice", + "videoFileUrl": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx" + }, + "createdDateTime": "2023-04-01T05:30:00.000Z", + "latestIteration": { + "id": "TranslateMyZhCNVideo1-Edit1", + "description": "Iteration1", + "status": "Running", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + } + }, + "latestSucceededIteration": { + "id": "xxx", + "description": "Iteration1", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + } + } + }, + { + "id": "TranslateMyZhCNVideo2", + "displayName": "hello.mp4", + "description": "Translate video from en-US to zh-CN.", + "input": { + "sourceLocale": "en-US", + "targetLocale": "zh-CN", + "voiceKind": "PlatformVoice", + "videoFileUrl": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx" + }, + "createdDateTime": "2023-04-01T05:30:00.000Z", + "latestIteration": { + "id": "TranslateMyZhCNVideo2-Edit2", + "description": "Iteration1", + "status": "Failed", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + } + }, + "latestSucceededIteration": { + "id": "xxx", + "description": "Iteration1", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + } + } + }, + { + "id": "TranslateMyZhCNVideo3", + "displayName": "hello.mp4", + "description": "Translate video from en-US to zh-CN.", + "input": { + "sourceLocale": "en-US", + "targetLocale": "zh-CN", + "voiceKind": "PlatformVoice", + "videoFileUrl": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx" + }, + "createdDateTime": "2023-04-01T05:30:00.000Z", + "latestIteration": { + "id": "Initial", + "description": "Iteration1", + "status": "Completed", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + } + }, + "latestSucceededIteration": { + "id": "Initial", + "description": "Iteration1", + "input": { + "speakerCount": 3, + "subtitleMaxCharCountPerSegment": 80, + "webvttFile": { + "url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx", + "kind": "MetadataJson" + } + } + } + } + ], + "nextLink": "https://eastus.api.cognitive.microsoft.com/video-translation/translations?skip=2&maxpagesize=2&api-version=2024-05-20-preview" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/Speech/VideoTranslation/readme.md b/specification/cognitiveservices/data-plane/Speech/VideoTranslation/readme.md new file mode 100644 index 000000000000..c612d3768e6c --- /dev/null +++ b/specification/cognitiveservices/data-plane/Speech/VideoTranslation/readme.md @@ -0,0 +1,24 @@ +# Cognitive Services VideoTranslation SDKs + +> see https://aka.ms/autorest + +Configuration for generating VideoTranslation SDK. + +The current release for the VideoTranslation is `release_2024_05_20_preview`. + +``` yaml +tag: release_2024_05_20_preview +add-credentials: true +openapi-type: data-plane +``` + +# Releases + +## VideoTranslation 2024-05-20-preview + +These settings apply only when `--tag=release_2024_05_20_preview` is specified on the command line. + +```yaml $(tag) == 'release_2024_05_20_preview' +input-file: + - preview/2024-05-20-preview/VideoTranslation.json +```