Class: Rocksky::Resources::Mirror

Inherits:
Base
  • Object
show all
Defined in:
lib/rocksky/resources/mirror.rb

Overview

‘app.rocksky.mirror.*` endpoints. Require an authenticated client.

Instance Attribute Summary

Attributes inherited from Base

#http

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Rocksky::Resources::Base

Instance Method Details

#get_mirror_sourcesObject

List configured mirror sources for the authenticated user.



6
7
8
# File 'lib/rocksky/resources/mirror.rb', line 6

def get_mirror_sources
  query("app.rocksky.mirror.getMirrorSources")
end

#put_mirror_source(provider:, enabled: nil, external_username: nil, api_key: nil) ⇒ Object

Configure a mirror source (e.g. Last.fm, ListenBrainz).



11
12
13
14
15
16
17
18
19
# File 'lib/rocksky/resources/mirror.rb', line 11

def put_mirror_source(provider:, enabled: nil, external_username: nil, api_key: nil)
  body = {
    provider: provider,
    enabled: enabled,
    externalUsername: external_username,
    apiKey: api_key
  }.compact
  procedure("app.rocksky.mirror.putMirrorSource", body: body)
end