radiomanager_client 1.0.99 → 1.0.100

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.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -5
  3. data/docs/BlockApi.md +13 -7
  4. data/docs/BroadcastApi.md +36 -24
  5. data/docs/BroadcastEPGDay.md +9 -0
  6. data/docs/BroadcastEPGRelations.md +13 -0
  7. data/docs/BroadcastEPGResult.md +40 -0
  8. data/docs/CampaignApi.md +9 -3
  9. data/docs/ContactApi.md +11 -5
  10. data/docs/EPGResults.md +10 -0
  11. data/docs/ExternalMessageApi.md +1 -1
  12. data/docs/GenreApi.md +7 -1
  13. data/docs/ItemApi.md +27 -25
  14. data/docs/ModelTypeApi.md +9 -3
  15. data/docs/PresenterApi.md +9 -3
  16. data/docs/PresenterEPGResult.md +18 -0
  17. data/docs/ProgramApi.md +17 -11
  18. data/docs/StationApi.md +57 -0
  19. data/docs/StationResult.md +8 -0
  20. data/docs/StationResultStation.md +33 -0
  21. data/docs/StoryApi.md +11 -5
  22. data/docs/StoryDataInput.md +1 -0
  23. data/docs/StringApi.md +1 -1
  24. data/docs/TagApi.md +7 -1
  25. data/docs/UserApi.md +8 -2
  26. data/docs/VisualSlideApi.md +1 -1
  27. data/lib/radiomanager_client/api/block_api.rb +29 -9
  28. data/lib/radiomanager_client/api/broadcast_api.rb +58 -29
  29. data/lib/radiomanager_client/api/campaign_api.rb +23 -3
  30. data/lib/radiomanager_client/api/contact_api.rb +25 -5
  31. data/lib/radiomanager_client/api/genre_api.rb +20 -0
  32. data/lib/radiomanager_client/api/item_api.rb +50 -39
  33. data/lib/radiomanager_client/api/model_type_api.rb +23 -3
  34. data/lib/radiomanager_client/api/presenter_api.rb +23 -3
  35. data/lib/radiomanager_client/api/program_api.rb +34 -14
  36. data/lib/radiomanager_client/api/station_api.rb +72 -0
  37. data/lib/radiomanager_client/api/story_api.rb +25 -5
  38. data/lib/radiomanager_client/api/tag_api.rb +20 -0
  39. data/lib/radiomanager_client/api/user_api.rb +20 -0
  40. data/lib/radiomanager_client/configuration.rb +1 -1
  41. data/lib/radiomanager_client/models/broadcast_epg_day.rb +204 -0
  42. data/lib/radiomanager_client/models/broadcast_epg_relations.rb +235 -0
  43. data/lib/radiomanager_client/models/broadcast_epg_result.rb +547 -0
  44. data/lib/radiomanager_client/models/epg_results.rb +223 -0
  45. data/lib/radiomanager_client/models/presenter_epg_result.rb +305 -0
  46. data/lib/radiomanager_client/models/station_result.rb +188 -0
  47. data/lib/radiomanager_client/models/station_result_station.rb +413 -0
  48. data/lib/radiomanager_client/models/story_data_input.rb +15 -4
  49. data/lib/radiomanager_client.rb +9 -3
  50. data/radiomanager_client.gemspec +1 -1
  51. data/spec/api/station_api_spec.rb +46 -0
  52. data/spec/configuration_spec.rb +3 -3
  53. data/spec/models/broadcast_epg_day_spec.rb +48 -0
  54. data/spec/models/broadcast_epg_relations_spec.rb +72 -0
  55. data/spec/models/broadcast_epg_result_spec.rb +238 -0
  56. data/spec/models/epg_results_spec.rb +54 -0
  57. data/spec/models/item_data_input_spec.rb +1 -1
  58. data/spec/models/item_input_only_spec.rb +1 -1
  59. data/spec/models/presenter_epg_result_spec.rb +102 -0
  60. data/spec/models/station_result_spec.rb +42 -0
  61. data/spec/models/station_result_station_spec.rb +186 -0
  62. metadata +34 -2
@@ -0,0 +1,223 @@
1
+ =begin
2
+ #RadioManager
3
+
4
+ #RadioManager
5
+
6
+ OpenAPI spec version: 2.0
7
+ Contact: support@pluxbox.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module RadioManagerClient
16
+
17
+ class EPGResults
18
+ attr_accessor :days
19
+
20
+ attr_accessor :next_page_url
21
+
22
+ attr_accessor :prev_page_url
23
+
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'days' => :'days',
29
+ :'next_page_url' => :'next_page_url',
30
+ :'prev_page_url' => :'prev_page_url'
31
+ }
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.swagger_types
36
+ {
37
+ :'days' => :'Array<BroadcastEPGDay>',
38
+ :'next_page_url' => :'String',
39
+ :'prev_page_url' => :'String'
40
+ }
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param [Hash] attributes Model attributes in the form of hash
45
+ def initialize(attributes = {})
46
+ return unless attributes.is_a?(Hash)
47
+
48
+ # convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
50
+
51
+ if attributes.has_key?(:'days')
52
+ if (value = attributes[:'days']).is_a?(Array)
53
+ self.days = value
54
+ end
55
+ end
56
+
57
+ if attributes.has_key?(:'next_page_url')
58
+ self.next_page_url = attributes[:'next_page_url']
59
+ end
60
+
61
+ if attributes.has_key?(:'prev_page_url')
62
+ self.prev_page_url = attributes[:'prev_page_url']
63
+ end
64
+
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properies with the reasons
69
+ def list_invalid_properties
70
+ invalid_properties = Array.new
71
+ if @days.nil?
72
+ invalid_properties.push("invalid value for 'days', days cannot be nil.")
73
+ end
74
+
75
+ if @next_page_url.nil?
76
+ invalid_properties.push("invalid value for 'next_page_url', next_page_url cannot be nil.")
77
+ end
78
+
79
+ if @prev_page_url.nil?
80
+ invalid_properties.push("invalid value for 'prev_page_url', prev_page_url cannot be nil.")
81
+ end
82
+
83
+ return invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ return false if @days.nil?
90
+ return false if @next_page_url.nil?
91
+ return false if @prev_page_url.nil?
92
+ return true
93
+ end
94
+
95
+ # Checks equality by comparing each attribute.
96
+ # @param [Object] Object to be compared
97
+ def ==(o)
98
+ return true if self.equal?(o)
99
+ self.class == o.class &&
100
+ days == o.days &&
101
+ next_page_url == o.next_page_url &&
102
+ prev_page_url == o.prev_page_url
103
+ end
104
+
105
+ # @see the `==` method
106
+ # @param [Object] Object to be compared
107
+ def eql?(o)
108
+ self == o
109
+ end
110
+
111
+ # Calculates hash code according to all attributes.
112
+ # @return [Fixnum] Hash code
113
+ def hash
114
+ [days, next_page_url, prev_page_url].hash
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def build_from_hash(attributes)
121
+ return nil unless attributes.is_a?(Hash)
122
+ self.class.swagger_types.each_pair do |key, type|
123
+ if type =~ /\AArray<(.*)>/i
124
+ # check to ensure the input is an array given that the the attribute
125
+ # is documented as an array but the input is not
126
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
127
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
128
+ end
129
+ elsif !attributes[self.class.attribute_map[key]].nil?
130
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
131
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
132
+ end
133
+
134
+ self
135
+ end
136
+
137
+ # Deserializes the data based on type
138
+ # @param string type Data type
139
+ # @param string value Value to be deserialized
140
+ # @return [Object] Deserialized data
141
+ def _deserialize(type, value)
142
+ case type.to_sym
143
+ when :DateTime
144
+ DateTime.parse(value)
145
+ when :Date
146
+ Date.parse(value)
147
+ when :String
148
+ value.to_s
149
+ when :Integer
150
+ value.to_i
151
+ when :Float
152
+ value.to_f
153
+ when :BOOLEAN
154
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
155
+ true
156
+ else
157
+ false
158
+ end
159
+ when :Object
160
+ # generic object (usually a Hash), return directly
161
+ value
162
+ when /\AArray<(?<inner_type>.+)>\z/
163
+ inner_type = Regexp.last_match[:inner_type]
164
+ value.map { |v| _deserialize(inner_type, v) }
165
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
166
+ k_type = Regexp.last_match[:k_type]
167
+ v_type = Regexp.last_match[:v_type]
168
+ {}.tap do |hash|
169
+ value.each do |k, v|
170
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
171
+ end
172
+ end
173
+ else # model
174
+ temp_model = RadioManagerClient.const_get(type).new
175
+ temp_model.build_from_hash(value)
176
+ end
177
+ end
178
+
179
+ # Returns the string representation of the object
180
+ # @return [String] String presentation of the object
181
+ def to_s
182
+ to_hash.to_s
183
+ end
184
+
185
+ # to_body is an alias to to_hash (backward compatibility)
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_body
188
+ to_hash
189
+ end
190
+
191
+ # Returns the object in the form of hash
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_hash
194
+ hash = {}
195
+ self.class.attribute_map.each_pair do |attr, param|
196
+ value = self.send(attr)
197
+ next if value.nil?
198
+ hash[param] = _to_hash(value)
199
+ end
200
+ hash
201
+ end
202
+
203
+ # Outputs non-array value in the form of hash
204
+ # For object, use to_hash. Otherwise, just return the value
205
+ # @param [Object] value Any valid value
206
+ # @return [Hash] Returns the value in the form of hash
207
+ def _to_hash(value)
208
+ if value.is_a?(Array)
209
+ value.compact.map{ |v| _to_hash(v) }
210
+ elsif value.is_a?(Hash)
211
+ {}.tap do |hash|
212
+ value.each { |k, v| hash[k] = _to_hash(v) }
213
+ end
214
+ elsif value.respond_to? :to_hash
215
+ value.to_hash
216
+ else
217
+ value
218
+ end
219
+ end
220
+
221
+ end
222
+
223
+ end
@@ -0,0 +1,305 @@
1
+ =begin
2
+ #RadioManager
3
+
4
+ #RadioManager
5
+
6
+ OpenAPI spec version: 2.0
7
+ Contact: support@pluxbox.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module RadioManagerClient
16
+
17
+ class PresenterEPGResult
18
+ attr_accessor :model_type_id
19
+
20
+ attr_accessor :field_values
21
+
22
+ attr_accessor :firstname
23
+
24
+ attr_accessor :lastname
25
+
26
+ attr_accessor :active
27
+
28
+ attr_accessor :name
29
+
30
+ attr_accessor :id
31
+
32
+ attr_accessor :updated_at
33
+
34
+ attr_accessor :created_at
35
+
36
+ attr_accessor :deleted_at
37
+
38
+ attr_accessor :_external_station_id
39
+
40
+
41
+ # Attribute mapping from ruby-style variable name to JSON key.
42
+ def self.attribute_map
43
+ {
44
+ :'model_type_id' => :'model_type_id',
45
+ :'field_values' => :'field_values',
46
+ :'firstname' => :'firstname',
47
+ :'lastname' => :'lastname',
48
+ :'active' => :'active',
49
+ :'name' => :'name',
50
+ :'id' => :'id',
51
+ :'updated_at' => :'updated_at',
52
+ :'created_at' => :'created_at',
53
+ :'deleted_at' => :'deleted_at',
54
+ :'_external_station_id' => :'_external_station_id'
55
+ }
56
+ end
57
+
58
+ # Attribute type mapping.
59
+ def self.swagger_types
60
+ {
61
+ :'model_type_id' => :'Integer',
62
+ :'field_values' => :'Array<Object>',
63
+ :'firstname' => :'String',
64
+ :'lastname' => :'String',
65
+ :'active' => :'BOOLEAN',
66
+ :'name' => :'String',
67
+ :'id' => :'Integer',
68
+ :'updated_at' => :'DateTime',
69
+ :'created_at' => :'DateTime',
70
+ :'deleted_at' => :'DateTime',
71
+ :'_external_station_id' => :'Integer'
72
+ }
73
+ end
74
+
75
+ # Initializes the object
76
+ # @param [Hash] attributes Model attributes in the form of hash
77
+ def initialize(attributes = {})
78
+ return unless attributes.is_a?(Hash)
79
+
80
+ # convert string to symbol for hash key
81
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
82
+
83
+ if attributes.has_key?(:'model_type_id')
84
+ self.model_type_id = attributes[:'model_type_id']
85
+ end
86
+
87
+ if attributes.has_key?(:'field_values')
88
+ if (value = attributes[:'field_values']).is_a?(Array)
89
+ self.field_values = value
90
+ end
91
+ end
92
+
93
+ if attributes.has_key?(:'firstname')
94
+ self.firstname = attributes[:'firstname']
95
+ end
96
+
97
+ if attributes.has_key?(:'lastname')
98
+ self.lastname = attributes[:'lastname']
99
+ end
100
+
101
+ if attributes.has_key?(:'active')
102
+ self.active = attributes[:'active']
103
+ end
104
+
105
+ if attributes.has_key?(:'name')
106
+ self.name = attributes[:'name']
107
+ end
108
+
109
+ if attributes.has_key?(:'id')
110
+ self.id = attributes[:'id']
111
+ end
112
+
113
+ if attributes.has_key?(:'updated_at')
114
+ self.updated_at = attributes[:'updated_at']
115
+ end
116
+
117
+ if attributes.has_key?(:'created_at')
118
+ self.created_at = attributes[:'created_at']
119
+ end
120
+
121
+ if attributes.has_key?(:'deleted_at')
122
+ self.deleted_at = attributes[:'deleted_at']
123
+ end
124
+
125
+ if attributes.has_key?(:'_external_station_id')
126
+ self._external_station_id = attributes[:'_external_station_id']
127
+ end
128
+
129
+ end
130
+
131
+ # Show invalid properties with the reasons. Usually used together with valid?
132
+ # @return Array for valid properies with the reasons
133
+ def list_invalid_properties
134
+ invalid_properties = Array.new
135
+ if @model_type_id.nil?
136
+ invalid_properties.push("invalid value for 'model_type_id', model_type_id cannot be nil.")
137
+ end
138
+
139
+ if @id.nil?
140
+ invalid_properties.push("invalid value for 'id', id cannot be nil.")
141
+ end
142
+
143
+ if @updated_at.nil?
144
+ invalid_properties.push("invalid value for 'updated_at', updated_at cannot be nil.")
145
+ end
146
+
147
+ if @created_at.nil?
148
+ invalid_properties.push("invalid value for 'created_at', created_at cannot be nil.")
149
+ end
150
+
151
+ if @deleted_at.nil?
152
+ invalid_properties.push("invalid value for 'deleted_at', deleted_at cannot be nil.")
153
+ end
154
+
155
+ return invalid_properties
156
+ end
157
+
158
+ # Check to see if the all the properties in the model are valid
159
+ # @return true if the model is valid
160
+ def valid?
161
+ return false if @model_type_id.nil?
162
+ return false if @id.nil?
163
+ return false if @updated_at.nil?
164
+ return false if @created_at.nil?
165
+ return false if @deleted_at.nil?
166
+ return true
167
+ end
168
+
169
+ # Checks equality by comparing each attribute.
170
+ # @param [Object] Object to be compared
171
+ def ==(o)
172
+ return true if self.equal?(o)
173
+ self.class == o.class &&
174
+ model_type_id == o.model_type_id &&
175
+ field_values == o.field_values &&
176
+ firstname == o.firstname &&
177
+ lastname == o.lastname &&
178
+ active == o.active &&
179
+ name == o.name &&
180
+ id == o.id &&
181
+ updated_at == o.updated_at &&
182
+ created_at == o.created_at &&
183
+ deleted_at == o.deleted_at &&
184
+ _external_station_id == o._external_station_id
185
+ end
186
+
187
+ # @see the `==` method
188
+ # @param [Object] Object to be compared
189
+ def eql?(o)
190
+ self == o
191
+ end
192
+
193
+ # Calculates hash code according to all attributes.
194
+ # @return [Fixnum] Hash code
195
+ def hash
196
+ [model_type_id, field_values, firstname, lastname, active, name, id, updated_at, created_at, deleted_at, _external_station_id].hash
197
+ end
198
+
199
+ # Builds the object from hash
200
+ # @param [Hash] attributes Model attributes in the form of hash
201
+ # @return [Object] Returns the model itself
202
+ def build_from_hash(attributes)
203
+ return nil unless attributes.is_a?(Hash)
204
+ self.class.swagger_types.each_pair do |key, type|
205
+ if type =~ /\AArray<(.*)>/i
206
+ # check to ensure the input is an array given that the the attribute
207
+ # is documented as an array but the input is not
208
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
209
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
210
+ end
211
+ elsif !attributes[self.class.attribute_map[key]].nil?
212
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
213
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
214
+ end
215
+
216
+ self
217
+ end
218
+
219
+ # Deserializes the data based on type
220
+ # @param string type Data type
221
+ # @param string value Value to be deserialized
222
+ # @return [Object] Deserialized data
223
+ def _deserialize(type, value)
224
+ case type.to_sym
225
+ when :DateTime
226
+ DateTime.parse(value)
227
+ when :Date
228
+ Date.parse(value)
229
+ when :String
230
+ value.to_s
231
+ when :Integer
232
+ value.to_i
233
+ when :Float
234
+ value.to_f
235
+ when :BOOLEAN
236
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
237
+ true
238
+ else
239
+ false
240
+ end
241
+ when :Object
242
+ # generic object (usually a Hash), return directly
243
+ value
244
+ when /\AArray<(?<inner_type>.+)>\z/
245
+ inner_type = Regexp.last_match[:inner_type]
246
+ value.map { |v| _deserialize(inner_type, v) }
247
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
248
+ k_type = Regexp.last_match[:k_type]
249
+ v_type = Regexp.last_match[:v_type]
250
+ {}.tap do |hash|
251
+ value.each do |k, v|
252
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
253
+ end
254
+ end
255
+ else # model
256
+ temp_model = RadioManagerClient.const_get(type).new
257
+ temp_model.build_from_hash(value)
258
+ end
259
+ end
260
+
261
+ # Returns the string representation of the object
262
+ # @return [String] String presentation of the object
263
+ def to_s
264
+ to_hash.to_s
265
+ end
266
+
267
+ # to_body is an alias to to_hash (backward compatibility)
268
+ # @return [Hash] Returns the object in the form of hash
269
+ def to_body
270
+ to_hash
271
+ end
272
+
273
+ # Returns the object in the form of hash
274
+ # @return [Hash] Returns the object in the form of hash
275
+ def to_hash
276
+ hash = {}
277
+ self.class.attribute_map.each_pair do |attr, param|
278
+ value = self.send(attr)
279
+ next if value.nil?
280
+ hash[param] = _to_hash(value)
281
+ end
282
+ hash
283
+ end
284
+
285
+ # Outputs non-array value in the form of hash
286
+ # For object, use to_hash. Otherwise, just return the value
287
+ # @param [Object] value Any valid value
288
+ # @return [Hash] Returns the value in the form of hash
289
+ def _to_hash(value)
290
+ if value.is_a?(Array)
291
+ value.compact.map{ |v| _to_hash(v) }
292
+ elsif value.is_a?(Hash)
293
+ {}.tap do |hash|
294
+ value.each { |k, v| hash[k] = _to_hash(v) }
295
+ end
296
+ elsif value.respond_to? :to_hash
297
+ value.to_hash
298
+ else
299
+ value
300
+ end
301
+ end
302
+
303
+ end
304
+
305
+ end