Class: Retell::SDK::Unofficial::API::Voice
- Inherits:
-
Object
- Object
- Retell::SDK::Unofficial::API::Voice
- Defined in:
- lib/retell/sdk/unofficial/api/voice.rb
Instance Method Summary collapse
-
#initialize(client) ⇒ Voice
constructor
A new instance of Voice.
- #list(extra_headers: nil, extra_query: nil, extra_body: nil, timeout: nil) ⇒ Object
- #retrieve(voice_or_id, extra_headers: nil, extra_query: nil, extra_body: nil, timeout: nil) ⇒ Object
Constructor Details
#initialize(client) ⇒ Voice
Returns a new instance of Voice.
6 7 8 |
# File 'lib/retell/sdk/unofficial/api/voice.rb', line 6 def initialize(client) @client = client end |
Instance Method Details
#list(extra_headers: nil, extra_query: nil, extra_body: nil, timeout: nil) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/retell/sdk/unofficial/api/voice.rb', line 31 def list( extra_headers: nil, extra_query: nil, extra_body: nil, timeout: nil ) = @client.( extra_headers: extra_headers, extra_query: extra_query, extra_body: extra_body, timeout: timeout ) @client.get('/list-voices', **) end |
#retrieve(voice_or_id, extra_headers: nil, extra_query: nil, extra_body: nil, timeout: nil) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/retell/sdk/unofficial/api/voice.rb', line 10 def retrieve( voice_or_id, extra_headers: nil, extra_query: nil, extra_body: nil, timeout: nil ) voice_id = voice_or_id.is_a?(Retell::SDK::Unofficial::Voice) ? voice_or_id.voice_id : voice_or_id raise ArgumentError, "Expected a non-empty value for `voice_id` but received #{voice_id.inspect}" if voice_id.to_s.empty? = @client.( extra_headers: extra_headers, extra_query: extra_query, extra_body: extra_body, timeout: timeout ) @client.get("/get-voice/#{voice_id}", **) end |