Class: RunApi::FishAudio::Resources::GetVoice
- Inherits:
-
Object
- Object
- RunApi::FishAudio::Resources::GetVoice
- Includes:
- Core::ResourceHelpers
- Defined in:
- lib/runapi/fish_audio/resources/get_voice.rb
Overview
Gets one reusable voice owned by the current account.
Constant Summary collapse
- ENDPOINT =
"/api/v1/fish_audio/voices"- RESPONSE_CLASS =
Types::VoiceResponse
Instance Method Summary collapse
-
#initialize(http) ⇒ GetVoice
constructor
A new instance of GetVoice.
- #run(voice_id:, options: nil) ⇒ Object
Constructor Details
#initialize(http) ⇒ GetVoice
Returns a new instance of GetVoice.
13 14 15 |
# File 'lib/runapi/fish_audio/resources/get_voice.rb', line 13 def initialize(http) @http = http end |
Instance Method Details
#run(voice_id:, options: nil) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/runapi/fish_audio/resources/get_voice.rb', line 17 def run(voice_id:, options: nil) params = compact_params(voice_id: voice_id) validate_contract!(CONTRACT["get-voice"], params) path = "#{ENDPOINT}/#{URI.encode_uri_component(voice_id)}" request(:get, path, options: ) end |