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,547 @@
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 BroadcastEPGResult
18
+ attr_accessor :id
19
+
20
+ attr_accessor :updated_at
21
+
22
+ attr_accessor :created_at
23
+
24
+ attr_accessor :deleted_at
25
+
26
+ attr_accessor :_external_station_id
27
+
28
+ attr_accessor :program_id
29
+
30
+ attr_accessor :model_type_id
31
+
32
+ attr_accessor :station_id
33
+
34
+ attr_accessor :field_values
35
+
36
+ attr_accessor :title
37
+
38
+ attr_accessor :start
39
+
40
+ attr_accessor :stop
41
+
42
+ attr_accessor :genre_id
43
+
44
+ attr_accessor :description
45
+
46
+ attr_accessor :short_name
47
+
48
+ attr_accessor :medium_name
49
+
50
+ attr_accessor :website
51
+
52
+ attr_accessor :email
53
+
54
+ attr_accessor :recommended
55
+
56
+ attr_accessor :language
57
+
58
+ attr_accessor :published
59
+
60
+ attr_accessor :repetition_uid
61
+
62
+ attr_accessor :repetition_type
63
+
64
+ attr_accessor :repetition_end
65
+
66
+ attr_accessor :repetition_start
67
+
68
+ attr_accessor :repetition_days
69
+
70
+ attr_accessor :pty_code_id
71
+
72
+ attr_accessor :items
73
+
74
+ attr_accessor :blocks
75
+
76
+ attr_accessor :program
77
+
78
+ attr_accessor :tags
79
+
80
+ attr_accessor :presenters
81
+
82
+ attr_accessor :model_type
83
+
84
+ class EnumAttributeValidator
85
+ attr_reader :datatype
86
+ attr_reader :allowable_values
87
+
88
+ def initialize(datatype, allowable_values)
89
+ @allowable_values = allowable_values.map do |value|
90
+ case datatype.to_s
91
+ when /Integer/i
92
+ value.to_i
93
+ when /Float/i
94
+ value.to_f
95
+ else
96
+ value
97
+ end
98
+ end
99
+ end
100
+
101
+ def valid?(value)
102
+ !value || allowable_values.include?(value)
103
+ end
104
+ end
105
+
106
+ # Attribute mapping from ruby-style variable name to JSON key.
107
+ def self.attribute_map
108
+ {
109
+ :'id' => :'id',
110
+ :'updated_at' => :'updated_at',
111
+ :'created_at' => :'created_at',
112
+ :'deleted_at' => :'deleted_at',
113
+ :'_external_station_id' => :'_external_station_id',
114
+ :'program_id' => :'program_id',
115
+ :'model_type_id' => :'model_type_id',
116
+ :'station_id' => :'station_id',
117
+ :'field_values' => :'field_values',
118
+ :'title' => :'title',
119
+ :'start' => :'start',
120
+ :'stop' => :'stop',
121
+ :'genre_id' => :'genre_id',
122
+ :'description' => :'description',
123
+ :'short_name' => :'short_name',
124
+ :'medium_name' => :'medium_name',
125
+ :'website' => :'website',
126
+ :'email' => :'email',
127
+ :'recommended' => :'recommended',
128
+ :'language' => :'language',
129
+ :'published' => :'published',
130
+ :'repetition_uid' => :'repetition_uid',
131
+ :'repetition_type' => :'repetition_type',
132
+ :'repetition_end' => :'repetition_end',
133
+ :'repetition_start' => :'repetition_start',
134
+ :'repetition_days' => :'repetition_days',
135
+ :'pty_code_id' => :'pty_code_id',
136
+ :'items' => :'items',
137
+ :'blocks' => :'blocks',
138
+ :'program' => :'program',
139
+ :'tags' => :'tags',
140
+ :'presenters' => :'presenters',
141
+ :'model_type' => :'model_type'
142
+ }
143
+ end
144
+
145
+ # Attribute type mapping.
146
+ def self.swagger_types
147
+ {
148
+ :'id' => :'Integer',
149
+ :'updated_at' => :'DateTime',
150
+ :'created_at' => :'DateTime',
151
+ :'deleted_at' => :'DateTime',
152
+ :'_external_station_id' => :'Integer',
153
+ :'program_id' => :'Integer',
154
+ :'model_type_id' => :'Integer',
155
+ :'station_id' => :'Integer',
156
+ :'field_values' => :'BroadcastFieldValues',
157
+ :'title' => :'String',
158
+ :'start' => :'DateTime',
159
+ :'stop' => :'DateTime',
160
+ :'genre_id' => :'Integer',
161
+ :'description' => :'String',
162
+ :'short_name' => :'String',
163
+ :'medium_name' => :'String',
164
+ :'website' => :'String',
165
+ :'email' => :'String',
166
+ :'recommended' => :'BOOLEAN',
167
+ :'language' => :'String',
168
+ :'published' => :'BOOLEAN',
169
+ :'repetition_uid' => :'String',
170
+ :'repetition_type' => :'String',
171
+ :'repetition_end' => :'DateTime',
172
+ :'repetition_start' => :'DateTime',
173
+ :'repetition_days' => :'String',
174
+ :'pty_code_id' => :'Integer',
175
+ :'items' => :'BroadcastRelationsItems',
176
+ :'blocks' => :'BroadcastRelationsBlocks',
177
+ :'program' => :'BlockRelationsProgram',
178
+ :'tags' => :'BroadcastRelationsTags',
179
+ :'presenters' => :'Array<PresenterEPGResult>',
180
+ :'model_type' => :'BroadcastRelationsModelType'
181
+ }
182
+ end
183
+
184
+ # Initializes the object
185
+ # @param [Hash] attributes Model attributes in the form of hash
186
+ def initialize(attributes = {})
187
+ return unless attributes.is_a?(Hash)
188
+
189
+ # convert string to symbol for hash key
190
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
191
+
192
+ if attributes.has_key?(:'id')
193
+ self.id = attributes[:'id']
194
+ end
195
+
196
+ if attributes.has_key?(:'updated_at')
197
+ self.updated_at = attributes[:'updated_at']
198
+ end
199
+
200
+ if attributes.has_key?(:'created_at')
201
+ self.created_at = attributes[:'created_at']
202
+ end
203
+
204
+ if attributes.has_key?(:'deleted_at')
205
+ self.deleted_at = attributes[:'deleted_at']
206
+ end
207
+
208
+ if attributes.has_key?(:'_external_station_id')
209
+ self._external_station_id = attributes[:'_external_station_id']
210
+ end
211
+
212
+ if attributes.has_key?(:'program_id')
213
+ self.program_id = attributes[:'program_id']
214
+ end
215
+
216
+ if attributes.has_key?(:'model_type_id')
217
+ self.model_type_id = attributes[:'model_type_id']
218
+ end
219
+
220
+ if attributes.has_key?(:'station_id')
221
+ self.station_id = attributes[:'station_id']
222
+ end
223
+
224
+ if attributes.has_key?(:'field_values')
225
+ self.field_values = attributes[:'field_values']
226
+ end
227
+
228
+ if attributes.has_key?(:'title')
229
+ self.title = attributes[:'title']
230
+ end
231
+
232
+ if attributes.has_key?(:'start')
233
+ self.start = attributes[:'start']
234
+ end
235
+
236
+ if attributes.has_key?(:'stop')
237
+ self.stop = attributes[:'stop']
238
+ end
239
+
240
+ if attributes.has_key?(:'genre_id')
241
+ self.genre_id = attributes[:'genre_id']
242
+ end
243
+
244
+ if attributes.has_key?(:'description')
245
+ self.description = attributes[:'description']
246
+ end
247
+
248
+ if attributes.has_key?(:'short_name')
249
+ self.short_name = attributes[:'short_name']
250
+ end
251
+
252
+ if attributes.has_key?(:'medium_name')
253
+ self.medium_name = attributes[:'medium_name']
254
+ end
255
+
256
+ if attributes.has_key?(:'website')
257
+ self.website = attributes[:'website']
258
+ end
259
+
260
+ if attributes.has_key?(:'email')
261
+ self.email = attributes[:'email']
262
+ end
263
+
264
+ if attributes.has_key?(:'recommended')
265
+ self.recommended = attributes[:'recommended']
266
+ end
267
+
268
+ if attributes.has_key?(:'language')
269
+ self.language = attributes[:'language']
270
+ end
271
+
272
+ if attributes.has_key?(:'published')
273
+ self.published = attributes[:'published']
274
+ end
275
+
276
+ if attributes.has_key?(:'repetition_uid')
277
+ self.repetition_uid = attributes[:'repetition_uid']
278
+ end
279
+
280
+ if attributes.has_key?(:'repetition_type')
281
+ self.repetition_type = attributes[:'repetition_type']
282
+ end
283
+
284
+ if attributes.has_key?(:'repetition_end')
285
+ self.repetition_end = attributes[:'repetition_end']
286
+ end
287
+
288
+ if attributes.has_key?(:'repetition_start')
289
+ self.repetition_start = attributes[:'repetition_start']
290
+ end
291
+
292
+ if attributes.has_key?(:'repetition_days')
293
+ self.repetition_days = attributes[:'repetition_days']
294
+ end
295
+
296
+ if attributes.has_key?(:'pty_code_id')
297
+ self.pty_code_id = attributes[:'pty_code_id']
298
+ end
299
+
300
+ if attributes.has_key?(:'items')
301
+ self.items = attributes[:'items']
302
+ end
303
+
304
+ if attributes.has_key?(:'blocks')
305
+ self.blocks = attributes[:'blocks']
306
+ end
307
+
308
+ if attributes.has_key?(:'program')
309
+ self.program = attributes[:'program']
310
+ end
311
+
312
+ if attributes.has_key?(:'tags')
313
+ self.tags = attributes[:'tags']
314
+ end
315
+
316
+ if attributes.has_key?(:'presenters')
317
+ if (value = attributes[:'presenters']).is_a?(Array)
318
+ self.presenters = value
319
+ end
320
+ end
321
+
322
+ if attributes.has_key?(:'model_type')
323
+ self.model_type = attributes[:'model_type']
324
+ end
325
+
326
+ end
327
+
328
+ # Show invalid properties with the reasons. Usually used together with valid?
329
+ # @return Array for valid properies with the reasons
330
+ def list_invalid_properties
331
+ invalid_properties = Array.new
332
+ if @id.nil?
333
+ invalid_properties.push("invalid value for 'id', id cannot be nil.")
334
+ end
335
+
336
+ if @updated_at.nil?
337
+ invalid_properties.push("invalid value for 'updated_at', updated_at cannot be nil.")
338
+ end
339
+
340
+ if @created_at.nil?
341
+ invalid_properties.push("invalid value for 'created_at', created_at cannot be nil.")
342
+ end
343
+
344
+ if @deleted_at.nil?
345
+ invalid_properties.push("invalid value for 'deleted_at', deleted_at cannot be nil.")
346
+ end
347
+
348
+ if !@pty_code_id.nil? && @pty_code_id < 1
349
+ invalid_properties.push("invalid value for 'pty_code_id', must be greater than or equal to 1.")
350
+ end
351
+
352
+ return invalid_properties
353
+ end
354
+
355
+ # Check to see if the all the properties in the model are valid
356
+ # @return true if the model is valid
357
+ def valid?
358
+ return false if @id.nil?
359
+ return false if @updated_at.nil?
360
+ return false if @created_at.nil?
361
+ return false if @deleted_at.nil?
362
+ repetition_type_validator = EnumAttributeValidator.new('String', ["1 week", "2 weeks", "4 weeks", "1 month"])
363
+ return false unless repetition_type_validator.valid?(@repetition_type)
364
+ return false if !@pty_code_id.nil? && @pty_code_id < 1
365
+ return true
366
+ end
367
+
368
+ # Custom attribute writer method checking allowed values (enum).
369
+ # @param [Object] repetition_type Object to be assigned
370
+ def repetition_type=(repetition_type)
371
+ validator = EnumAttributeValidator.new('String', ["1 week", "2 weeks", "4 weeks", "1 month"])
372
+ unless validator.valid?(repetition_type)
373
+ fail ArgumentError, "invalid value for 'repetition_type', must be one of #{validator.allowable_values}."
374
+ end
375
+ @repetition_type = repetition_type
376
+ end
377
+
378
+ # Custom attribute writer method with validation
379
+ # @param [Object] pty_code_id Value to be assigned
380
+ def pty_code_id=(pty_code_id)
381
+
382
+ if !pty_code_id.nil? && pty_code_id < 1
383
+ fail ArgumentError, "invalid value for 'pty_code_id', must be greater than or equal to 1."
384
+ end
385
+
386
+ @pty_code_id = pty_code_id
387
+ end
388
+
389
+ # Checks equality by comparing each attribute.
390
+ # @param [Object] Object to be compared
391
+ def ==(o)
392
+ return true if self.equal?(o)
393
+ self.class == o.class &&
394
+ id == o.id &&
395
+ updated_at == o.updated_at &&
396
+ created_at == o.created_at &&
397
+ deleted_at == o.deleted_at &&
398
+ _external_station_id == o._external_station_id &&
399
+ program_id == o.program_id &&
400
+ model_type_id == o.model_type_id &&
401
+ station_id == o.station_id &&
402
+ field_values == o.field_values &&
403
+ title == o.title &&
404
+ start == o.start &&
405
+ stop == o.stop &&
406
+ genre_id == o.genre_id &&
407
+ description == o.description &&
408
+ short_name == o.short_name &&
409
+ medium_name == o.medium_name &&
410
+ website == o.website &&
411
+ email == o.email &&
412
+ recommended == o.recommended &&
413
+ language == o.language &&
414
+ published == o.published &&
415
+ repetition_uid == o.repetition_uid &&
416
+ repetition_type == o.repetition_type &&
417
+ repetition_end == o.repetition_end &&
418
+ repetition_start == o.repetition_start &&
419
+ repetition_days == o.repetition_days &&
420
+ pty_code_id == o.pty_code_id &&
421
+ items == o.items &&
422
+ blocks == o.blocks &&
423
+ program == o.program &&
424
+ tags == o.tags &&
425
+ presenters == o.presenters &&
426
+ model_type == o.model_type
427
+ end
428
+
429
+ # @see the `==` method
430
+ # @param [Object] Object to be compared
431
+ def eql?(o)
432
+ self == o
433
+ end
434
+
435
+ # Calculates hash code according to all attributes.
436
+ # @return [Fixnum] Hash code
437
+ def hash
438
+ [id, updated_at, created_at, deleted_at, _external_station_id, program_id, model_type_id, station_id, field_values, title, start, stop, genre_id, description, short_name, medium_name, website, email, recommended, language, published, repetition_uid, repetition_type, repetition_end, repetition_start, repetition_days, pty_code_id, items, blocks, program, tags, presenters, model_type].hash
439
+ end
440
+
441
+ # Builds the object from hash
442
+ # @param [Hash] attributes Model attributes in the form of hash
443
+ # @return [Object] Returns the model itself
444
+ def build_from_hash(attributes)
445
+ return nil unless attributes.is_a?(Hash)
446
+ self.class.swagger_types.each_pair do |key, type|
447
+ if type =~ /\AArray<(.*)>/i
448
+ # check to ensure the input is an array given that the the attribute
449
+ # is documented as an array but the input is not
450
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
451
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
452
+ end
453
+ elsif !attributes[self.class.attribute_map[key]].nil?
454
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
455
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
456
+ end
457
+
458
+ self
459
+ end
460
+
461
+ # Deserializes the data based on type
462
+ # @param string type Data type
463
+ # @param string value Value to be deserialized
464
+ # @return [Object] Deserialized data
465
+ def _deserialize(type, value)
466
+ case type.to_sym
467
+ when :DateTime
468
+ DateTime.parse(value)
469
+ when :Date
470
+ Date.parse(value)
471
+ when :String
472
+ value.to_s
473
+ when :Integer
474
+ value.to_i
475
+ when :Float
476
+ value.to_f
477
+ when :BOOLEAN
478
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
479
+ true
480
+ else
481
+ false
482
+ end
483
+ when :Object
484
+ # generic object (usually a Hash), return directly
485
+ value
486
+ when /\AArray<(?<inner_type>.+)>\z/
487
+ inner_type = Regexp.last_match[:inner_type]
488
+ value.map { |v| _deserialize(inner_type, v) }
489
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
490
+ k_type = Regexp.last_match[:k_type]
491
+ v_type = Regexp.last_match[:v_type]
492
+ {}.tap do |hash|
493
+ value.each do |k, v|
494
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
495
+ end
496
+ end
497
+ else # model
498
+ temp_model = RadioManagerClient.const_get(type).new
499
+ temp_model.build_from_hash(value)
500
+ end
501
+ end
502
+
503
+ # Returns the string representation of the object
504
+ # @return [String] String presentation of the object
505
+ def to_s
506
+ to_hash.to_s
507
+ end
508
+
509
+ # to_body is an alias to to_hash (backward compatibility)
510
+ # @return [Hash] Returns the object in the form of hash
511
+ def to_body
512
+ to_hash
513
+ end
514
+
515
+ # Returns the object in the form of hash
516
+ # @return [Hash] Returns the object in the form of hash
517
+ def to_hash
518
+ hash = {}
519
+ self.class.attribute_map.each_pair do |attr, param|
520
+ value = self.send(attr)
521
+ next if value.nil?
522
+ hash[param] = _to_hash(value)
523
+ end
524
+ hash
525
+ end
526
+
527
+ # Outputs non-array value in the form of hash
528
+ # For object, use to_hash. Otherwise, just return the value
529
+ # @param [Object] value Any valid value
530
+ # @return [Hash] Returns the value in the form of hash
531
+ def _to_hash(value)
532
+ if value.is_a?(Array)
533
+ value.compact.map{ |v| _to_hash(v) }
534
+ elsif value.is_a?(Hash)
535
+ {}.tap do |hash|
536
+ value.each { |k, v| hash[k] = _to_hash(v) }
537
+ end
538
+ elsif value.respond_to? :to_hash
539
+ value.to_hash
540
+ else
541
+ value
542
+ end
543
+ end
544
+
545
+ end
546
+
547
+ end