Skip to content

Commit

Permalink
[VideoTranslation] Initial add TypedSpec and swagger (Azure#29572)
Browse files Browse the repository at this point in the history
  • Loading branch information
DapengLi2016 authored Sep 11, 2024
1 parent 3519c80 commit f5321f9
Show file tree
Hide file tree
Showing 22 changed files with 2,393 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
13 changes: 13 additions & 0 deletions specification/cognitiveservices/Speech.VideoTranslation/client.tsp
Original file line number Diff line number Diff line change
@@ -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;
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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": {}
}
}
}
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
}
}
Loading

0 comments on commit f5321f9

Please sign in to comment.