songstats-ruby-sdk 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6e9cfa8f372c183dcde82286fa023415c8fb16b62c7f78652eef43d1128adaca
4
- data.tar.gz: 995c45f1acab79d840ce4a899577ba4a964284f3ceb5ce72b75bb221e120e22e
3
+ metadata.gz: 68f9bea062fc60a216913e84f5baee27b28f18711eb83c6b9e705a81ffe68a9b
4
+ data.tar.gz: 5b3dcd8661f8555c6315d0e304aad2069faf645d88d06389ae4ee3be52598211
5
5
  SHA512:
6
- metadata.gz: bbf2f0293a3b15963723911ee7679c464d4eb96bdd71468ccfd4e3fb3508021b297aa219252f90fcbf24381b2d2892ec2f423ad3bb4f0d3546342debac10dfeb
7
- data.tar.gz: e66e21ea1532cd8e0cc8fe6f350af45cd506df7a267a6c79a1a158338727805beeef8a83a0308dabad043d9185f707b232f8649468319d560be645c401f0a0f3
6
+ metadata.gz: f419d4f531a1ebc3d11149e946636c0561f039fac22e96b972f0f296fd34a6f43aa1cb7fa64e8aca374d9cda935b57484a2123f34232374b58e77465d3989148
7
+ data.tar.gz: 232391634c9586fdb9ea2d09501f27e9e44c6f4c9842b4d42ca5164ec7cc4a011e5325b44e8b6370cd133c575f137ad10c1b0fbe038191275df0e117ac18cd70
data/CHANGELOG.md CHANGED
@@ -2,9 +2,21 @@
2
2
 
3
3
  All notable changes to this project are documented in this file.
4
4
 
5
+ ## [0.2.0] - 2026-02-19
6
+
7
+ ### Changed
8
+
9
+ - Removed `charts` resource client from the SDK surface
10
+ - Removed `stations` resource client from the SDK surface
11
+ - Kept `info` endpoints:
12
+ - `client.info.sources` (`/sources`)
13
+ - `client.info.status` (`/status`)
14
+ - `client.info.definitions` (`/definitions`)
15
+
5
16
  ## [0.1.0] - 2026-02-19
6
17
 
7
18
  ### Added
19
+
8
20
  - Initial standalone Ruby SDK repo for Songstats Enterprise API (`/enterprise/v1`)
9
21
  - Full resource coverage:
10
22
  - `info`
data/README.md CHANGED
@@ -1,55 +1,114 @@
1
1
  # Songstats Ruby SDK
2
2
 
3
- Official Ruby Client SDK for the Songstats Enterprise API.
3
+ Official Ruby client for the **Songstats Enterprise API**.
4
4
 
5
- ## API Documentation
5
+ 📦 RubyGems: https://rubygems.org/gems/songstats-ruby-sdk
6
+ 📚 API Documentation: https://docs.songstats.com
6
7
 
7
- https://docs.songstats.com
8
+ ---
8
9
 
9
- ## Install
10
+ ## Requirements
10
11
 
11
- ```bash
12
- bundle install
13
- bundle exec rake test
14
- ```
12
+ - Ruby >= 3.0
15
13
 
16
- For local usage in another project:
14
+ ---
17
15
 
18
- ```ruby
19
- gem "songstats-ruby-sdk", path: "/path/to/songstats-ruby-sdk"
20
- ```
16
+ ## Installation
17
+
18
+ Add to your `Gemfile`:
19
+
20
+ gem "songstats-ruby-sdk"
21
+
22
+ Then install:
23
+
24
+ bundle install
25
+
26
+ Or install directly via RubyGems:
27
+
28
+ gem install songstats-ruby-sdk
29
+
30
+ ---
21
31
 
22
32
  ## Quick Start
23
33
 
24
- ```ruby
25
- require "songstats_sdk"
34
+ require "songstats_sdk"
35
+
36
+ client = SongstatsSDK::Client.new(
37
+ api_key: ENV["SONGSTATS_API_KEY"]
38
+ )
39
+
40
+ # API status
41
+ status = client.info.status
26
42
 
27
- client = SongstatsSDK::Client.new(api_key: "YOUR_API_KEY")
43
+ # Track information
44
+ track = client.tracks.info(
45
+ songstats_track_id: "abcd1234"
46
+ )
28
47
 
29
- status = client.info.status
30
- track = client.tracks.info(songstats_track_id: "abcd1234")
31
- artist_stats = client.artists.stats(songstats_artist_id: "abcd1234", source: "spotify")
32
- ```
48
+ # Artist statistics
49
+ artist_stats = client.artists.stats(
50
+ songstats_artist_id: "abcd1234",
51
+ source: "spotify"
52
+ )
53
+
54
+ ---
33
55
 
34
56
  ## Authentication
35
57
 
36
- The SDK sends your key in the `apikey` header, matching Songstats enterprise auth.
58
+ All requests include your API key in the `apikey` header.
59
+
60
+ You can generate an API key in your Songstats Enterprise dashboard.
61
+
62
+ We recommend storing your key securely in environment variables:
37
63
 
38
- ## Included Resource Clients
64
+ export SONGSTATS_API_KEY=your_key_here
65
+
66
+ ---
67
+
68
+ ## Available Resource Clients
39
69
 
40
70
  - `client.info`
41
71
  - `client.tracks`
42
72
  - `client.artists`
43
73
  - `client.collaborators`
44
74
  - `client.labels`
45
- - `client.charts`
46
- - `client.stations`
75
+
76
+ Info endpoints:
77
+ - `client.info.sources` -> `/sources`
78
+ - `client.info.status` -> `/status`
79
+ - `client.info.definitions` -> `/definitions`
80
+
81
+ ---
47
82
 
48
83
  ## Error Handling
49
84
 
50
- - `SongstatsSDK::SongstatsAPIError`: non-2xx HTTP response
51
- - `SongstatsSDK::SongstatsTransportError`: transport/connectivity failure
85
+ begin
86
+ client.tracks.info(songstats_track_id: "invalid")
87
+ rescue SongstatsSDK::SongstatsAPIError => e
88
+ puts "API error: #{e.message}"
89
+ rescue SongstatsSDK::SongstatsTransportError => e
90
+ puts "Transport error: #{e.message}"
91
+ end
92
+
93
+ ---
94
+
95
+ ## Development
96
+
97
+ To work on the SDK locally:
98
+
99
+ git clone https://github.com/songstats/songstats-ruby-sdk.git
100
+ cd songstats-ruby-sdk
101
+ bundle install
102
+ bundle exec rake test
103
+
104
+ ---
105
+
106
+ ## Versioning
107
+
108
+ This SDK follows Semantic Versioning (SemVer).
109
+
110
+ ---
52
111
 
53
- ## Route Coverage Audit
112
+ ## License
54
113
 
55
- See `docs/enterprise_routes_audit.md` for the Rails route to SDK method mapping.
114
+ MIT
@@ -1,6 +1,7 @@
1
1
  # Enterprise Routes Audit (Songstats Rails -> Ruby SDK)
2
2
 
3
3
  Audited against:
4
+
4
5
  - `/Users/Oskar/1001tl/config/routes.rb`
5
6
  - `/Users/Oskar/1001tl/app/controllers/enterprise/v1/*.rb`
6
7
  - `/Users/Oskar/1001tl/app/helpers/enterprise_helper.rb`
@@ -9,110 +10,98 @@ Authentication observed in Rails: `apikey` request header.
9
10
 
10
11
  ## `/enterprise/v1/info`
11
12
 
12
- | HTTP | Route | SDK Method |
13
- |---|---|---|
14
- | GET | `/sources` | `client.info.sources` |
15
- | GET | `/status` | `client.info.status` |
16
- | GET | `/uptime_check` | `client.info.uptime_check` |
17
- | GET | `/definitions` | `client.info.definitions` |
13
+ | HTTP | Route | SDK Method |
14
+ | ---- | --------------- | -------------------------- |
15
+ | GET | `/sources` | `client.info.sources` |
16
+ | GET | `/status` | `client.info.status` |
17
+ | GET | `/uptime_check` | `client.info.uptime_check` |
18
+ | GET | `/definitions` | `client.info.definitions` |
18
19
 
19
20
  ## `/enterprise/v1/tracks`
20
21
 
21
- | HTTP | Route | SDK Method |
22
- |---|---|---|
23
- | GET | `/info` | `client.tracks.info(...)` |
24
- | GET | `/stats` | `client.tracks.stats(...)` |
25
- | GET | `/historic_stats` | `client.tracks.historic_stats(...)` |
26
- | GET | `/search` | `client.tracks.search(q: ..., ...)` |
27
- | GET | `/activities` | `client.tracks.activities(...)` |
28
- | GET | `/comments` | `client.tracks.comments(...)` |
29
- | GET | `/songshare` | `client.tracks.songshare(...)` |
30
- | GET | `/locations` | `client.tracks.locations(...)` |
31
- | POST | `/link_request` | `client.tracks.add_link_request(link: ..., ...)` |
32
- | DELETE | `/link_request` | `client.tracks.remove_link_request(link: ..., ...)` |
33
- | POST | `/add_to_member_relevant_list` | `client.tracks.add_to_member_relevant_list(...)` |
22
+ | HTTP | Route | SDK Method |
23
+ | ------ | ----------------------------------- | ----------------------------------------------------- |
24
+ | GET | `/info` | `client.tracks.info(...)` |
25
+ | GET | `/stats` | `client.tracks.stats(...)` |
26
+ | GET | `/historic_stats` | `client.tracks.historic_stats(...)` |
27
+ | GET | `/search` | `client.tracks.search(q: ..., ...)` |
28
+ | GET | `/activities` | `client.tracks.activities(...)` |
29
+ | GET | `/comments` | `client.tracks.comments(...)` |
30
+ | GET | `/songshare` | `client.tracks.songshare(...)` |
31
+ | GET | `/locations` | `client.tracks.locations(...)` |
32
+ | POST | `/link_request` | `client.tracks.add_link_request(link: ..., ...)` |
33
+ | DELETE | `/link_request` | `client.tracks.remove_link_request(link: ..., ...)` |
34
+ | POST | `/add_to_member_relevant_list` | `client.tracks.add_to_member_relevant_list(...)` |
34
35
  | DELETE | `/remove_from_member_relevant_list` | `client.tracks.remove_from_member_relevant_list(...)` |
35
36
 
36
- ## `/enterprise/v1/charts`
37
-
38
- | HTTP | Route | SDK Method |
39
- |---|---|---|
40
- | GET | `/tracks` | `client.charts.tracks(country_code: ..., ...)` |
41
-
42
- ## `/enterprise/v1/stations`
43
-
44
- | HTTP | Route | SDK Method |
45
- |---|---|---|
46
- | POST | `/station_request` | `client.stations.station_request(...)` |
47
-
48
37
  ## `/enterprise/v1/artists`
49
38
 
50
- | HTTP | Route | SDK Method |
51
- |---|---|---|
52
- | GET | `/info` | `client.artists.info(...)` |
53
- | GET | `/stats` | `client.artists.stats(...)` |
54
- | GET | `/historic_stats` | `client.artists.historic_stats(...)` |
55
- | GET | `/audience` | `client.artists.audience(...)` |
56
- | GET | `/audience/details` | `client.artists.audience_details(country_code: ..., ...)` |
57
- | GET | `/catalog` | `client.artists.catalog(...)` |
58
- | GET | `/search` | `client.artists.search(q: ..., ...)` |
59
- | GET | `/activities` | `client.artists.activities(...)` |
60
- | GET | `/songshare` | `client.artists.songshare(...)` |
61
- | GET | `/top_tracks` | `client.artists.top_tracks(...)` |
62
- | GET | `/top_playlists` | `client.artists.top_playlists(...)` |
63
- | GET | `/top_curators` | `client.artists.top_curators(...)` |
64
- | GET | `/top_commentors` | `client.artists.top_commentors(...)` |
65
- | POST | `/link_request` | `client.artists.add_link_request(link: ..., ...)` |
66
- | DELETE | `/link_request` | `client.artists.remove_link_request(link: ..., ...)` |
67
- | POST | `/track_request` | `client.artists.add_track_request(...)` |
68
- | DELETE | `/track_request` | `client.artists.remove_track_request(...)` |
69
- | POST | `/add_to_member_relevant_list` | `client.artists.add_to_member_relevant_list(...)` |
70
- | DELETE | `/remove_from_member_relevant_list` | `client.artists.remove_from_member_relevant_list(...)` |
39
+ | HTTP | Route | SDK Method |
40
+ | ------ | ----------------------------------- | --------------------------------------------------------- |
41
+ | GET | `/info` | `client.artists.info(...)` |
42
+ | GET | `/stats` | `client.artists.stats(...)` |
43
+ | GET | `/historic_stats` | `client.artists.historic_stats(...)` |
44
+ | GET | `/audience` | `client.artists.audience(...)` |
45
+ | GET | `/audience/details` | `client.artists.audience_details(country_code: ..., ...)` |
46
+ | GET | `/catalog` | `client.artists.catalog(...)` |
47
+ | GET | `/search` | `client.artists.search(q: ..., ...)` |
48
+ | GET | `/activities` | `client.artists.activities(...)` |
49
+ | GET | `/songshare` | `client.artists.songshare(...)` |
50
+ | GET | `/top_tracks` | `client.artists.top_tracks(...)` |
51
+ | GET | `/top_playlists` | `client.artists.top_playlists(...)` |
52
+ | GET | `/top_curators` | `client.artists.top_curators(...)` |
53
+ | GET | `/top_commentors` | `client.artists.top_commentors(...)` |
54
+ | POST | `/link_request` | `client.artists.add_link_request(link: ..., ...)` |
55
+ | DELETE | `/link_request` | `client.artists.remove_link_request(link: ..., ...)` |
56
+ | POST | `/track_request` | `client.artists.add_track_request(...)` |
57
+ | DELETE | `/track_request` | `client.artists.remove_track_request(...)` |
58
+ | POST | `/add_to_member_relevant_list` | `client.artists.add_to_member_relevant_list(...)` |
59
+ | DELETE | `/remove_from_member_relevant_list` | `client.artists.remove_from_member_relevant_list(...)` |
71
60
 
72
61
  ## `/enterprise/v1/collaborators`
73
62
 
74
- | HTTP | Route | SDK Method |
75
- |---|---|---|
76
- | GET | `/info` | `client.collaborators.info(...)` |
77
- | GET | `/stats` | `client.collaborators.stats(...)` |
78
- | GET | `/historic_stats` | `client.collaborators.historic_stats(...)` |
79
- | GET | `/audience` | `client.collaborators.audience(...)` |
80
- | GET | `/audience/details` | `client.collaborators.audience_details(country_code: ..., ...)` |
81
- | GET | `/catalog` | `client.collaborators.catalog(...)` |
82
- | GET | `/search` | `client.collaborators.search(q: ..., ...)` |
83
- | GET | `/activities` | `client.collaborators.activities(...)` |
84
- | GET | `/songshare` | `client.collaborators.songshare(...)` |
85
- | GET | `/top_tracks` | `client.collaborators.top_tracks(...)` |
86
- | GET | `/top_playlists` | `client.collaborators.top_playlists(...)` |
87
- | GET | `/top_curators` | `client.collaborators.top_curators(...)` |
88
- | GET | `/top_commentors` | `client.collaborators.top_commentors(...)` |
89
- | POST | `/link_request` | `client.collaborators.add_link_request(link: ..., ...)` |
90
- | DELETE | `/link_request` | `client.collaborators.remove_link_request(link: ..., ...)` |
91
- | POST | `/track_request` | `client.collaborators.add_track_request(...)` |
92
- | DELETE | `/track_request` | `client.collaborators.remove_track_request(...)` |
93
- | POST | `/add_to_member_relevant_list` | `client.collaborators.add_to_member_relevant_list(...)` |
94
- | DELETE | `/remove_from_member_relevant_list` | `client.collaborators.remove_from_member_relevant_list(...)` |
63
+ | HTTP | Route | SDK Method |
64
+ | ------ | ----------------------------------- | --------------------------------------------------------------- |
65
+ | GET | `/info` | `client.collaborators.info(...)` |
66
+ | GET | `/stats` | `client.collaborators.stats(...)` |
67
+ | GET | `/historic_stats` | `client.collaborators.historic_stats(...)` |
68
+ | GET | `/audience` | `client.collaborators.audience(...)` |
69
+ | GET | `/audience/details` | `client.collaborators.audience_details(country_code: ..., ...)` |
70
+ | GET | `/catalog` | `client.collaborators.catalog(...)` |
71
+ | GET | `/search` | `client.collaborators.search(q: ..., ...)` |
72
+ | GET | `/activities` | `client.collaborators.activities(...)` |
73
+ | GET | `/songshare` | `client.collaborators.songshare(...)` |
74
+ | GET | `/top_tracks` | `client.collaborators.top_tracks(...)` |
75
+ | GET | `/top_playlists` | `client.collaborators.top_playlists(...)` |
76
+ | GET | `/top_curators` | `client.collaborators.top_curators(...)` |
77
+ | GET | `/top_commentors` | `client.collaborators.top_commentors(...)` |
78
+ | POST | `/link_request` | `client.collaborators.add_link_request(link: ..., ...)` |
79
+ | DELETE | `/link_request` | `client.collaborators.remove_link_request(link: ..., ...)` |
80
+ | POST | `/track_request` | `client.collaborators.add_track_request(...)` |
81
+ | DELETE | `/track_request` | `client.collaborators.remove_track_request(...)` |
82
+ | POST | `/add_to_member_relevant_list` | `client.collaborators.add_to_member_relevant_list(...)` |
83
+ | DELETE | `/remove_from_member_relevant_list` | `client.collaborators.remove_from_member_relevant_list(...)` |
95
84
 
96
85
  ## `/enterprise/v1/labels`
97
86
 
98
- | HTTP | Route | SDK Method |
99
- |---|---|---|
100
- | GET | `/info` | `client.labels.info(...)` |
101
- | GET | `/stats` | `client.labels.stats(...)` |
102
- | GET | `/historic_stats` | `client.labels.historic_stats(...)` |
103
- | GET | `/audience` | `client.labels.audience(...)` |
104
- | GET | `/audience/details` | `client.labels.audience_details(country_code: ..., ...)` |
105
- | GET | `/catalog` | `client.labels.catalog(...)` |
106
- | GET | `/search` | `client.labels.search(q: ..., ...)` |
107
- | GET | `/activities` | `client.labels.activities(...)` |
108
- | GET | `/songshare` | `client.labels.songshare(...)` |
109
- | GET | `/top_tracks` | `client.labels.top_tracks(...)` |
110
- | GET | `/top_playlists` | `client.labels.top_playlists(...)` |
111
- | GET | `/top_curators` | `client.labels.top_curators(...)` |
112
- | GET | `/top_commentors` | `client.labels.top_commentors(...)` |
113
- | POST | `/link_request` | `client.labels.add_link_request(link: ..., ...)` |
114
- | DELETE | `/link_request` | `client.labels.remove_link_request(link: ..., ...)` |
115
- | POST | `/track_request` | `client.labels.add_track_request(...)` |
116
- | DELETE | `/track_request` | `client.labels.remove_track_request(...)` |
117
- | POST | `/add_to_member_relevant_list` | `client.labels.add_to_member_relevant_list(...)` |
118
- | DELETE | `/remove_from_member_relevant_list` | `client.labels.remove_from_member_relevant_list(...)` |
87
+ | HTTP | Route | SDK Method |
88
+ | ------ | ----------------------------------- | -------------------------------------------------------- |
89
+ | GET | `/info` | `client.labels.info(...)` |
90
+ | GET | `/stats` | `client.labels.stats(...)` |
91
+ | GET | `/historic_stats` | `client.labels.historic_stats(...)` |
92
+ | GET | `/audience` | `client.labels.audience(...)` |
93
+ | GET | `/audience/details` | `client.labels.audience_details(country_code: ..., ...)` |
94
+ | GET | `/catalog` | `client.labels.catalog(...)` |
95
+ | GET | `/search` | `client.labels.search(q: ..., ...)` |
96
+ | GET | `/activities` | `client.labels.activities(...)` |
97
+ | GET | `/songshare` | `client.labels.songshare(...)` |
98
+ | GET | `/top_tracks` | `client.labels.top_tracks(...)` |
99
+ | GET | `/top_playlists` | `client.labels.top_playlists(...)` |
100
+ | GET | `/top_curators` | `client.labels.top_curators(...)` |
101
+ | GET | `/top_commentors` | `client.labels.top_commentors(...)` |
102
+ | POST | `/link_request` | `client.labels.add_link_request(link: ..., ...)` |
103
+ | DELETE | `/link_request` | `client.labels.remove_link_request(link: ..., ...)` |
104
+ | POST | `/track_request` | `client.labels.add_track_request(...)` |
105
+ | DELETE | `/track_request` | `client.labels.remove_track_request(...)` |
106
+ | POST | `/add_to_member_relevant_list` | `client.labels.add_to_member_relevant_list(...)` |
107
+ | DELETE | `/remove_from_member_relevant_list` | `client.labels.remove_from_member_relevant_list(...)` |
@@ -2,7 +2,7 @@
2
2
 
3
3
  module SongstatsSDK
4
4
  class Client
5
- attr_reader :info, :tracks, :artists, :collaborators, :labels, :charts, :stations
5
+ attr_reader :info, :tracks, :artists, :collaborators, :labels
6
6
 
7
7
  def initialize(api_key:, base_url: HTTPClient::DEFAULT_BASE_URL, timeout: HTTPClient::DEFAULT_TIMEOUT_SECONDS,
8
8
  max_retries: 2, http_adapter: nil, user_agent: nil)
@@ -20,8 +20,6 @@ module SongstatsSDK
20
20
  @artists = Resources::Artists.new(@http)
21
21
  @collaborators = Resources::Collaborators.new(@http)
22
22
  @labels = Resources::Labels.new(@http)
23
- @charts = Resources::Charts.new(@http)
24
- @stations = Resources::Stations.new(@http)
25
23
  end
26
24
 
27
25
  def close
@@ -4,5 +4,3 @@ require_relative "resources/base"
4
4
  require_relative "resources/info"
5
5
  require_relative "resources/tracks"
6
6
  require_relative "resources/entities"
7
- require_relative "resources/charts"
8
- require_relative "resources/stations"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SongstatsSDK
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: songstats-ruby-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Songstats
@@ -10,7 +10,7 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2026-02-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: Typed Ruby client covering all /enterprise/v1 Songstats API routes.
13
+ description: Typed Ruby client for Songstats Enterprise API resources.
14
14
  email:
15
15
  - api@songstats.com
16
16
  executables: []
@@ -27,10 +27,8 @@ files:
27
27
  - lib/songstats_sdk/http_client.rb
28
28
  - lib/songstats_sdk/resources.rb
29
29
  - lib/songstats_sdk/resources/base.rb
30
- - lib/songstats_sdk/resources/charts.rb
31
30
  - lib/songstats_sdk/resources/entities.rb
32
31
  - lib/songstats_sdk/resources/info.rb
33
- - lib/songstats_sdk/resources/stations.rb
34
32
  - lib/songstats_sdk/resources/tracks.rb
35
33
  - lib/songstats_sdk/version.rb
36
34
  homepage: https://songstats.com
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module SongstatsSDK
4
- module Resources
5
- class Charts < Base
6
- def tracks(country_code:, source: nil, **params)
7
- raise ArgumentError, "country_code is required" if country_code.to_s.empty?
8
-
9
- query = { country_code: country_code, source: source }.merge(params)
10
- get("charts/tracks", params: query)
11
- end
12
- end
13
- end
14
- end
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module SongstatsSDK
4
- module Resources
5
- class Stations < Base
6
- def station_request(radio_type:, name:, country_code:, website:, stream_url: nil, city_name: nil, frequency: nil,
7
- contact: nil, comment: nil, **extra)
8
- raise ArgumentError, "radio_type is required" if radio_type.to_s.empty?
9
- raise ArgumentError, "name is required" if name.to_s.empty?
10
- raise ArgumentError, "country_code is required" if country_code.to_s.empty?
11
- raise ArgumentError, "website is required" if website.to_s.empty?
12
-
13
- payload = {
14
- radio_type: radio_type,
15
- name: name,
16
- country_code: country_code,
17
- website: website,
18
- stream_url: stream_url,
19
- city_name: city_name,
20
- frequency: frequency,
21
- contact: contact,
22
- comment: comment
23
- }.merge(extra)
24
-
25
- post("stations/station_request", json: payload)
26
- end
27
- end
28
- end
29
- end