aylien_news_api 3.0.0 → 4.0.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.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/aylien_news_api.gemspec +1 -2
  4. data/docs/Category.md +3 -1
  5. data/docs/CategoryTaxonomy.md +16 -0
  6. data/docs/DefaultApi.md +105 -51
  7. data/docs/Histograms.md +5 -1
  8. data/docs/Media.md +2 -2
  9. data/docs/MediaFormat.md +16 -0
  10. data/docs/MediaType.md +16 -0
  11. data/docs/Scope.md +1 -1
  12. data/docs/ScopeLevel.md +16 -0
  13. data/docs/Sentiment.md +1 -1
  14. data/docs/SentimentPolarity.md +16 -0
  15. data/docs/Stories.md +5 -1
  16. data/docs/StoryLinks.md +3 -3
  17. data/docs/StoryTranslation.md +19 -0
  18. data/docs/StoryTranslations.md +1 -1
  19. data/docs/Trends.md +5 -1
  20. data/lib/aylien_news_api.rb +7 -3
  21. data/lib/aylien_news_api/api/default_api.rb +265 -159
  22. data/lib/aylien_news_api/api_client.rb +8 -6
  23. data/lib/aylien_news_api/api_error.rb +1 -1
  24. data/lib/aylien_news_api/configuration.rb +2 -2
  25. data/lib/aylien_news_api/models/author.rb +12 -2
  26. data/lib/aylien_news_api/models/autocomplete.rb +12 -2
  27. data/lib/aylien_news_api/models/autocompletes.rb +12 -2
  28. data/lib/aylien_news_api/models/category.rb +24 -39
  29. data/lib/aylien_news_api/models/category_links.rb +12 -2
  30. data/lib/aylien_news_api/models/category_taxonomy.rb +36 -0
  31. data/lib/aylien_news_api/models/cluster.rb +12 -2
  32. data/lib/aylien_news_api/models/clusters.rb +12 -2
  33. data/lib/aylien_news_api/models/coverages.rb +12 -2
  34. data/lib/aylien_news_api/models/entities.rb +12 -2
  35. data/lib/aylien_news_api/models/entity.rb +12 -2
  36. data/lib/aylien_news_api/models/entity_links.rb +12 -2
  37. data/lib/aylien_news_api/models/error.rb +12 -2
  38. data/lib/aylien_news_api/models/error_links.rb +12 -2
  39. data/lib/aylien_news_api/models/errors.rb +12 -2
  40. data/lib/aylien_news_api/models/histogram_interval.rb +12 -2
  41. data/lib/aylien_news_api/models/histograms.rb +36 -6
  42. data/lib/aylien_news_api/models/location.rb +12 -2
  43. data/lib/aylien_news_api/models/media.rb +14 -52
  44. data/lib/aylien_news_api/models/media_format.rb +44 -0
  45. data/lib/aylien_news_api/models/media_type.rb +36 -0
  46. data/lib/aylien_news_api/models/rank.rb +12 -2
  47. data/lib/aylien_news_api/models/rankings.rb +12 -2
  48. data/lib/aylien_news_api/models/related_stories.rb +12 -2
  49. data/lib/aylien_news_api/models/representative_story.rb +12 -2
  50. data/lib/aylien_news_api/models/scope.rb +13 -38
  51. data/lib/aylien_news_api/models/scope_level.rb +37 -0
  52. data/lib/aylien_news_api/models/sentiment.rb +13 -38
  53. data/lib/aylien_news_api/models/sentiment_polarity.rb +37 -0
  54. data/lib/aylien_news_api/models/sentiments.rb +12 -2
  55. data/lib/aylien_news_api/models/share_count.rb +12 -2
  56. data/lib/aylien_news_api/models/share_counts.rb +12 -2
  57. data/lib/aylien_news_api/models/source.rb +12 -2
  58. data/lib/aylien_news_api/models/stories.rb +36 -6
  59. data/lib/aylien_news_api/models/story.rb +12 -2
  60. data/lib/aylien_news_api/models/story_cluster.rb +12 -2
  61. data/lib/aylien_news_api/models/story_links.rb +26 -16
  62. data/lib/aylien_news_api/models/story_translation.rb +217 -0
  63. data/lib/aylien_news_api/models/story_translations.rb +13 -3
  64. data/lib/aylien_news_api/models/story_translations_en.rb +12 -2
  65. data/lib/aylien_news_api/models/summary.rb +12 -2
  66. data/lib/aylien_news_api/models/time_series.rb +12 -2
  67. data/lib/aylien_news_api/models/time_series_list.rb +12 -2
  68. data/lib/aylien_news_api/models/trend.rb +12 -2
  69. data/lib/aylien_news_api/models/trends.rb +36 -6
  70. data/lib/aylien_news_api/version.rb +2 -2
  71. data/spec/api/default_api_spec.rb +54 -28
  72. data/spec/api_client_spec.rb +3 -3
  73. data/spec/configuration_spec.rb +2 -2
  74. data/spec/models/author_spec.rb +2 -2
  75. data/spec/models/autocomplete_spec.rb +2 -2
  76. data/spec/models/autocompletes_spec.rb +2 -2
  77. data/spec/models/category_links_spec.rb +2 -2
  78. data/spec/models/category_spec.rb +8 -6
  79. data/spec/models/category_taxonomy_spec.rb +35 -0
  80. data/spec/models/cluster_spec.rb +2 -2
  81. data/spec/models/clusters_spec.rb +2 -2
  82. data/spec/models/coverages_spec.rb +2 -2
  83. data/spec/models/entities_spec.rb +2 -2
  84. data/spec/models/entity_links_spec.rb +2 -2
  85. data/spec/models/entity_spec.rb +2 -2
  86. data/spec/models/error_links_spec.rb +2 -2
  87. data/spec/models/error_spec.rb +2 -2
  88. data/spec/models/errors_spec.rb +2 -2
  89. data/spec/models/histogram_interval_spec.rb +2 -2
  90. data/spec/models/histograms_spec.rb +14 -2
  91. data/spec/models/location_spec.rb +2 -2
  92. data/spec/models/media_format_spec.rb +35 -0
  93. data/spec/models/media_spec.rb +2 -10
  94. data/spec/models/media_type_spec.rb +35 -0
  95. data/spec/models/rank_spec.rb +2 -2
  96. data/spec/models/rankings_spec.rb +2 -2
  97. data/spec/models/related_stories_spec.rb +2 -2
  98. data/spec/models/representative_story_spec.rb +2 -2
  99. data/spec/models/scope_level_spec.rb +35 -0
  100. data/spec/models/scope_spec.rb +2 -6
  101. data/spec/models/sentiment_polarity_spec.rb +35 -0
  102. data/spec/models/sentiment_spec.rb +2 -6
  103. data/spec/models/sentiments_spec.rb +2 -2
  104. data/spec/models/share_count_spec.rb +2 -2
  105. data/spec/models/share_counts_spec.rb +2 -2
  106. data/spec/models/source_spec.rb +2 -2
  107. data/spec/models/stories_spec.rb +14 -2
  108. data/spec/models/story_cluster_spec.rb +2 -2
  109. data/spec/models/story_links_spec.rb +5 -5
  110. data/spec/models/story_spec.rb +2 -2
  111. data/spec/models/story_translation_spec.rb +47 -0
  112. data/spec/models/story_translations_en_spec.rb +2 -2
  113. data/spec/models/story_translations_spec.rb +2 -2
  114. data/spec/models/summary_spec.rb +2 -2
  115. data/spec/models/time_series_list_spec.rb +2 -2
  116. data/spec/models/time_series_spec.rb +2 -2
  117. data/spec/models/trend_spec.rb +2 -2
  118. data/spec/models/trends_spec.rb +14 -2
  119. data/spec/spec_helper.rb +2 -2
  120. metadata +27 -23
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 3.0
7
7
  Contact: support@aylien.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.1.3-SNAPSHOT
9
+ OpenAPI Generator version: 5.0.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -36,6 +36,12 @@ module AylienNewsApi
36
36
  }
37
37
  end
38
38
 
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
39
45
  # Initializes the object
40
46
  # @param [Hash] attributes Model attributes in the form of hash
41
47
  def initialize(attributes = {})
@@ -184,7 +190,11 @@ module AylienNewsApi
184
190
  hash = {}
185
191
  self.class.attribute_map.each_pair do |attr, param|
186
192
  value = self.send(attr)
187
- next if value.nil?
193
+ if value.nil?
194
+ is_nullable = self.class.openapi_nullable.include?(attr)
195
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
196
+ end
197
+
188
198
  hash[param] = _to_hash(value)
189
199
  end
190
200
  hash
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 3.0
7
7
  Contact: support@aylien.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.1.3-SNAPSHOT
9
+ OpenAPI Generator version: 5.0.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -50,6 +50,12 @@ module AylienNewsApi
50
50
  }
51
51
  end
52
52
 
53
+ # List of attributes with nullable: true
54
+ def self.openapi_nullable
55
+ Set.new([
56
+ ])
57
+ end
58
+
53
59
  # Initializes the object
54
60
  # @param [Hash] attributes Model attributes in the form of hash
55
61
  def initialize(attributes = {})
@@ -237,7 +243,11 @@ module AylienNewsApi
237
243
  hash = {}
238
244
  self.class.attribute_map.each_pair do |attr, param|
239
245
  value = self.send(attr)
240
- next if value.nil?
246
+ if value.nil?
247
+ is_nullable = self.class.openapi_nullable.include?(attr)
248
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
249
+ end
250
+
241
251
  hash[param] = _to_hash(value)
242
252
  end
243
253
  hash
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 3.0
7
7
  Contact: support@aylien.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.1.3-SNAPSHOT
9
+ OpenAPI Generator version: 5.0.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -31,6 +31,12 @@ module AylienNewsApi
31
31
  }
32
32
  end
33
33
 
34
+ # List of attributes with nullable: true
35
+ def self.openapi_nullable
36
+ Set.new([
37
+ ])
38
+ end
39
+
34
40
  # Initializes the object
35
41
  # @param [Hash] attributes Model attributes in the form of hash
36
42
  def initialize(attributes = {})
@@ -170,7 +176,11 @@ module AylienNewsApi
170
176
  hash = {}
171
177
  self.class.attribute_map.each_pair do |attr, param|
172
178
  value = self.send(attr)
173
- next if value.nil?
179
+ if value.nil?
180
+ is_nullable = self.class.openapi_nullable.include?(attr)
181
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
182
+ end
183
+
174
184
  hash[param] = _to_hash(value)
175
185
  end
176
186
  hash
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 3.0
7
7
  Contact: support@aylien.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.1.3-SNAPSHOT
9
+ OpenAPI Generator version: 5.0.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -50,6 +50,12 @@ module AylienNewsApi
50
50
  }
51
51
  end
52
52
 
53
+ # List of attributes with nullable: true
54
+ def self.openapi_nullable
55
+ Set.new([
56
+ ])
57
+ end
58
+
53
59
  # Initializes the object
54
60
  # @param [Hash] attributes Model attributes in the form of hash
55
61
  def initialize(attributes = {})
@@ -214,7 +220,11 @@ module AylienNewsApi
214
220
  hash = {}
215
221
  self.class.attribute_map.each_pair do |attr, param|
216
222
  value = self.send(attr)
217
- next if value.nil?
223
+ if value.nil?
224
+ is_nullable = self.class.openapi_nullable.include?(attr)
225
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
226
+ end
227
+
218
228
  hash[param] = _to_hash(value)
219
229
  end
220
230
  hash
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 3.0
7
7
  Contact: support@aylien.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.1.3-SNAPSHOT
9
+ OpenAPI Generator version: 5.0.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -30,6 +30,12 @@ module AylienNewsApi
30
30
  }
31
31
  end
32
32
 
33
+ # List of attributes with nullable: true
34
+ def self.openapi_nullable
35
+ Set.new([
36
+ ])
37
+ end
38
+
33
39
  # Initializes the object
34
40
  # @param [Hash] attributes Model attributes in the form of hash
35
41
  def initialize(attributes = {})
@@ -169,7 +175,11 @@ module AylienNewsApi
169
175
  hash = {}
170
176
  self.class.attribute_map.each_pair do |attr, param|
171
177
  value = self.send(attr)
172
- next if value.nil?
178
+ if value.nil?
179
+ is_nullable = self.class.openapi_nullable.include?(attr)
180
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
181
+ end
182
+
173
183
  hash[param] = _to_hash(value)
174
184
  end
175
185
  hash
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 3.0
7
7
  Contact: support@aylien.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.1.3-SNAPSHOT
9
+ OpenAPI Generator version: 5.0.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -30,6 +30,12 @@ module AylienNewsApi
30
30
  }
31
31
  end
32
32
 
33
+ # List of attributes with nullable: true
34
+ def self.openapi_nullable
35
+ Set.new([
36
+ ])
37
+ end
38
+
33
39
  # Initializes the object
34
40
  # @param [Hash] attributes Model attributes in the form of hash
35
41
  def initialize(attributes = {})
@@ -171,7 +177,11 @@ module AylienNewsApi
171
177
  hash = {}
172
178
  self.class.attribute_map.each_pair do |attr, param|
173
179
  value = self.send(attr)
174
- next if value.nil?
180
+ if value.nil?
181
+ is_nullable = self.class.openapi_nullable.include?(attr)
182
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
183
+ end
184
+
175
185
  hash[param] = _to_hash(value)
176
186
  end
177
187
  hash
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 3.0
7
7
  Contact: support@aylien.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.1.3-SNAPSHOT
9
+ OpenAPI Generator version: 5.0.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -36,6 +36,12 @@ module AylienNewsApi
36
36
  }
37
37
  end
38
38
 
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
39
45
  # Initializes the object
40
46
  # @param [Hash] attributes Model attributes in the form of hash
41
47
  def initialize(attributes = {})
@@ -180,7 +186,11 @@ module AylienNewsApi
180
186
  hash = {}
181
187
  self.class.attribute_map.each_pair do |attr, param|
182
188
  value = self.send(attr)
183
- next if value.nil?
189
+ if value.nil?
190
+ is_nullable = self.class.openapi_nullable.include?(attr)
191
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
192
+ end
193
+
184
194
  hash[param] = _to_hash(value)
185
195
  end
186
196
  hash
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 3.0
7
7
  Contact: support@aylien.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.1.3-SNAPSHOT
9
+ OpenAPI Generator version: 5.0.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -28,6 +28,12 @@ module AylienNewsApi
28
28
  # The intervals of the histograms
29
29
  attr_accessor :intervals
30
30
 
31
+ # The end of a period in which searched stories were published
32
+ attr_accessor :published_at_end
33
+
34
+ # The start of a period in which searched stories were published
35
+ attr_accessor :published_at_start
36
+
31
37
  # Attribute mapping from ruby-style variable name to JSON key.
32
38
  def self.attribute_map
33
39
  {
@@ -35,7 +41,9 @@ module AylienNewsApi
35
41
  :'interval_end' => :'interval.end',
36
42
  :'interval_start' => :'interval.start',
37
43
  :'interval_width' => :'interval.width',
38
- :'intervals' => :'intervals'
44
+ :'intervals' => :'intervals',
45
+ :'published_at_end' => :'published_at.end',
46
+ :'published_at_start' => :'published_at.start'
39
47
  }
40
48
  end
41
49
 
@@ -46,10 +54,18 @@ module AylienNewsApi
46
54
  :'interval_end' => :'Integer',
47
55
  :'interval_start' => :'Integer',
48
56
  :'interval_width' => :'Integer',
49
- :'intervals' => :'Array<HistogramInterval>'
57
+ :'intervals' => :'Array<HistogramInterval>',
58
+ :'published_at_end' => :'DateTime',
59
+ :'published_at_start' => :'DateTime'
50
60
  }
51
61
  end
52
62
 
63
+ # List of attributes with nullable: true
64
+ def self.openapi_nullable
65
+ Set.new([
66
+ ])
67
+ end
68
+
53
69
  # Initializes the object
54
70
  # @param [Hash] attributes Model attributes in the form of hash
55
71
  def initialize(attributes = {})
@@ -86,6 +102,14 @@ module AylienNewsApi
86
102
  self.intervals = value
87
103
  end
88
104
  end
105
+
106
+ if attributes.key?(:'published_at_end')
107
+ self.published_at_end = attributes[:'published_at_end']
108
+ end
109
+
110
+ if attributes.key?(:'published_at_start')
111
+ self.published_at_start = attributes[:'published_at_start']
112
+ end
89
113
  end
90
114
 
91
115
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -110,7 +134,9 @@ module AylienNewsApi
110
134
  interval_end == o.interval_end &&
111
135
  interval_start == o.interval_start &&
112
136
  interval_width == o.interval_width &&
113
- intervals == o.intervals
137
+ intervals == o.intervals &&
138
+ published_at_end == o.published_at_end &&
139
+ published_at_start == o.published_at_start
114
140
  end
115
141
 
116
142
  # @see the `==` method
@@ -122,7 +148,7 @@ module AylienNewsApi
122
148
  # Calculates hash code according to all attributes.
123
149
  # @return [Integer] Hash code
124
150
  def hash
125
- [field, interval_end, interval_start, interval_width, intervals].hash
151
+ [field, interval_end, interval_start, interval_width, intervals, published_at_end, published_at_start].hash
126
152
  end
127
153
 
128
154
  # Builds the object from hash
@@ -211,7 +237,11 @@ module AylienNewsApi
211
237
  hash = {}
212
238
  self.class.attribute_map.each_pair do |attr, param|
213
239
  value = self.send(attr)
214
- next if value.nil?
240
+ if value.nil?
241
+ is_nullable = self.class.openapi_nullable.include?(attr)
242
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
243
+ end
244
+
215
245
  hash[param] = _to_hash(value)
216
246
  end
217
247
  hash
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 3.0
7
7
  Contact: support@aylien.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.1.3-SNAPSHOT
9
+ OpenAPI Generator version: 5.0.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -41,6 +41,12 @@ module AylienNewsApi
41
41
  }
42
42
  end
43
43
 
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
44
50
  # Initializes the object
45
51
  # @param [Hash] attributes Model attributes in the form of hash
46
52
  def initialize(attributes = {})
@@ -190,7 +196,11 @@ module AylienNewsApi
190
196
  hash = {}
191
197
  self.class.attribute_map.each_pair do |attr, param|
192
198
  value = self.send(attr)
193
- next if value.nil?
199
+ if value.nil?
200
+ is_nullable = self.class.openapi_nullable.include?(attr)
201
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
202
+ end
203
+
194
204
  hash[param] = _to_hash(value)
195
205
  end
196
206
  hash
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 3.0
7
7
  Contact: support@aylien.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.1.3-SNAPSHOT
9
+ OpenAPI Generator version: 5.0.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -17,13 +17,11 @@ module AylienNewsApi
17
17
  # The content length of media
18
18
  attr_accessor :content_length
19
19
 
20
- # The format of media
21
20
  attr_accessor :format
22
21
 
23
22
  # The height of media
24
23
  attr_accessor :height
25
24
 
26
- # The type of media
27
25
  attr_accessor :type
28
26
 
29
27
  # A URL which points to the media file
@@ -32,28 +30,6 @@ module AylienNewsApi
32
30
  # The width of media
33
31
  attr_accessor :width
34
32
 
35
- class EnumAttributeValidator
36
- attr_reader :datatype
37
- attr_reader :allowable_values
38
-
39
- def initialize(datatype, allowable_values)
40
- @allowable_values = allowable_values.map do |value|
41
- case datatype.to_s
42
- when /Integer/i
43
- value.to_i
44
- when /Float/i
45
- value.to_f
46
- else
47
- value
48
- end
49
- end
50
- end
51
-
52
- def valid?(value)
53
- !value || allowable_values.include?(value)
54
- end
55
- end
56
-
57
33
  # Attribute mapping from ruby-style variable name to JSON key.
58
34
  def self.attribute_map
59
35
  {
@@ -70,14 +46,20 @@ module AylienNewsApi
70
46
  def self.openapi_types
71
47
  {
72
48
  :'content_length' => :'Integer',
73
- :'format' => :'String',
49
+ :'format' => :'MediaFormat',
74
50
  :'height' => :'Integer',
75
- :'type' => :'String',
51
+ :'type' => :'MediaType',
76
52
  :'url' => :'String',
77
53
  :'width' => :'Integer'
78
54
  }
79
55
  end
80
56
 
57
+ # List of attributes with nullable: true
58
+ def self.openapi_nullable
59
+ Set.new([
60
+ ])
61
+ end
62
+
81
63
  # Initializes the object
82
64
  # @param [Hash] attributes Model attributes in the form of hash
83
65
  def initialize(attributes = {})
@@ -128,33 +110,9 @@ module AylienNewsApi
128
110
  # Check to see if the all the properties in the model are valid
129
111
  # @return true if the model is valid
130
112
  def valid?
131
- format_validator = EnumAttributeValidator.new('String', ["BMP", "GIF", "JPEG", "PNG", "TIFF", "PSD", "ICO", "CUR", "WEBP", "SVG"])
132
- return false unless format_validator.valid?(@format)
133
- type_validator = EnumAttributeValidator.new('String', ["image", "video"])
134
- return false unless type_validator.valid?(@type)
135
113
  true
136
114
  end
137
115
 
138
- # Custom attribute writer method checking allowed values (enum).
139
- # @param [Object] format Object to be assigned
140
- def format=(format)
141
- validator = EnumAttributeValidator.new('String', ["BMP", "GIF", "JPEG", "PNG", "TIFF", "PSD", "ICO", "CUR", "WEBP", "SVG"])
142
- unless validator.valid?(format)
143
- fail ArgumentError, "invalid value for \"format\", must be one of #{validator.allowable_values}."
144
- end
145
- @format = format
146
- end
147
-
148
- # Custom attribute writer method checking allowed values (enum).
149
- # @param [Object] type Object to be assigned
150
- def type=(type)
151
- validator = EnumAttributeValidator.new('String', ["image", "video"])
152
- unless validator.valid?(type)
153
- fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
154
- end
155
- @type = type
156
- end
157
-
158
116
  # Checks equality by comparing each attribute.
159
117
  # @param [Object] Object to be compared
160
118
  def ==(o)
@@ -266,7 +224,11 @@ module AylienNewsApi
266
224
  hash = {}
267
225
  self.class.attribute_map.each_pair do |attr, param|
268
226
  value = self.send(attr)
269
- next if value.nil?
227
+ if value.nil?
228
+ is_nullable = self.class.openapi_nullable.include?(attr)
229
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
230
+ end
231
+
270
232
  hash[param] = _to_hash(value)
271
233
  end
272
234
  hash