File: types.go

package info (click to toggle)
golang-github-aws-aws-sdk-go-v2 1.17.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 384,244 kB
  • sloc: java: 13,538; makefile: 400; sh: 137
file content (395 lines) | stat: -rw-r--r-- 13,443 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
// Code generated by smithy-go-codegen DO NOT EDIT.

package types

import (
	smithydocument "github.com/aws/smithy-go/document"
)

// A list of possible transcriptions for the audio.
type Alternative struct {

	// Contains the entities identified as personally identifiable information (PII) in
	// the transcription output.
	Entities []Entity

	// One or more alternative interpretations of the input audio.
	Items []Item

	// The text that was transcribed from the audio.
	Transcript *string

	noSmithyDocumentSerde
}

// Provides a wrapper for the audio chunks that you are sending. For information on
// audio encoding in Amazon Transcribe, see Speech input
// (https://docs.aws.amazon.com/transcribe/latest/dg/input.html). For information
// on audio encoding formats in Amazon Transcribe Medical, see Speech input
// (https://docs.aws.amazon.com/transcribe/latest/dg/input-med.html).
type AudioEvent struct {

	// An audio blob that contains the next part of the audio that you want to
	// transcribe. The maximum audio chunk size is 32 KB.
	AudioChunk []byte

	noSmithyDocumentSerde
}

// Represents the audio stream from your application to Amazon Transcribe.
//
// The following types satisfy this interface:
//
//	AudioStreamMemberAudioEvent
type AudioStream interface {
	isAudioStream()
}

// A blob of audio from your application. You audio stream consists of one or more
// audio events. For information on audio encoding formats in Amazon Transcribe,
// see Speech input (https://docs.aws.amazon.com/transcribe/latest/dg/input.html).
// For information on audio encoding formats in Amazon Transcribe Medical, see
// Speech input (https://docs.aws.amazon.com/transcribe/latest/dg/input-med.html).
// For more information on stream encoding in Amazon Transcribe, see Event stream
// encoding (https://docs.aws.amazon.com/transcribe/latest/dg/event-stream.html).
// For information on stream encoding in Amazon Transcribe Medical, see Event
// stream encoding
// (https://docs.aws.amazon.com/transcribe/latest/dg/event-stream-med.html).
type AudioStreamMemberAudioEvent struct {
	Value AudioEvent

	noSmithyDocumentSerde
}

func (*AudioStreamMemberAudioEvent) isAudioStream() {}

// The entity identified as personally identifiable information (PII).
type Entity struct {

	// The category of information identified in this entity; for example, PII.
	Category *string

	// A value between zero and one that Amazon Transcribe assigns to PII identified in
	// the source audio. Larger values indicate a higher confidence in PII
	// identification.
	Confidence *float64

	// The words in the transcription output that have been identified as a PII entity.
	Content *string

	// The end time of speech that was identified as PII.
	EndTime float64

	// The start time of speech that was identified as PII.
	StartTime float64

	// The type of PII identified in this entity; for example, name or credit card
	// number.
	Type *string

	noSmithyDocumentSerde
}

// A word, phrase, or punctuation mark that is transcribed from the input audio.
type Item struct {

	// A value between zero and one for an item that is a confidence score that Amazon
	// Transcribe assigns to each word or phrase that it transcribes.
	Confidence *float64

	// The word or punctuation that was recognized in the input audio.
	Content *string

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

	// If speaker identification is enabled, shows the speakers identified in the media
	// stream.
	Speaker *string

	// If partial result stabilization has been enabled, indicates whether the word or
	// phrase in the item is stable. If Stable is true, the result is stable.
	Stable *bool

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

	// 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.
	Type ItemType

	// Indicates whether a word in the item matches a word in the vocabulary filter
	// you've chosen for your media stream. If true then a word in the item matches
	// your vocabulary filter.
	VocabularyFilterMatch bool

	noSmithyDocumentSerde
}

// The language codes of the identified languages and their associated confidence
// scores. The confidence score is a value between zero and one; a larger value
// indicates a higher confidence in the identified language.
type LanguageWithScore struct {

	// The language code of the language identified by Amazon Transcribe.
	LanguageCode LanguageCode

	// The confidence score for the associated language code. Confidence scores are
	// values between zero and one; larger values indicate a higher confidence in the
	// identified language.
	Score float64

	noSmithyDocumentSerde
}

// A list of possible transcriptions for the audio.
type MedicalAlternative struct {

	// Contains the medical entities identified as personal health information in the
	// transcription output.
	Entities []MedicalEntity

	// A list of objects that contains words and punctuation marks that represents one
	// or more interpretations of the input audio.
	Items []MedicalItem

	// The text that was transcribed from the audio.
	Transcript *string

	noSmithyDocumentSerde
}

// The medical entity identified as personal health information.
type MedicalEntity struct {

	// The type of personal health information of the medical entity.
	Category *string

	// A value between zero and one that Amazon Transcribe Medical assigned to the
	// personal health information that it identified in the source audio. Larger
	// values indicate that Amazon Transcribe Medical has higher confidence in the
	// personal health information that it identified.
	Confidence *float64

	// The word or words in the transcription output that have been identified as a
	// medical entity.
	Content *string

	// The end time of the speech that was identified as a medical entity.
	EndTime float64

	// The start time of the speech that was identified as a medical entity.
	StartTime float64

	noSmithyDocumentSerde
}

// A word, phrase, or punctuation mark that is transcribed from the input audio.
type MedicalItem struct {

	// A value between 0 and 1 for an item that is a confidence score that Amazon
	// Transcribe Medical assigns to each word that it transcribes.
	Confidence *float64

	// The word or punctuation mark that was recognized in the input audio.
	Content *string

	// The number of seconds into an audio stream that indicates the creation time of
	// an item.
	EndTime float64

	// If speaker identification is enabled, shows the integer values that correspond
	// to the different speakers identified in the stream. For example, if the value of
	// Speaker in the stream is either a 0 or a 1, that indicates that Amazon
	// Transcribe Medical has identified two speakers in the stream. The value of 0
	// corresponds to one speaker and the value of 1 corresponds to the other speaker.
	Speaker *string

	// The number of seconds into an audio stream that indicates the creation time of
	// an item.
	StartTime float64

	// 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, such as a period to indicate the end
	// of a sentence.
	Type ItemType

	noSmithyDocumentSerde
}

// The results of transcribing a portion of the input audio stream.
type MedicalResult struct {

	// A list of possible transcriptions of the audio. Each alternative typically
	// contains one Item that contains the result of the transcription.
	Alternatives []MedicalAlternative

	// When channel identification is enabled, Amazon Transcribe Medical transcribes
	// the speech from each audio channel separately. You can use ChannelId to retrieve
	// the transcription results for a single channel in your audio stream.
	ChannelId *string

	// The time, in seconds, from the beginning of the audio stream to the end of the
	// result.
	EndTime float64

	// Amazon Transcribe Medical 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 Medical
	// has additional transcription data to send. The IsPartial field is false to
	// indicate that this is the last transcription result for the segment.
	IsPartial bool

	// A unique identifier for the result.
	ResultId *string

	// The time, in seconds, from the beginning of the audio stream to the beginning of
	// the result.
	StartTime float64

	noSmithyDocumentSerde
}

// The medical transcript in a MedicalTranscriptEvent.
type MedicalTranscript struct {

	// MedicalResult objects that contain the results of transcribing a portion of the
	// input audio stream. The array can be empty.
	Results []MedicalResult

	noSmithyDocumentSerde
}

// Represents a set of transcription results from the server to the client. It
// contains one or more segments of the transcription.
type MedicalTranscriptEvent struct {

	// The transcription of the audio stream. The transcription is composed of all of
	// the items in the results list.
	Transcript *MedicalTranscript

	noSmithyDocumentSerde
}

// Represents the transcription result stream from Amazon Transcribe Medical to
// your application.
//
// The following types satisfy this interface:
//
//	MedicalTranscriptResultStreamMemberTranscriptEvent
type MedicalTranscriptResultStream interface {
	isMedicalTranscriptResultStream()
}

// A portion of the transcription of the audio stream. Events are sent periodically
// from Amazon Transcribe Medical 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.
type MedicalTranscriptResultStreamMemberTranscriptEvent struct {
	Value MedicalTranscriptEvent

	noSmithyDocumentSerde
}

func (*MedicalTranscriptResultStreamMemberTranscriptEvent) isMedicalTranscriptResultStream() {}

// The result of transcribing a portion of the input audio stream.
type Result struct {

	// A list of possible transcriptions for the audio. Each alternative typically
	// contains one item that contains the result of the transcription.
	Alternatives []Alternative

	// When channel identification is enabled, Amazon Transcribe transcribes the speech
	// from each audio channel separately. You can use ChannelId to retrieve the
	// transcription results for a single channel in your audio stream.
	ChannelId *string

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

	// 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

	// The language code of the identified language in your media stream.
	LanguageCode LanguageCode

	// The language code of the dominant language identified in your media.
	LanguageIdentification []LanguageWithScore

	// A unique identifier for the result.
	ResultId *string

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

	noSmithyDocumentSerde
}

// The transcription in a TranscriptEvent.
type Transcript struct {

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

	noSmithyDocumentSerde
}

// Represents a set of transcription results from the server to the client. It
// contains one or more segments of the transcription.
type TranscriptEvent struct {

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

	noSmithyDocumentSerde
}

// Represents the transcription result stream from Amazon Transcribe to your
// application.
//
// The following types satisfy this interface:
//
//	TranscriptResultStreamMemberTranscriptEvent
type TranscriptResultStream interface {
	isTranscriptResultStream()
}

// 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.
type TranscriptResultStreamMemberTranscriptEvent struct {
	Value TranscriptEvent

	noSmithyDocumentSerde
}

func (*TranscriptResultStreamMemberTranscriptEvent) isTranscriptResultStream() {}

type noSmithyDocumentSerde = smithydocument.NoSerde

// UnknownUnionMember is returned when a union member is returned over the wire,
// but has an unknown tag.
type UnknownUnionMember struct {
	Tag   string
	Value []byte

	noSmithyDocumentSerde
}

func (*UnknownUnionMember) isAudioStream()                   {}
func (*UnknownUnionMember) isMedicalTranscriptResultStream() {}
func (*UnknownUnionMember) isTranscriptResultStream()        {}