Class: Wavix::SpeechAnalytics::File::Client
- Inherits:
-
Object
- Object
- Wavix::SpeechAnalytics::File::Client
- Defined in:
- lib/wavix/speech_analytics/file/client.rb
Instance Method Summary collapse
-
#get(request_options: {}, **params) ⇒ untyped
Returns the original audio file submitted for the transcription identified by
request_id. - #initialize(client:) ⇒ void constructor
Constructor Details
#initialize(client:) ⇒ void
10 11 12 |
# File 'lib/wavix/speech_analytics/file/client.rb', line 10 def initialize(client:) @client = client end |
Instance Method Details
#get(request_options: {}, **params) ⇒ untyped
Returns the original audio file submitted for the transcription identified by request_id.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/wavix/speech_analytics/file/client.rb', line 26 def get(request_options: {}, **params) params = Wavix::Internal::Types::Utils.normalize_keys(params) request = Wavix::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "v1/speech-analytics/#{URI.encode_uri_component(params[:request_id].to_s)}/file", request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Wavix::Errors::TimeoutError end code = response.code.to_i return if code.between?(200, 299) error_class = Wavix::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end |