aws-sdk-transcribestreamingservice 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/aws-sdk-transcribestreamingservice.rb +49 -0
- data/lib/aws-sdk-transcribestreamingservice/async_client.rb +437 -0
- data/lib/aws-sdk-transcribestreamingservice/client.rb +254 -0
- data/lib/aws-sdk-transcribestreamingservice/client_api.rb +151 -0
- data/lib/aws-sdk-transcribestreamingservice/customizations.rb +0 -0
- data/lib/aws-sdk-transcribestreamingservice/errors.rb +14 -0
- data/lib/aws-sdk-transcribestreamingservice/event_streams.rb +86 -0
- data/lib/aws-sdk-transcribestreamingservice/resource.rb +23 -0
- data/lib/aws-sdk-transcribestreamingservice/types.rb +361 -0
- metadata +90 -0
@@ -0,0 +1,254 @@
|
|
1
|
+
# WARNING ABOUT GENERATED CODE
|
2
|
+
#
|
3
|
+
# This file is generated. See the contributing guide for more information:
|
4
|
+
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
|
+
#
|
6
|
+
# WARNING ABOUT GENERATED CODE
|
7
|
+
|
8
|
+
require 'seahorse/client/plugins/content_length.rb'
|
9
|
+
require 'aws-sdk-core/plugins/credentials_configuration.rb'
|
10
|
+
require 'aws-sdk-core/plugins/logging.rb'
|
11
|
+
require 'aws-sdk-core/plugins/param_converter.rb'
|
12
|
+
require 'aws-sdk-core/plugins/param_validator.rb'
|
13
|
+
require 'aws-sdk-core/plugins/user_agent.rb'
|
14
|
+
require 'aws-sdk-core/plugins/helpful_socket_errors.rb'
|
15
|
+
require 'aws-sdk-core/plugins/retry_errors.rb'
|
16
|
+
require 'aws-sdk-core/plugins/global_configuration.rb'
|
17
|
+
require 'aws-sdk-core/plugins/regional_endpoint.rb'
|
18
|
+
require 'aws-sdk-core/plugins/endpoint_discovery.rb'
|
19
|
+
require 'aws-sdk-core/plugins/endpoint_pattern.rb'
|
20
|
+
require 'aws-sdk-core/plugins/response_paging.rb'
|
21
|
+
require 'aws-sdk-core/plugins/stub_responses.rb'
|
22
|
+
require 'aws-sdk-core/plugins/idempotency_token.rb'
|
23
|
+
require 'aws-sdk-core/plugins/jsonvalue_converter.rb'
|
24
|
+
require 'aws-sdk-core/plugins/client_metrics_plugin.rb'
|
25
|
+
require 'aws-sdk-core/plugins/client_metrics_send_plugin.rb'
|
26
|
+
require 'aws-sdk-core/plugins/signature_v4.rb'
|
27
|
+
require 'aws-sdk-core/plugins/protocols/rest_json.rb'
|
28
|
+
require 'aws-sdk-core/plugins/event_stream_configuration.rb'
|
29
|
+
|
30
|
+
Aws::Plugins::GlobalConfiguration.add_identifier(:transcribestreamingservice)
|
31
|
+
|
32
|
+
module Aws::TranscribeStreamingService
|
33
|
+
class Client < Seahorse::Client::Base
|
34
|
+
|
35
|
+
include Aws::ClientStubs
|
36
|
+
|
37
|
+
@identifier = :transcribestreamingservice
|
38
|
+
|
39
|
+
set_api(ClientApi::API)
|
40
|
+
|
41
|
+
add_plugin(Seahorse::Client::Plugins::ContentLength)
|
42
|
+
add_plugin(Aws::Plugins::CredentialsConfiguration)
|
43
|
+
add_plugin(Aws::Plugins::Logging)
|
44
|
+
add_plugin(Aws::Plugins::ParamConverter)
|
45
|
+
add_plugin(Aws::Plugins::ParamValidator)
|
46
|
+
add_plugin(Aws::Plugins::UserAgent)
|
47
|
+
add_plugin(Aws::Plugins::HelpfulSocketErrors)
|
48
|
+
add_plugin(Aws::Plugins::RetryErrors)
|
49
|
+
add_plugin(Aws::Plugins::GlobalConfiguration)
|
50
|
+
add_plugin(Aws::Plugins::RegionalEndpoint)
|
51
|
+
add_plugin(Aws::Plugins::EndpointDiscovery)
|
52
|
+
add_plugin(Aws::Plugins::EndpointPattern)
|
53
|
+
add_plugin(Aws::Plugins::ResponsePaging)
|
54
|
+
add_plugin(Aws::Plugins::StubResponses)
|
55
|
+
add_plugin(Aws::Plugins::IdempotencyToken)
|
56
|
+
add_plugin(Aws::Plugins::JsonvalueConverter)
|
57
|
+
add_plugin(Aws::Plugins::ClientMetricsPlugin)
|
58
|
+
add_plugin(Aws::Plugins::ClientMetricsSendPlugin)
|
59
|
+
add_plugin(Aws::Plugins::SignatureV4)
|
60
|
+
add_plugin(Aws::Plugins::Protocols::RestJson)
|
61
|
+
add_plugin(Aws::Plugins::EventStreamConfiguration)
|
62
|
+
|
63
|
+
# @overload initialize(options)
|
64
|
+
# @param [Hash] options
|
65
|
+
# @option options [required, Aws::CredentialProvider] :credentials
|
66
|
+
# Your AWS credentials. This can be an instance of any one of the
|
67
|
+
# following classes:
|
68
|
+
#
|
69
|
+
# * `Aws::Credentials` - Used for configuring static, non-refreshing
|
70
|
+
# credentials.
|
71
|
+
#
|
72
|
+
# * `Aws::InstanceProfileCredentials` - Used for loading credentials
|
73
|
+
# from an EC2 IMDS on an EC2 instance.
|
74
|
+
#
|
75
|
+
# * `Aws::SharedCredentials` - Used for loading credentials from a
|
76
|
+
# shared file, such as `~/.aws/config`.
|
77
|
+
#
|
78
|
+
# * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
|
79
|
+
#
|
80
|
+
# When `:credentials` are not configured directly, the following
|
81
|
+
# locations will be searched for credentials:
|
82
|
+
#
|
83
|
+
# * `Aws.config[:credentials]`
|
84
|
+
# * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
|
85
|
+
# * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
|
86
|
+
# * `~/.aws/credentials`
|
87
|
+
# * `~/.aws/config`
|
88
|
+
# * EC2 IMDS instance profile - When used by default, the timeouts are
|
89
|
+
# very aggressive. Construct and pass an instance of
|
90
|
+
# `Aws::InstanceProfileCredentails` to enable retries and extended
|
91
|
+
# timeouts.
|
92
|
+
#
|
93
|
+
# @option options [required, String] :region
|
94
|
+
# The AWS region to connect to. The configured `:region` is
|
95
|
+
# used to determine the service `:endpoint`. When not passed,
|
96
|
+
# a default `:region` is search for in the following locations:
|
97
|
+
#
|
98
|
+
# * `Aws.config[:region]`
|
99
|
+
# * `ENV['AWS_REGION']`
|
100
|
+
# * `ENV['AMAZON_REGION']`
|
101
|
+
# * `ENV['AWS_DEFAULT_REGION']`
|
102
|
+
# * `~/.aws/credentials`
|
103
|
+
# * `~/.aws/config`
|
104
|
+
#
|
105
|
+
# @option options [String] :access_key_id
|
106
|
+
#
|
107
|
+
# @option options [Boolean] :active_endpoint_cache (false)
|
108
|
+
# When set to `true`, a thread polling for endpoints will be running in
|
109
|
+
# the background every 60 secs (default). Defaults to `false`.
|
110
|
+
#
|
111
|
+
# @option options [Boolean] :client_side_monitoring (false)
|
112
|
+
# When `true`, client-side metrics will be collected for all API requests from
|
113
|
+
# this client.
|
114
|
+
#
|
115
|
+
# @option options [String] :client_side_monitoring_client_id ("")
|
116
|
+
# Allows you to provide an identifier for this client which will be attached to
|
117
|
+
# all generated client side metrics. Defaults to an empty string.
|
118
|
+
#
|
119
|
+
# @option options [Integer] :client_side_monitoring_port (31000)
|
120
|
+
# Required for publishing client metrics. The port that the client side monitoring
|
121
|
+
# agent is running on, where client metrics will be published via UDP.
|
122
|
+
#
|
123
|
+
# @option options [Aws::ClientSideMonitoring::Publisher] :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher)
|
124
|
+
# Allows you to provide a custom client-side monitoring publisher class. By default,
|
125
|
+
# will use the Client Side Monitoring Agent Publisher.
|
126
|
+
#
|
127
|
+
# @option options [Boolean] :convert_params (true)
|
128
|
+
# When `true`, an attempt is made to coerce request parameters into
|
129
|
+
# the required types.
|
130
|
+
#
|
131
|
+
# @option options [Boolean] :disable_host_prefix_injection (false)
|
132
|
+
# Set to true to disable SDK automatically adding host prefix
|
133
|
+
# to default service endpoint when available.
|
134
|
+
#
|
135
|
+
# @option options [String] :endpoint
|
136
|
+
# The client endpoint is normally constructed from the `:region`
|
137
|
+
# option. You should only configure an `:endpoint` when connecting
|
138
|
+
# to test endpoints. This should be avalid HTTP(S) URI.
|
139
|
+
#
|
140
|
+
# @option options [Integer] :endpoint_cache_max_entries (1000)
|
141
|
+
# Used for the maximum size limit of the LRU cache storing endpoints data
|
142
|
+
# for endpoint discovery enabled operations. Defaults to 1000.
|
143
|
+
#
|
144
|
+
# @option options [Integer] :endpoint_cache_max_threads (10)
|
145
|
+
# Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.
|
146
|
+
#
|
147
|
+
# @option options [Integer] :endpoint_cache_poll_interval (60)
|
148
|
+
# When :endpoint_discovery and :active_endpoint_cache is enabled,
|
149
|
+
# Use this option to config the time interval in seconds for making
|
150
|
+
# requests fetching endpoints information. Defaults to 60 sec.
|
151
|
+
#
|
152
|
+
# @option options [Boolean] :endpoint_discovery (false)
|
153
|
+
# When set to `true`, endpoint discovery will be enabled for operations when available. Defaults to `false`.
|
154
|
+
#
|
155
|
+
# @option options [Proc] :event_stream_handler
|
156
|
+
# When an EventStream or Proc object is provided, it will be used as callback for each chunk of event stream response received along the way.
|
157
|
+
#
|
158
|
+
# @option options [Proc] :input_event_stream_handler
|
159
|
+
# When an EventStream or Proc object is provided, it can be used for sending events for the event stream.
|
160
|
+
#
|
161
|
+
# @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
|
162
|
+
# The log formatter.
|
163
|
+
#
|
164
|
+
# @option options [Symbol] :log_level (:info)
|
165
|
+
# The log level to send messages to the `:logger` at.
|
166
|
+
#
|
167
|
+
# @option options [Logger] :logger
|
168
|
+
# The Logger instance to send log messages to. If this option
|
169
|
+
# is not set, logging will be disabled.
|
170
|
+
#
|
171
|
+
# @option options [Proc] :output_event_stream_handler
|
172
|
+
# When an EventStream or Proc object is provided, it will be used as callback for each chunk of event stream response received along the way.
|
173
|
+
#
|
174
|
+
# @option options [String] :profile ("default")
|
175
|
+
# Used when loading credentials from the shared credentials file
|
176
|
+
# at HOME/.aws/credentials. When not specified, 'default' is used.
|
177
|
+
#
|
178
|
+
# @option options [Float] :retry_base_delay (0.3)
|
179
|
+
# The base delay in seconds used by the default backoff function.
|
180
|
+
#
|
181
|
+
# @option options [Symbol] :retry_jitter (:none)
|
182
|
+
# A delay randomiser function used by the default backoff function. Some predefined functions can be referenced by name - :none, :equal, :full, otherwise a Proc that takes and returns a number.
|
183
|
+
#
|
184
|
+
# @see https://www.awsarchitectureblog.com/2015/03/backoff.html
|
185
|
+
#
|
186
|
+
# @option options [Integer] :retry_limit (3)
|
187
|
+
# The maximum number of times to retry failed requests. Only
|
188
|
+
# ~ 500 level server errors and certain ~ 400 level client errors
|
189
|
+
# are retried. Generally, these are throttling errors, data
|
190
|
+
# checksum errors, networking errors, timeout errors and auth
|
191
|
+
# errors from expired credentials.
|
192
|
+
#
|
193
|
+
# @option options [Integer] :retry_max_delay (0)
|
194
|
+
# The maximum number of seconds to delay between retries (0 for no limit) used by the default backoff function.
|
195
|
+
#
|
196
|
+
# @option options [String] :secret_access_key
|
197
|
+
#
|
198
|
+
# @option options [String] :session_token
|
199
|
+
#
|
200
|
+
# @option options [Boolean] :stub_responses (false)
|
201
|
+
# Causes the client to return stubbed responses. By default
|
202
|
+
# fake responses are generated and returned. You can specify
|
203
|
+
# the response data to return or errors to raise by calling
|
204
|
+
# {ClientStubs#stub_responses}. See {ClientStubs} for more information.
|
205
|
+
#
|
206
|
+
# ** Please note ** When response stubbing is enabled, no HTTP
|
207
|
+
# requests are made, and retries are disabled.
|
208
|
+
#
|
209
|
+
# @option options [Boolean] :validate_params (true)
|
210
|
+
# When `true`, request parameters are validated before
|
211
|
+
# sending the request.
|
212
|
+
#
|
213
|
+
def initialize(*args)
|
214
|
+
super
|
215
|
+
end
|
216
|
+
|
217
|
+
# @!group API Operations
|
218
|
+
|
219
|
+
# @!endgroup
|
220
|
+
|
221
|
+
# @param params ({})
|
222
|
+
# @api private
|
223
|
+
def build_request(operation_name, params = {})
|
224
|
+
handlers = @handlers.for(operation_name)
|
225
|
+
context = Seahorse::Client::RequestContext.new(
|
226
|
+
operation_name: operation_name,
|
227
|
+
operation: config.api.operation(operation_name),
|
228
|
+
client: self,
|
229
|
+
params: params,
|
230
|
+
config: config)
|
231
|
+
context[:gem_name] = 'aws-sdk-transcribestreamingservice'
|
232
|
+
context[:gem_version] = '1.0.0'
|
233
|
+
Seahorse::Client::Request.new(handlers, context)
|
234
|
+
end
|
235
|
+
|
236
|
+
# @api private
|
237
|
+
# @deprecated
|
238
|
+
def waiter_names
|
239
|
+
[]
|
240
|
+
end
|
241
|
+
|
242
|
+
class << self
|
243
|
+
|
244
|
+
# @api private
|
245
|
+
attr_reader :identifier
|
246
|
+
|
247
|
+
# @api private
|
248
|
+
def errors_module
|
249
|
+
Errors
|
250
|
+
end
|
251
|
+
|
252
|
+
end
|
253
|
+
end
|
254
|
+
end
|
@@ -0,0 +1,151 @@
|
|
1
|
+
# WARNING ABOUT GENERATED CODE
|
2
|
+
#
|
3
|
+
# This file is generated. See the contributing guide for more information:
|
4
|
+
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
|
+
#
|
6
|
+
# WARNING ABOUT GENERATED CODE
|
7
|
+
|
8
|
+
module Aws::TranscribeStreamingService
|
9
|
+
# @api private
|
10
|
+
module ClientApi
|
11
|
+
|
12
|
+
include Seahorse::Model
|
13
|
+
|
14
|
+
Alternative = Shapes::StructureShape.new(name: 'Alternative')
|
15
|
+
AlternativeList = Shapes::ListShape.new(name: 'AlternativeList')
|
16
|
+
AudioChunk = Shapes::BlobShape.new(name: 'AudioChunk')
|
17
|
+
AudioEvent = Shapes::StructureShape.new(name: 'AudioEvent')
|
18
|
+
AudioStream = Shapes::StructureShape.new(name: 'AudioStream')
|
19
|
+
BadRequestException = Shapes::StructureShape.new(name: 'BadRequestException')
|
20
|
+
Boolean = Shapes::BooleanShape.new(name: 'Boolean')
|
21
|
+
ConflictException = Shapes::StructureShape.new(name: 'ConflictException')
|
22
|
+
Double = Shapes::FloatShape.new(name: 'Double')
|
23
|
+
InternalFailureException = Shapes::StructureShape.new(name: 'InternalFailureException')
|
24
|
+
Item = Shapes::StructureShape.new(name: 'Item')
|
25
|
+
ItemList = Shapes::ListShape.new(name: 'ItemList')
|
26
|
+
ItemType = Shapes::StringShape.new(name: 'ItemType')
|
27
|
+
LanguageCode = Shapes::StringShape.new(name: 'LanguageCode')
|
28
|
+
LimitExceededException = Shapes::StructureShape.new(name: 'LimitExceededException')
|
29
|
+
MediaEncoding = Shapes::StringShape.new(name: 'MediaEncoding')
|
30
|
+
MediaSampleRateHertz = Shapes::IntegerShape.new(name: 'MediaSampleRateHertz')
|
31
|
+
RequestId = Shapes::StringShape.new(name: 'RequestId')
|
32
|
+
Result = Shapes::StructureShape.new(name: 'Result')
|
33
|
+
ResultList = Shapes::ListShape.new(name: 'ResultList')
|
34
|
+
SessionId = Shapes::StringShape.new(name: 'SessionId')
|
35
|
+
StartStreamTranscriptionRequest = Shapes::StructureShape.new(name: 'StartStreamTranscriptionRequest')
|
36
|
+
StartStreamTranscriptionResponse = Shapes::StructureShape.new(name: 'StartStreamTranscriptionResponse')
|
37
|
+
String = Shapes::StringShape.new(name: 'String')
|
38
|
+
Transcript = Shapes::StructureShape.new(name: 'Transcript')
|
39
|
+
TranscriptEvent = Shapes::StructureShape.new(name: 'TranscriptEvent')
|
40
|
+
TranscriptResultStream = Shapes::StructureShape.new(name: 'TranscriptResultStream')
|
41
|
+
VocabularyName = Shapes::StringShape.new(name: 'VocabularyName')
|
42
|
+
|
43
|
+
Alternative.add_member(:transcript, Shapes::ShapeRef.new(shape: String, location_name: "Transcript"))
|
44
|
+
Alternative.add_member(:items, Shapes::ShapeRef.new(shape: ItemList, location_name: "Items"))
|
45
|
+
Alternative.struct_class = Types::Alternative
|
46
|
+
|
47
|
+
AlternativeList.member = Shapes::ShapeRef.new(shape: Alternative)
|
48
|
+
|
49
|
+
AudioEvent.add_member(:audio_chunk, Shapes::ShapeRef.new(shape: AudioChunk, eventpayload: true, eventpayload_type: 'blob', location_name: "AudioChunk", metadata: {"eventpayload"=>true}))
|
50
|
+
AudioEvent.struct_class = Types::AudioEvent
|
51
|
+
|
52
|
+
AudioStream.add_member(:audio_event, Shapes::ShapeRef.new(shape: AudioEvent, event: true, location_name: "AudioEvent"))
|
53
|
+
AudioStream.struct_class = Types::AudioStream
|
54
|
+
|
55
|
+
BadRequestException.add_member(:message, Shapes::ShapeRef.new(shape: String, location_name: "Message"))
|
56
|
+
BadRequestException.struct_class = Types::BadRequestException
|
57
|
+
|
58
|
+
ConflictException.add_member(:message, Shapes::ShapeRef.new(shape: String, location_name: "Message"))
|
59
|
+
ConflictException.struct_class = Types::ConflictException
|
60
|
+
|
61
|
+
InternalFailureException.add_member(:message, Shapes::ShapeRef.new(shape: String, location_name: "Message"))
|
62
|
+
InternalFailureException.struct_class = Types::InternalFailureException
|
63
|
+
|
64
|
+
Item.add_member(:start_time, Shapes::ShapeRef.new(shape: Double, location_name: "StartTime"))
|
65
|
+
Item.add_member(:end_time, Shapes::ShapeRef.new(shape: Double, location_name: "EndTime"))
|
66
|
+
Item.add_member(:type, Shapes::ShapeRef.new(shape: ItemType, location_name: "Type"))
|
67
|
+
Item.add_member(:content, Shapes::ShapeRef.new(shape: String, location_name: "Content"))
|
68
|
+
Item.struct_class = Types::Item
|
69
|
+
|
70
|
+
ItemList.member = Shapes::ShapeRef.new(shape: Item)
|
71
|
+
|
72
|
+
LimitExceededException.add_member(:message, Shapes::ShapeRef.new(shape: String, location_name: "Message"))
|
73
|
+
LimitExceededException.struct_class = Types::LimitExceededException
|
74
|
+
|
75
|
+
Result.add_member(:result_id, Shapes::ShapeRef.new(shape: String, location_name: "ResultId"))
|
76
|
+
Result.add_member(:start_time, Shapes::ShapeRef.new(shape: Double, location_name: "StartTime"))
|
77
|
+
Result.add_member(:end_time, Shapes::ShapeRef.new(shape: Double, location_name: "EndTime"))
|
78
|
+
Result.add_member(:is_partial, Shapes::ShapeRef.new(shape: Boolean, location_name: "IsPartial"))
|
79
|
+
Result.add_member(:alternatives, Shapes::ShapeRef.new(shape: AlternativeList, location_name: "Alternatives"))
|
80
|
+
Result.struct_class = Types::Result
|
81
|
+
|
82
|
+
ResultList.member = Shapes::ShapeRef.new(shape: Result)
|
83
|
+
|
84
|
+
StartStreamTranscriptionRequest.add_member(:language_code, Shapes::ShapeRef.new(shape: LanguageCode, required: true, location: "header", location_name: "x-amzn-transcribe-language-code"))
|
85
|
+
StartStreamTranscriptionRequest.add_member(:media_sample_rate_hertz, Shapes::ShapeRef.new(shape: MediaSampleRateHertz, required: true, location: "header", location_name: "x-amzn-transcribe-sample-rate"))
|
86
|
+
StartStreamTranscriptionRequest.add_member(:media_encoding, Shapes::ShapeRef.new(shape: MediaEncoding, required: true, location: "header", location_name: "x-amzn-transcribe-media-encoding"))
|
87
|
+
StartStreamTranscriptionRequest.add_member(:vocabulary_name, Shapes::ShapeRef.new(shape: VocabularyName, location: "header", location_name: "x-amzn-transcribe-vocabulary-name"))
|
88
|
+
StartStreamTranscriptionRequest.add_member(:session_id, Shapes::ShapeRef.new(shape: SessionId, location: "header", location_name: "x-amzn-transcribe-session-id"))
|
89
|
+
StartStreamTranscriptionRequest.add_member(:audio_stream, Shapes::ShapeRef.new(shape: AudioStream, required: true, eventstream: true, location_name: "AudioStream"))
|
90
|
+
StartStreamTranscriptionRequest.struct_class = Types::StartStreamTranscriptionRequest
|
91
|
+
StartStreamTranscriptionRequest[:payload] = :audio_stream
|
92
|
+
StartStreamTranscriptionRequest[:payload_member] = StartStreamTranscriptionRequest.member(:audio_stream)
|
93
|
+
|
94
|
+
StartStreamTranscriptionResponse.add_member(:request_id, Shapes::ShapeRef.new(shape: RequestId, location: "header", location_name: "x-amzn-request-id"))
|
95
|
+
StartStreamTranscriptionResponse.add_member(:language_code, Shapes::ShapeRef.new(shape: LanguageCode, location: "header", location_name: "x-amzn-transcribe-language-code"))
|
96
|
+
StartStreamTranscriptionResponse.add_member(:media_sample_rate_hertz, Shapes::ShapeRef.new(shape: MediaSampleRateHertz, location: "header", location_name: "x-amzn-transcribe-sample-rate"))
|
97
|
+
StartStreamTranscriptionResponse.add_member(:media_encoding, Shapes::ShapeRef.new(shape: MediaEncoding, location: "header", location_name: "x-amzn-transcribe-media-encoding"))
|
98
|
+
StartStreamTranscriptionResponse.add_member(:vocabulary_name, Shapes::ShapeRef.new(shape: VocabularyName, location: "header", location_name: "x-amzn-transcribe-vocabulary-name"))
|
99
|
+
StartStreamTranscriptionResponse.add_member(:session_id, Shapes::ShapeRef.new(shape: SessionId, location: "header", location_name: "x-amzn-transcribe-session-id"))
|
100
|
+
StartStreamTranscriptionResponse.add_member(:transcript_result_stream, Shapes::ShapeRef.new(shape: TranscriptResultStream, eventstream: true, location_name: "TranscriptResultStream"))
|
101
|
+
StartStreamTranscriptionResponse.struct_class = Types::StartStreamTranscriptionResponse
|
102
|
+
StartStreamTranscriptionResponse[:payload] = :transcript_result_stream
|
103
|
+
StartStreamTranscriptionResponse[:payload_member] = StartStreamTranscriptionResponse.member(:transcript_result_stream)
|
104
|
+
|
105
|
+
Transcript.add_member(:results, Shapes::ShapeRef.new(shape: ResultList, location_name: "Results"))
|
106
|
+
Transcript.struct_class = Types::Transcript
|
107
|
+
|
108
|
+
TranscriptEvent.add_member(:transcript, Shapes::ShapeRef.new(shape: Transcript, location_name: "Transcript"))
|
109
|
+
TranscriptEvent.struct_class = Types::TranscriptEvent
|
110
|
+
|
111
|
+
TranscriptResultStream.add_member(:transcript_event, Shapes::ShapeRef.new(shape: TranscriptEvent, event: true, location_name: "TranscriptEvent"))
|
112
|
+
TranscriptResultStream.add_member(:bad_request_exception, Shapes::ShapeRef.new(shape: BadRequestException, event: true, location_name: "BadRequestException"))
|
113
|
+
TranscriptResultStream.add_member(:limit_exceeded_exception, Shapes::ShapeRef.new(shape: LimitExceededException, event: true, location_name: "LimitExceededException"))
|
114
|
+
TranscriptResultStream.add_member(:internal_failure_exception, Shapes::ShapeRef.new(shape: InternalFailureException, event: true, location_name: "InternalFailureException"))
|
115
|
+
TranscriptResultStream.add_member(:conflict_exception, Shapes::ShapeRef.new(shape: ConflictException, event: true, location_name: "ConflictException"))
|
116
|
+
TranscriptResultStream.struct_class = Types::TranscriptResultStream
|
117
|
+
|
118
|
+
|
119
|
+
# @api private
|
120
|
+
API = Seahorse::Model::Api.new.tap do |api|
|
121
|
+
|
122
|
+
api.version = "2017-10-26"
|
123
|
+
|
124
|
+
api.metadata = {
|
125
|
+
"apiVersion" => "2017-10-26",
|
126
|
+
"endpointPrefix" => "transcribestreaming",
|
127
|
+
"protocol" => "rest-json",
|
128
|
+
"protocolSettings" => {"h2"=>"eventstream"},
|
129
|
+
"serviceFullName" => "Amazon Transcribe Streaming Service",
|
130
|
+
"serviceId" => "Transcribe Streaming",
|
131
|
+
"signatureVersion" => "v4",
|
132
|
+
"signingName" => "transcribe",
|
133
|
+
"uid" => "transcribe-streaming-2017-10-26",
|
134
|
+
}
|
135
|
+
|
136
|
+
api.add_operation(:start_stream_transcription, Seahorse::Model::Operation.new.tap do |o|
|
137
|
+
o.name = "StartStreamTranscription"
|
138
|
+
o.http_method = "POST"
|
139
|
+
o.http_request_uri = "/stream-transcription"
|
140
|
+
o.input = Shapes::ShapeRef.new(shape: StartStreamTranscriptionRequest)
|
141
|
+
o.output = Shapes::ShapeRef.new(shape: StartStreamTranscriptionResponse)
|
142
|
+
o.errors << Shapes::ShapeRef.new(shape: BadRequestException)
|
143
|
+
o.errors << Shapes::ShapeRef.new(shape: LimitExceededException)
|
144
|
+
o.errors << Shapes::ShapeRef.new(shape: InternalFailureException)
|
145
|
+
o.errors << Shapes::ShapeRef.new(shape: ConflictException)
|
146
|
+
o.async = true
|
147
|
+
end)
|
148
|
+
end
|
149
|
+
|
150
|
+
end
|
151
|
+
end
|
File without changes
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# WARNING ABOUT GENERATED CODE
|
2
|
+
#
|
3
|
+
# This file is generated. See the contributing guide for more information:
|
4
|
+
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
|
+
#
|
6
|
+
# WARNING ABOUT GENERATED CODE
|
7
|
+
|
8
|
+
module Aws::TranscribeStreamingService
|
9
|
+
module Errors
|
10
|
+
|
11
|
+
extend Aws::Errors::DynamicErrors
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# WARNING ABOUT GENERATED CODE
|
2
|
+
#
|
3
|
+
# This file is generated. See the contributing guide for more information:
|
4
|
+
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
|
+
#
|
6
|
+
# WARNING ABOUT GENERATED CODE
|
7
|
+
|
8
|
+
module Aws::TranscribeStreamingService
|
9
|
+
module EventStreams
|
10
|
+
class AudioStream
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
@event_emitter = Aws::EventEmitter.new
|
14
|
+
end
|
15
|
+
|
16
|
+
# @option params [String, IO] :audio_chunk
|
17
|
+
# An audio blob that contains the next part of the audio that you want
|
18
|
+
# to transcribe.
|
19
|
+
#
|
20
|
+
def signal_audio_event_event(params = {})
|
21
|
+
@event_emitter.emit(:audio_event, params)
|
22
|
+
end
|
23
|
+
|
24
|
+
def signal_end_stream
|
25
|
+
@event_emitter.emit(:end_stream, {})
|
26
|
+
end
|
27
|
+
|
28
|
+
# @api private
|
29
|
+
# @return Aws::EventEmitter
|
30
|
+
attr_reader :event_emitter
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
class TranscriptResultStream
|
35
|
+
|
36
|
+
def initialize
|
37
|
+
@event_emitter = Aws::EventEmitter.new
|
38
|
+
end
|
39
|
+
|
40
|
+
def on_transcript_event_event(&block)
|
41
|
+
@event_emitter.on(:transcript_event, Proc.new)
|
42
|
+
end
|
43
|
+
|
44
|
+
def on_bad_request_exception_event(&block)
|
45
|
+
@event_emitter.on(:bad_request_exception, Proc.new)
|
46
|
+
end
|
47
|
+
|
48
|
+
def on_limit_exceeded_exception_event(&block)
|
49
|
+
@event_emitter.on(:limit_exceeded_exception, Proc.new)
|
50
|
+
end
|
51
|
+
|
52
|
+
def on_internal_failure_exception_event(&block)
|
53
|
+
@event_emitter.on(:internal_failure_exception, Proc.new)
|
54
|
+
end
|
55
|
+
|
56
|
+
def on_conflict_exception_event(&block)
|
57
|
+
@event_emitter.on(:conflict_exception, Proc.new)
|
58
|
+
end
|
59
|
+
|
60
|
+
def on_error_event(&block)
|
61
|
+
@event_emitter.on(:error, Proc.new)
|
62
|
+
end
|
63
|
+
|
64
|
+
def on_initial_response_event(&block)
|
65
|
+
@event_emitter.on(:initial_response, Proc.new)
|
66
|
+
end
|
67
|
+
|
68
|
+
def on_event(&block)
|
69
|
+
on_transcript_event_event(&block)
|
70
|
+
on_bad_request_exception_event(&block)
|
71
|
+
on_limit_exceeded_exception_event(&block)
|
72
|
+
on_internal_failure_exception_event(&block)
|
73
|
+
on_conflict_exception_event(&block)
|
74
|
+
on_error_event(&block)
|
75
|
+
on_initial_response_event(&block)
|
76
|
+
end
|
77
|
+
|
78
|
+
# @api private
|
79
|
+
# @return Aws::EventEmitter
|
80
|
+
attr_reader :event_emitter
|
81
|
+
|
82
|
+
end
|
83
|
+
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|