Class: RunApi::Suno::Resources::BlendLyrics
- Inherits:
-
Object
- Object
- RunApi::Suno::Resources::BlendLyrics
- Includes:
- Core::ResourceHelpers
- Defined in:
- lib/runapi/suno/resources/blend_lyrics.rb
Overview
Blends two caller-authored lyrics texts into a new lyrics result.
Constant Summary collapse
- ENDPOINT =
"/api/v1/suno/blend_lyrics"- RESPONSE_CLASS =
Types::BlendLyricsResponse
- COMPLETED_RESPONSE_CLASS =
Types::CompletedBlendLyricsResponse
Instance Method Summary collapse
- #create(options: nil, **params) ⇒ Object
- #get(id, options: nil) ⇒ Object
-
#initialize(http) ⇒ BlendLyrics
constructor
A new instance of BlendLyrics.
- #run(options: nil, **params) ⇒ Object
Constructor Details
#initialize(http) ⇒ BlendLyrics
Returns a new instance of BlendLyrics.
14 15 16 |
# File 'lib/runapi/suno/resources/blend_lyrics.rb', line 14 def initialize(http) @http = http end |
Instance Method Details
#create(options: nil, **params) ⇒ Object
23 24 25 26 27 |
# File 'lib/runapi/suno/resources/blend_lyrics.rb', line 23 def create(options: nil, **params) params = compact_params(params) validate_contract!(CONTRACT["blend-lyrics"], params) request(:post, ENDPOINT, body: params, options: ) end |
#get(id, options: nil) ⇒ Object
29 30 31 |
# File 'lib/runapi/suno/resources/blend_lyrics.rb', line 29 def get(id, options: nil) request(:get, "#{ENDPOINT}/#{id}", options: ) end |
#run(options: nil, **params) ⇒ Object
18 19 20 21 |
# File 'lib/runapi/suno/resources/blend_lyrics.rb', line 18 def run(options: nil, **params) task = create(options: , **params) poll_until_complete { get(task.id, options: ) } end |