From 78dee39b22997960b50e36a858e892dcc20396c1 Mon Sep 17 00:00:00 2001 From: Sean McGrail Date: Mon, 23 Dec 2019 12:16:04 -0800 Subject: [PATCH] Updated service models and regenerated (#3047) --- .../2017-10-26/api-2.json | 7 +- .../2017-10-26/docs-2.json | 8 +- .../2017-10-26/service-2.json | 350 ------------------ service/transcribestreamingservice/api.go | 26 +- 4 files changed, 24 insertions(+), 367 deletions(-) delete mode 100755 models/apis/transcribe-streaming/2017-10-26/service-2.json diff --git a/models/apis/transcribe-streaming/2017-10-26/api-2.json b/models/apis/transcribe-streaming/2017-10-26/api-2.json index 839aad2d821..e9dc6a14092 100755 --- a/models/apis/transcribe-streaming/2017-10-26/api-2.json +++ b/models/apis/transcribe-streaming/2017-10-26/api-2.json @@ -101,8 +101,8 @@ "ItemType":{ "type":"string", "enum":[ - "PRONUNCIATION", - "PUNCTUATION" + "pronunciation", + "punctuation" ] }, "LanguageCode":{ @@ -112,7 +112,8 @@ "en-GB", "es-US", "fr-CA", - "fr-FR" + "fr-FR", + "en-AU" ] }, "LimitExceededException":{ diff --git a/models/apis/transcribe-streaming/2017-10-26/docs-2.json b/models/apis/transcribe-streaming/2017-10-26/docs-2.json index 8f6f7b88fba..7945a1be246 100755 --- a/models/apis/transcribe-streaming/2017-10-26/docs-2.json +++ b/models/apis/transcribe-streaming/2017-10-26/docs-2.json @@ -44,7 +44,7 @@ "Boolean": { "base": null, "refs": { - "Result$IsPartial": "

true to indicate that Amazon Transcribe has additional transcription data to send, false to indicate that this is the last transcription result for the audio stream.

" + "Result$IsPartial": "

Amazon Transcribe divides the incoming audio stream into segments at natural points in the audio. Transcription results are returned based on these segments.

The IsPartial field is true to indicate that Amazon Transcribe has additional transcription data to send, false to indicate that this is the last transcription result for the segment.

" } }, "ConflictException": { @@ -58,8 +58,8 @@ "refs": { "Item$StartTime": "

The offset from the beginning of the audio stream to the beginning of the audio that resulted in the item.

", "Item$EndTime": "

The offset from the beginning of the audio stream to the end of the audio that resulted in the item.

", - "Result$StartTime": "

The offset in milliseconds from the beginning of the audio stream to the beginning of the result.

", - "Result$EndTime": "

The offset in milliseconds from the beginning of the audio stream to the end of the result.

" + "Result$StartTime": "

The offset in seconds from the beginning of the audio stream to the beginning of the result.

", + "Result$EndTime": "

The offset in seconds from the beginning of the audio stream to the end of the result.

" } }, "InternalFailureException": { @@ -89,7 +89,7 @@ "LanguageCode": { "base": null, "refs": { - "StartStreamTranscriptionRequest$LanguageCode": "

Indicates the language used in the input audio stream.

", + "StartStreamTranscriptionRequest$LanguageCode": "

Indicates the source language used in the input audio stream.

", "StartStreamTranscriptionResponse$LanguageCode": "

The language code for the input audio stream.

" } }, diff --git a/models/apis/transcribe-streaming/2017-10-26/service-2.json b/models/apis/transcribe-streaming/2017-10-26/service-2.json deleted file mode 100755 index 01f0257f968..00000000000 --- a/models/apis/transcribe-streaming/2017-10-26/service-2.json +++ /dev/null @@ -1,350 +0,0 @@ -{ - "version":"2.0", - "metadata":{ - "apiVersion":"2017-10-26", - "endpointPrefix":"transcribestreaming", - "protocol":"rest-json", - "protocolSettings":{"h2":"eventstream"}, - "serviceFullName":"Amazon Transcribe Streaming Service", - "serviceId":"Transcribe Streaming", - "signatureVersion":"v4", - "signingName":"transcribe", - "uid":"transcribe-streaming-2017-10-26" - }, - "operations":{ - "StartStreamTranscription":{ - "name":"StartStreamTranscription", - "http":{ - "method":"POST", - "requestUri":"/stream-transcription" - }, - "input":{"shape":"StartStreamTranscriptionRequest"}, - "output":{"shape":"StartStreamTranscriptionResponse"}, - "errors":[ - {"shape":"BadRequestException"}, - {"shape":"LimitExceededException"}, - {"shape":"InternalFailureException"}, - {"shape":"ConflictException"} - ], - "documentation":"

Starts a bidirectional HTTP2 stream where audio is streamed to Amazon Transcribe and the transcription results are streamed to your application.

The following are encoded as HTTP2 headers:

" - } - }, - "shapes":{ - "Alternative":{ - "type":"structure", - "members":{ - "Transcript":{ - "shape":"String", - "documentation":"

The text that was transcribed from the audio.

" - }, - "Items":{ - "shape":"ItemList", - "documentation":"

One or more alternative interpretations of the input audio.

" - } - }, - "documentation":"

A list of possible transcriptions for the audio.

" - }, - "AlternativeList":{ - "type":"list", - "member":{"shape":"Alternative"} - }, - "AudioChunk":{"type":"blob"}, - "AudioEvent":{ - "type":"structure", - "members":{ - "AudioChunk":{ - "shape":"AudioChunk", - "documentation":"

An audio blob that contains the next part of the audio that you want to transcribe.

", - "eventpayload":true - } - }, - "documentation":"

Provides a wrapper for the audio chunks that you are sending.

", - "event":true - }, - "AudioStream":{ - "type":"structure", - "members":{ - "AudioEvent":{ - "shape":"AudioEvent", - "documentation":"

A blob of audio from your application. You audio stream consists of one or more audio events.

" - } - }, - "documentation":"

Represents the audio stream from your application to Amazon Transcribe.

", - "eventstream":true - }, - "BadRequestException":{ - "type":"structure", - "members":{ - "Message":{"shape":"String"} - }, - "documentation":"

One or more arguments to the StartStreamTranscription operation was invalid. For example, MediaEncoding was not set to pcm or LanguageCode was not set to a valid code. Check the parameters and try your request again.

", - "error":{"httpStatusCode":400}, - "exception":true - }, - "Boolean":{"type":"boolean"}, - "ConflictException":{ - "type":"structure", - "members":{ - "Message":{"shape":"String"} - }, - "documentation":"

A new stream started with the same session ID. The current stream has been terminated.

", - "error":{"httpStatusCode":409}, - "exception":true - }, - "Double":{"type":"double"}, - "InternalFailureException":{ - "type":"structure", - "members":{ - "Message":{"shape":"String"} - }, - "documentation":"

A problem occurred while processing the audio. Amazon Transcribe terminated processing. Try your request again.

", - "error":{"httpStatusCode":500}, - "exception":true, - "fault":true - }, - "Item":{ - "type":"structure", - "members":{ - "StartTime":{ - "shape":"Double", - "documentation":"

The offset from the beginning of the audio stream to the beginning of the audio that resulted in the item.

" - }, - "EndTime":{ - "shape":"Double", - "documentation":"

The offset from the beginning of the audio stream to the end of the audio that resulted in the item.

" - }, - "Type":{ - "shape":"ItemType", - "documentation":"

The type of the item. PRONUNCIATION indicates that the item is a word that was recognized in the input audio. PUNCTUATION indicates that the item was interpreted as a pause in the input audio.

" - }, - "Content":{ - "shape":"String", - "documentation":"

The word or punctuation that was recognized in the input audio.

" - } - }, - "documentation":"

A word or phrase transcribed from the input audio.

" - }, - "ItemList":{ - "type":"list", - "member":{"shape":"Item"} - }, - "ItemType":{ - "type":"string", - "enum":[ - "PRONUNCIATION", - "PUNCTUATION" - ] - }, - "LanguageCode":{ - "type":"string", - "enum":[ - "en-US", - "en-GB", - "es-US", - "fr-CA", - "fr-FR" - ] - }, - "LimitExceededException":{ - "type":"structure", - "members":{ - "Message":{"shape":"String"} - }, - "documentation":"

You have exceeded the maximum number of concurrent transcription streams, are starting transcription streams too quickly, or the maximum audio length of 4 hours. Wait until a stream has finished processing, or break your audio stream into smaller chunks and try your request again.

", - "error":{"httpStatusCode":429}, - "exception":true - }, - "MediaEncoding":{ - "type":"string", - "enum":["pcm"] - }, - "MediaSampleRateHertz":{ - "type":"integer", - "max":48000, - "min":8000 - }, - "RequestId":{"type":"string"}, - "Result":{ - "type":"structure", - "members":{ - "ResultId":{ - "shape":"String", - "documentation":"

A unique identifier for the result.

" - }, - "StartTime":{ - "shape":"Double", - "documentation":"

The offset in milliseconds from the beginning of the audio stream to the beginning of the result.

" - }, - "EndTime":{ - "shape":"Double", - "documentation":"

The offset in milliseconds from the beginning of the audio stream to the end of the result.

" - }, - "IsPartial":{ - "shape":"Boolean", - "documentation":"

true to indicate that Amazon Transcribe has additional transcription data to send, false to indicate that this is the last transcription result for the audio stream.

" - }, - "Alternatives":{ - "shape":"AlternativeList", - "documentation":"

A list of possible transcriptions for the audio. Each alternative typically contains one item that contains the result of the transcription.

" - } - }, - "documentation":"

The result of transcribing a portion of the input audio stream.

" - }, - "ResultList":{ - "type":"list", - "member":{"shape":"Result"} - }, - "SessionId":{ - "type":"string", - "pattern":"[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" - }, - "StartStreamTranscriptionRequest":{ - "type":"structure", - "required":[ - "LanguageCode", - "MediaSampleRateHertz", - "MediaEncoding", - "AudioStream" - ], - "members":{ - "LanguageCode":{ - "shape":"LanguageCode", - "documentation":"

Indicates the language used in the input audio stream.

", - "location":"header", - "locationName":"x-amzn-transcribe-language-code" - }, - "MediaSampleRateHertz":{ - "shape":"MediaSampleRateHertz", - "documentation":"

The sample rate, in Hertz, of the input audio. We suggest that you use 8000 Hz for low quality audio and 16000 Hz for high quality audio.

", - "location":"header", - "locationName":"x-amzn-transcribe-sample-rate" - }, - "MediaEncoding":{ - "shape":"MediaEncoding", - "documentation":"

The encoding used for the input audio.

", - "location":"header", - "locationName":"x-amzn-transcribe-media-encoding" - }, - "VocabularyName":{ - "shape":"VocabularyName", - "documentation":"

The name of the vocabulary to use when processing the transcription job.

", - "location":"header", - "locationName":"x-amzn-transcribe-vocabulary-name" - }, - "SessionId":{ - "shape":"SessionId", - "documentation":"

A identifier for the transcription session. Use this parameter when you want to retry a session. If you don't provide a session ID, Amazon Transcribe will generate one for you and return it in the response.

", - "location":"header", - "locationName":"x-amzn-transcribe-session-id" - }, - "AudioStream":{ - "shape":"AudioStream", - "documentation":"

PCM-encoded stream of audio blobs. The audio stream is encoded as an HTTP2 data frame.

" - } - }, - "payload":"AudioStream" - }, - "StartStreamTranscriptionResponse":{ - "type":"structure", - "members":{ - "RequestId":{ - "shape":"RequestId", - "documentation":"

An identifier for the streaming transcription.

", - "location":"header", - "locationName":"x-amzn-request-id" - }, - "LanguageCode":{ - "shape":"LanguageCode", - "documentation":"

The language code for the input audio stream.

", - "location":"header", - "locationName":"x-amzn-transcribe-language-code" - }, - "MediaSampleRateHertz":{ - "shape":"MediaSampleRateHertz", - "documentation":"

The sample rate for the input audio stream. Use 8000 Hz for low quality audio and 16000 Hz for high quality audio.

", - "location":"header", - "locationName":"x-amzn-transcribe-sample-rate" - }, - "MediaEncoding":{ - "shape":"MediaEncoding", - "documentation":"

The encoding used for the input audio stream.

", - "location":"header", - "locationName":"x-amzn-transcribe-media-encoding" - }, - "VocabularyName":{ - "shape":"VocabularyName", - "documentation":"

The name of the vocabulary used when processing the job.

", - "location":"header", - "locationName":"x-amzn-transcribe-vocabulary-name" - }, - "SessionId":{ - "shape":"SessionId", - "documentation":"

An identifier for a specific transcription session.

", - "location":"header", - "locationName":"x-amzn-transcribe-session-id" - }, - "TranscriptResultStream":{ - "shape":"TranscriptResultStream", - "documentation":"

Represents the stream of transcription events from Amazon Transcribe to your application.

" - } - }, - "payload":"TranscriptResultStream" - }, - "String":{"type":"string"}, - "Transcript":{ - "type":"structure", - "members":{ - "Results":{ - "shape":"ResultList", - "documentation":"

Result objects that contain the results of transcribing a portion of the input audio stream. The array can be empty.

" - } - }, - "documentation":"

The transcription in a TranscriptEvent.

" - }, - "TranscriptEvent":{ - "type":"structure", - "members":{ - "Transcript":{ - "shape":"Transcript", - "documentation":"

The transcription of the audio stream. The transcription is composed of all of the items in the results list.

" - } - }, - "documentation":"

Represents a set of transcription results from the server to the client. It contains one or more segments of the transcription.

", - "event":true - }, - "TranscriptResultStream":{ - "type":"structure", - "members":{ - "TranscriptEvent":{ - "shape":"TranscriptEvent", - "documentation":"

A portion of the transcription of the audio stream. Events are sent periodically from Amazon Transcribe to your application. The event can be a partial transcription of a section of the audio stream, or it can be the entire transcription of that portion of the audio stream.

" - }, - "BadRequestException":{ - "shape":"BadRequestException", - "documentation":"

A client error occurred when the stream was created. Check the parameters of the request and try your request again.

" - }, - "LimitExceededException":{ - "shape":"LimitExceededException", - "documentation":"

Your client has exceeded one of the Amazon Transcribe limits, typically the limit on audio length. Break your audio stream into smaller chunks and try your request again.

" - }, - "InternalFailureException":{ - "shape":"InternalFailureException", - "documentation":"

A problem occurred while processing the audio. Amazon Transcribe terminated processing.

" - }, - "ConflictException":{ - "shape":"ConflictException", - "documentation":"

A new stream started with the same session ID. The current stream has been terminated.

" - } - }, - "documentation":"

Represents the transcription result stream from Amazon Transcribe to your application.

", - "eventstream":true - }, - "VocabularyName":{ - "type":"string", - "max":200, - "min":1, - "pattern":"^[0-9a-zA-Z._-]+" - } - }, - "documentation":"

Operations and objects for transcribing streaming speech to text.

" -} diff --git a/service/transcribestreamingservice/api.go b/service/transcribestreamingservice/api.go index ec9fda8ca5c..cadfdfcafd9 100644 --- a/service/transcribestreamingservice/api.go +++ b/service/transcribestreamingservice/api.go @@ -813,20 +813,23 @@ type Result struct { // contains one item that contains the result of the transcription. Alternatives []*Alternative `type:"list"` - // The offset in milliseconds from the beginning of the audio stream to the - // end of the result. + // The offset in seconds from the beginning of the audio stream to the end of + // the result. EndTime *float64 `type:"double"` - // true to indicate that Amazon Transcribe has additional transcription data - // to send, false to indicate that this is the last transcription result for - // the audio stream. + // Amazon Transcribe divides the incoming audio stream into segments at natural + // points in the audio. Transcription results are returned based on these segments. + // + // The IsPartial field is true to indicate that Amazon Transcribe has additional + // transcription data to send, false to indicate that this is the last transcription + // result for the segment. IsPartial *bool `type:"boolean"` // A unique identifier for the result. ResultId *string `type:"string"` - // The offset in milliseconds from the beginning of the audio stream to the - // beginning of the result. + // The offset in seconds from the beginning of the audio stream to the beginning + // of the result. StartTime *float64 `type:"double"` } @@ -873,7 +876,7 @@ func (s *Result) SetStartTime(v float64) *Result { type StartStreamTranscriptionInput struct { _ struct{} `type:"structure" payload:"AudioStream"` - // Indicates the language used in the input audio stream. + // Indicates the source language used in the input audio stream. // // LanguageCode is a required field LanguageCode *string `location:"header" locationName:"x-amzn-transcribe-language-code" type:"string" required:"true" enum:"LanguageCode"` @@ -1246,10 +1249,10 @@ func unmarshalerForTranscriptResultStreamEvent(eventType string) (eventstreamapi const ( // ItemTypePronunciation is a ItemType enum value - ItemTypePronunciation = "PRONUNCIATION" + ItemTypePronunciation = "pronunciation" // ItemTypePunctuation is a ItemType enum value - ItemTypePunctuation = "PUNCTUATION" + ItemTypePunctuation = "punctuation" ) const ( @@ -1267,6 +1270,9 @@ const ( // LanguageCodeFrFr is a LanguageCode enum value LanguageCodeFrFr = "fr-FR" + + // LanguageCodeEnAu is a LanguageCode enum value + LanguageCodeEnAu = "en-AU" ) const (