aylien_news_api 1.0.0 → 3.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 (135) hide show
  1. checksums.yaml +5 -5
  2. data/Gemfile +6 -0
  3. data/README.md +117 -4
  4. data/Rakefile +2 -0
  5. data/aylien_news_api.gemspec +16 -27
  6. data/docs/Author.md +12 -1
  7. data/docs/Autocomplete.md +10 -0
  8. data/docs/Autocompletes.md +9 -0
  9. data/docs/Category.md +17 -3
  10. data/docs/CategoryLinks.md +11 -1
  11. data/docs/Cluster.md +29 -0
  12. data/docs/Clusters.md +21 -0
  13. data/docs/Coverages.md +16 -4
  14. data/docs/DefaultApi.md +1250 -1117
  15. data/docs/Entities.md +11 -1
  16. data/docs/Entity.md +16 -3
  17. data/docs/EntityLinks.md +9 -0
  18. data/docs/Error.md +16 -2
  19. data/docs/ErrorLinks.md +9 -0
  20. data/docs/Errors.md +9 -0
  21. data/docs/HistogramInterval.md +10 -0
  22. data/docs/Histograms.md +16 -3
  23. data/docs/Location.md +13 -2
  24. data/docs/Media.md +17 -3
  25. data/docs/Rank.md +12 -1
  26. data/docs/Rankings.md +9 -0
  27. data/docs/RelatedStories.md +14 -3
  28. data/docs/RepresentativeStory.md +23 -0
  29. data/docs/Scope.md +14 -2
  30. data/docs/Sentiment.md +10 -0
  31. data/docs/Sentiments.md +12 -2
  32. data/docs/ShareCount.md +10 -0
  33. data/docs/ShareCounts.md +12 -0
  34. data/docs/Source.md +27 -8
  35. data/docs/Stories.md +11 -2
  36. data/docs/Story.md +48 -16
  37. data/docs/StoryCluster.md +14 -1
  38. data/docs/StoryLinks.md +14 -2
  39. data/docs/StoryTranslations.md +17 -0
  40. data/docs/StoryTranslationsEn.md +21 -0
  41. data/docs/Summary.md +9 -0
  42. data/docs/TimeSeries.md +11 -1
  43. data/docs/TimeSeriesList.md +15 -3
  44. data/docs/Trend.md +11 -1
  45. data/docs/Trends.md +11 -1
  46. data/git_push.sh +58 -0
  47. data/lib/aylien_news_api.rb +11 -10
  48. data/lib/aylien_news_api/api/default_api.rb +2065 -1801
  49. data/lib/aylien_news_api/api_client.rb +129 -108
  50. data/lib/aylien_news_api/api_error.rb +25 -10
  51. data/lib/aylien_news_api/configuration.rb +69 -33
  52. data/lib/aylien_news_api/models/author.rb +50 -46
  53. data/lib/aylien_news_api/models/autocomplete.rb +36 -32
  54. data/lib/aylien_news_api/models/autocompletes.rb +35 -31
  55. data/lib/aylien_news_api/models/category.rb +63 -59
  56. data/lib/aylien_news_api/models/category_links.rb +47 -43
  57. data/lib/aylien_news_api/models/cluster.rb +255 -0
  58. data/lib/aylien_news_api/models/clusters.rb +219 -0
  59. data/lib/aylien_news_api/models/coverages.rb +60 -68
  60. data/lib/aylien_news_api/models/entities.rb +48 -44
  61. data/lib/aylien_news_api/models/entity.rb +71 -69
  62. data/lib/aylien_news_api/models/entity_links.rb +35 -31
  63. data/lib/aylien_news_api/models/error.rb +60 -56
  64. data/lib/aylien_news_api/models/error_links.rb +35 -31
  65. data/lib/aylien_news_api/models/errors.rb +35 -31
  66. data/lib/aylien_news_api/models/histogram_interval.rb +36 -32
  67. data/lib/aylien_news_api/models/histograms.rb +62 -58
  68. data/lib/aylien_news_api/models/location.rb +51 -47
  69. data/lib/aylien_news_api/models/media.rb +81 -76
  70. data/lib/aylien_news_api/models/rank.rb +48 -44
  71. data/lib/aylien_news_api/models/rankings.rb +35 -31
  72. data/lib/aylien_news_api/models/related_stories.rb +53 -61
  73. data/lib/aylien_news_api/models/representative_story.rb +227 -0
  74. data/lib/aylien_news_api/models/scope.rb +59 -54
  75. data/lib/aylien_news_api/models/sentiment.rb +41 -37
  76. data/lib/aylien_news_api/models/sentiments.rb +46 -44
  77. data/lib/aylien_news_api/models/share_count.rb +36 -32
  78. data/lib/aylien_news_api/models/share_counts.rb +38 -34
  79. data/lib/aylien_news_api/models/source.rb +95 -92
  80. data/lib/aylien_news_api/models/stories.rb +47 -55
  81. data/lib/aylien_news_api/models/story.rb +172 -154
  82. data/lib/aylien_news_api/models/story_cluster.rb +52 -48
  83. data/lib/aylien_news_api/models/story_links.rb +58 -54
  84. data/lib/aylien_news_api/models/story_translations.rb +197 -0
  85. data/lib/aylien_news_api/models/story_translations_en.rb +217 -0
  86. data/lib/aylien_news_api/models/summary.rb +35 -31
  87. data/lib/aylien_news_api/models/time_series.rb +47 -43
  88. data/lib/aylien_news_api/models/time_series_list.rb +56 -52
  89. data/lib/aylien_news_api/models/trend.rb +47 -43
  90. data/lib/aylien_news_api/models/trends.rb +48 -44
  91. data/lib/aylien_news_api/version.rb +7 -11
  92. data/spec/api/default_api_spec.rb +569 -533
  93. data/spec/api_client_spec.rb +34 -76
  94. data/spec/configuration_spec.rb +14 -18
  95. data/spec/models/author_spec.rb +15 -18
  96. data/spec/models/autocomplete_spec.rb +11 -14
  97. data/spec/models/autocompletes_spec.rb +10 -13
  98. data/spec/models/category_links_spec.rb +13 -16
  99. data/spec/models/category_spec.rb +24 -27
  100. data/spec/models/cluster_spec.rb +77 -0
  101. data/spec/models/clusters_spec.rb +53 -0
  102. data/spec/models/coverages_spec.rb +17 -26
  103. data/spec/models/entities_spec.rb +13 -16
  104. data/spec/models/entity_links_spec.rb +10 -13
  105. data/spec/models/entity_spec.rb +19 -22
  106. data/spec/models/error_links_spec.rb +10 -13
  107. data/spec/models/error_spec.rb +21 -24
  108. data/spec/models/errors_spec.rb +10 -13
  109. data/spec/models/histogram_interval_spec.rb +11 -14
  110. data/spec/models/histograms_spec.rb +18 -21
  111. data/spec/models/location_spec.rb +15 -18
  112. data/spec/models/media_spec.rb +29 -32
  113. data/spec/models/rank_spec.rb +15 -18
  114. data/spec/models/rankings_spec.rb +10 -13
  115. data/spec/models/related_stories_spec.rb +15 -24
  116. data/spec/models/representative_story_spec.rb +59 -0
  117. data/spec/models/scope_spec.rb +21 -24
  118. data/spec/models/sentiment_spec.rb +15 -18
  119. data/spec/models/sentiments_spec.rb +13 -16
  120. data/spec/models/share_count_spec.rb +11 -14
  121. data/spec/models/share_counts_spec.rb +13 -16
  122. data/spec/models/source_spec.rb +29 -32
  123. data/spec/models/stories_spec.rb +13 -22
  124. data/spec/models/story_cluster_spec.rb +17 -20
  125. data/spec/models/story_links_spec.rb +17 -20
  126. data/spec/models/story_spec.rb +59 -50
  127. data/spec/models/story_translations_en_spec.rb +53 -0
  128. data/spec/models/story_translations_spec.rb +41 -0
  129. data/spec/models/summary_spec.rb +10 -13
  130. data/spec/models/time_series_list_spec.rb +16 -19
  131. data/spec/models/time_series_spec.rb +13 -16
  132. data/spec/models/trend_spec.rb +13 -16
  133. data/spec/models/trends_spec.rb +13 -16
  134. data/spec/spec_helper.rb +6 -10
  135. metadata +68 -194
@@ -1,23 +1,18 @@
1
1
  =begin
2
- Copyright 2017 Aylien, Inc. All Rights Reserved.
2
+ #AYLIEN News API
3
3
 
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
4
+ #The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client.
7
5
 
8
- http://www.apache.org/licenses/LICENSE-2.0
6
+ The version of the OpenAPI document: 3.0
7
+ Contact: support@aylien.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.1.3-SNAPSHOT
9
10
 
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
11
  =end
16
12
 
17
13
  require 'date'
18
14
 
19
15
  module AylienNewsApi
20
-
21
16
  class ShareCounts
22
17
  # Facebook shares count
23
18
  attr_accessor :facebook
@@ -31,7 +26,6 @@ module AylienNewsApi
31
26
  # Reddit shares count
32
27
  attr_accessor :reddit
33
28
 
34
-
35
29
  # Attribute mapping from ruby-style variable name to JSON key.
36
30
  def self.attribute_map
37
31
  {
@@ -43,7 +37,7 @@ module AylienNewsApi
43
37
  end
44
38
 
45
39
  # Attribute type mapping.
46
- def self.api_types
40
+ def self.openapi_types
47
41
  {
48
42
  :'facebook' => :'Array<ShareCount>',
49
43
  :'google_plus' => :'Array<ShareCount>',
@@ -55,48 +49,54 @@ module AylienNewsApi
55
49
  # Initializes the object
56
50
  # @param [Hash] attributes Model attributes in the form of hash
57
51
  def initialize(attributes = {})
58
- return unless attributes.is_a?(Hash)
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `AylienNewsApi::ShareCounts` initialize method"
54
+ end
59
55
 
60
- # convert string to symbol for hash key
61
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `AylienNewsApi::ShareCounts`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
62
63
 
63
- if attributes.has_key?(:'facebook')
64
+ if attributes.key?(:'facebook')
64
65
  if (value = attributes[:'facebook']).is_a?(Array)
65
66
  self.facebook = value
66
67
  end
67
68
  end
68
69
 
69
- if attributes.has_key?(:'google_plus')
70
+ if attributes.key?(:'google_plus')
70
71
  if (value = attributes[:'google_plus']).is_a?(Array)
71
72
  self.google_plus = value
72
73
  end
73
74
  end
74
75
 
75
- if attributes.has_key?(:'linkedin')
76
+ if attributes.key?(:'linkedin')
76
77
  if (value = attributes[:'linkedin']).is_a?(Array)
77
78
  self.linkedin = value
78
79
  end
79
80
  end
80
81
 
81
- if attributes.has_key?(:'reddit')
82
+ if attributes.key?(:'reddit')
82
83
  if (value = attributes[:'reddit']).is_a?(Array)
83
84
  self.reddit = value
84
85
  end
85
86
  end
86
-
87
87
  end
88
88
 
89
89
  # Show invalid properties with the reasons. Usually used together with valid?
90
- # @return Array for valid properies with the reasons
90
+ # @return Array for valid properties with the reasons
91
91
  def list_invalid_properties
92
92
  invalid_properties = Array.new
93
- return invalid_properties
93
+ invalid_properties
94
94
  end
95
95
 
96
96
  # Check to see if the all the properties in the model are valid
97
97
  # @return true if the model is valid
98
98
  def valid?
99
- return true
99
+ true
100
100
  end
101
101
 
102
102
  # Checks equality by comparing each attribute.
@@ -117,22 +117,29 @@ module AylienNewsApi
117
117
  end
118
118
 
119
119
  # Calculates hash code according to all attributes.
120
- # @return [Fixnum] Hash code
120
+ # @return [Integer] Hash code
121
121
  def hash
122
122
  [facebook, google_plus, linkedin, reddit].hash
123
123
  end
124
124
 
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def self.build_from_hash(attributes)
129
+ new.build_from_hash(attributes)
130
+ end
131
+
125
132
  # Builds the object from hash
126
133
  # @param [Hash] attributes Model attributes in the form of hash
127
134
  # @return [Object] Returns the model itself
128
135
  def build_from_hash(attributes)
129
136
  return nil unless attributes.is_a?(Hash)
130
- self.class.api_types.each_pair do |key, type|
137
+ self.class.openapi_types.each_pair do |key, type|
131
138
  if type =~ /\AArray<(.*)>/i
132
- # check to ensure the input is an array given that the the attribute
139
+ # check to ensure the input is an array given that the attribute
133
140
  # is documented as an array but the input is not
134
141
  if attributes[self.class.attribute_map[key]].is_a?(Array)
135
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
142
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
136
143
  end
137
144
  elsif !attributes[self.class.attribute_map[key]].nil?
138
145
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
@@ -158,7 +165,7 @@ module AylienNewsApi
158
165
  value.to_i
159
166
  when :Float
160
167
  value.to_f
161
- when :BOOLEAN
168
+ when :Boolean
162
169
  if value.to_s =~ /\A(true|t|yes|y|1)\z/i
163
170
  true
164
171
  else
@@ -179,8 +186,7 @@ module AylienNewsApi
179
186
  end
180
187
  end
181
188
  else # model
182
- temp_model = AylienNewsApi.const_get(type).new
183
- temp_model.build_from_hash(value)
189
+ AylienNewsApi.const_get(type).build_from_hash(value)
184
190
  end
185
191
  end
186
192
 
@@ -214,7 +220,7 @@ module AylienNewsApi
214
220
  # @return [Hash] Returns the value in the form of hash
215
221
  def _to_hash(value)
216
222
  if value.is_a?(Array)
217
- value.compact.map{ |v| _to_hash(v) }
223
+ value.compact.map { |v| _to_hash(v) }
218
224
  elsif value.is_a?(Hash)
219
225
  {}.tap do |hash|
220
226
  value.each { |k, v| hash[k] = _to_hash(v) }
@@ -225,7 +231,5 @@ module AylienNewsApi
225
231
  value
226
232
  end
227
233
  end
228
-
229
234
  end
230
-
231
235
  end
@@ -1,161 +1,160 @@
1
1
  =begin
2
- Copyright 2017 Aylien, Inc. All Rights Reserved.
2
+ #AYLIEN News API
3
3
 
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
4
+ #The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client.
7
5
 
8
- http://www.apache.org/licenses/LICENSE-2.0
6
+ The version of the OpenAPI document: 3.0
7
+ Contact: support@aylien.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.1.3-SNAPSHOT
9
10
 
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
11
  =end
16
12
 
17
13
  require 'date'
18
14
 
19
15
  module AylienNewsApi
20
-
21
16
  class Source
22
- # The source id which is a unique value
23
- attr_accessor :id
24
-
25
- # The source name
26
- attr_accessor :name
27
-
28
- # The title of the home page URL
29
- attr_accessor :title
30
-
31
17
  # A general explanation about the source
32
18
  attr_accessor :description
33
19
 
34
- # The number of websites that link to the source
35
- attr_accessor :links_in_count
20
+ # The domain name of the source which is extracted from the source URL
21
+ attr_accessor :domain
36
22
 
37
23
  # The home page URL of the source
38
24
  attr_accessor :home_page_url
39
25
 
40
- # The domain name of the source which is extracted from the source URL
41
- attr_accessor :domain
26
+ # The source id which is a unique value
27
+ attr_accessor :id
42
28
 
43
- # A URL which points to the source logo
44
- attr_accessor :logo_url
29
+ # The number of websites that link to the source
30
+ attr_accessor :links_in_count
45
31
 
46
- # The source locations which are tend to be the physical locations of the source, e.g. BBC headquarter is located in London.
32
+ # The source locations which are tend to be the physical locations of the source, e.g. BBC headquarter is located in London.
47
33
  attr_accessor :locations
48
34
 
49
- # The source scopes which is tend to be scope locations of the source, e.g. BBC scopes is international.
50
- attr_accessor :scopes
35
+ # A URL which points to the source logo
36
+ attr_accessor :logo_url
37
+
38
+ # The source name
39
+ attr_accessor :name
51
40
 
52
- # The web rankings of the source
53
41
  attr_accessor :rankings
54
42
 
43
+ # The source scopes which is tend to be scope locations of the source, e.g. BBC scopes is international.
44
+ attr_accessor :scopes
45
+
46
+ # The title of the home page URL
47
+ attr_accessor :title
55
48
 
56
49
  # Attribute mapping from ruby-style variable name to JSON key.
57
50
  def self.attribute_map
58
51
  {
59
- :'id' => :'id',
60
- :'name' => :'name',
61
- :'title' => :'title',
62
52
  :'description' => :'description',
63
- :'links_in_count' => :'links_in_count',
64
- :'home_page_url' => :'home_page_url',
65
53
  :'domain' => :'domain',
66
- :'logo_url' => :'logo_url',
54
+ :'home_page_url' => :'home_page_url',
55
+ :'id' => :'id',
56
+ :'links_in_count' => :'links_in_count',
67
57
  :'locations' => :'locations',
58
+ :'logo_url' => :'logo_url',
59
+ :'name' => :'name',
60
+ :'rankings' => :'rankings',
68
61
  :'scopes' => :'scopes',
69
- :'rankings' => :'rankings'
62
+ :'title' => :'title'
70
63
  }
71
64
  end
72
65
 
73
66
  # Attribute type mapping.
74
- def self.api_types
67
+ def self.openapi_types
75
68
  {
76
- :'id' => :'Integer',
77
- :'name' => :'String',
78
- :'title' => :'String',
79
69
  :'description' => :'String',
80
- :'links_in_count' => :'Integer',
81
- :'home_page_url' => :'String',
82
70
  :'domain' => :'String',
83
- :'logo_url' => :'String',
71
+ :'home_page_url' => :'String',
72
+ :'id' => :'Integer',
73
+ :'links_in_count' => :'Integer',
84
74
  :'locations' => :'Array<Location>',
75
+ :'logo_url' => :'String',
76
+ :'name' => :'String',
77
+ :'rankings' => :'Rankings',
85
78
  :'scopes' => :'Array<Scope>',
86
- :'rankings' => :'Rankings'
79
+ :'title' => :'String'
87
80
  }
88
81
  end
89
82
 
90
83
  # Initializes the object
91
84
  # @param [Hash] attributes Model attributes in the form of hash
92
85
  def initialize(attributes = {})
93
- return unless attributes.is_a?(Hash)
86
+ if (!attributes.is_a?(Hash))
87
+ fail ArgumentError, "The input argument (attributes) must be a hash in `AylienNewsApi::Source` initialize method"
88
+ end
94
89
 
95
- # convert string to symbol for hash key
96
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
90
+ # check to see if the attribute exists and convert string to symbol for hash key
91
+ attributes = attributes.each_with_object({}) { |(k, v), h|
92
+ if (!self.class.attribute_map.key?(k.to_sym))
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `AylienNewsApi::Source`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
94
+ end
95
+ h[k.to_sym] = v
96
+ }
97
97
 
98
- if attributes.has_key?(:'id')
99
- self.id = attributes[:'id']
98
+ if attributes.key?(:'description')
99
+ self.description = attributes[:'description']
100
100
  end
101
101
 
102
- if attributes.has_key?(:'name')
103
- self.name = attributes[:'name']
102
+ if attributes.key?(:'domain')
103
+ self.domain = attributes[:'domain']
104
104
  end
105
105
 
106
- if attributes.has_key?(:'title')
107
- self.title = attributes[:'title']
106
+ if attributes.key?(:'home_page_url')
107
+ self.home_page_url = attributes[:'home_page_url']
108
108
  end
109
109
 
110
- if attributes.has_key?(:'description')
111
- self.description = attributes[:'description']
110
+ if attributes.key?(:'id')
111
+ self.id = attributes[:'id']
112
112
  end
113
113
 
114
- if attributes.has_key?(:'links_in_count')
114
+ if attributes.key?(:'links_in_count')
115
115
  self.links_in_count = attributes[:'links_in_count']
116
116
  end
117
117
 
118
- if attributes.has_key?(:'home_page_url')
119
- self.home_page_url = attributes[:'home_page_url']
118
+ if attributes.key?(:'locations')
119
+ if (value = attributes[:'locations']).is_a?(Array)
120
+ self.locations = value
121
+ end
120
122
  end
121
123
 
122
- if attributes.has_key?(:'domain')
123
- self.domain = attributes[:'domain']
124
+ if attributes.key?(:'logo_url')
125
+ self.logo_url = attributes[:'logo_url']
124
126
  end
125
127
 
126
- if attributes.has_key?(:'logo_url')
127
- self.logo_url = attributes[:'logo_url']
128
+ if attributes.key?(:'name')
129
+ self.name = attributes[:'name']
128
130
  end
129
131
 
130
- if attributes.has_key?(:'locations')
131
- if (value = attributes[:'locations']).is_a?(Array)
132
- self.locations = value
133
- end
132
+ if attributes.key?(:'rankings')
133
+ self.rankings = attributes[:'rankings']
134
134
  end
135
135
 
136
- if attributes.has_key?(:'scopes')
136
+ if attributes.key?(:'scopes')
137
137
  if (value = attributes[:'scopes']).is_a?(Array)
138
138
  self.scopes = value
139
139
  end
140
140
  end
141
141
 
142
- if attributes.has_key?(:'rankings')
143
- self.rankings = attributes[:'rankings']
142
+ if attributes.key?(:'title')
143
+ self.title = attributes[:'title']
144
144
  end
145
-
146
145
  end
147
146
 
148
147
  # Show invalid properties with the reasons. Usually used together with valid?
149
- # @return Array for valid properies with the reasons
148
+ # @return Array for valid properties with the reasons
150
149
  def list_invalid_properties
151
150
  invalid_properties = Array.new
152
- return invalid_properties
151
+ invalid_properties
153
152
  end
154
153
 
155
154
  # Check to see if the all the properties in the model are valid
156
155
  # @return true if the model is valid
157
156
  def valid?
158
- return true
157
+ true
159
158
  end
160
159
 
161
160
  # Checks equality by comparing each attribute.
@@ -163,17 +162,17 @@ module AylienNewsApi
163
162
  def ==(o)
164
163
  return true if self.equal?(o)
165
164
  self.class == o.class &&
166
- id == o.id &&
167
- name == o.name &&
168
- title == o.title &&
169
165
  description == o.description &&
170
- links_in_count == o.links_in_count &&
171
- home_page_url == o.home_page_url &&
172
166
  domain == o.domain &&
173
- logo_url == o.logo_url &&
167
+ home_page_url == o.home_page_url &&
168
+ id == o.id &&
169
+ links_in_count == o.links_in_count &&
174
170
  locations == o.locations &&
171
+ logo_url == o.logo_url &&
172
+ name == o.name &&
173
+ rankings == o.rankings &&
175
174
  scopes == o.scopes &&
176
- rankings == o.rankings
175
+ title == o.title
177
176
  end
178
177
 
179
178
  # @see the `==` method
@@ -183,9 +182,16 @@ module AylienNewsApi
183
182
  end
184
183
 
185
184
  # Calculates hash code according to all attributes.
186
- # @return [Fixnum] Hash code
185
+ # @return [Integer] Hash code
187
186
  def hash
188
- [id, name, title, description, links_in_count, home_page_url, domain, logo_url, locations, scopes, rankings].hash
187
+ [description, domain, home_page_url, id, links_in_count, locations, logo_url, name, rankings, scopes, title].hash
188
+ end
189
+
190
+ # Builds the object from hash
191
+ # @param [Hash] attributes Model attributes in the form of hash
192
+ # @return [Object] Returns the model itself
193
+ def self.build_from_hash(attributes)
194
+ new.build_from_hash(attributes)
189
195
  end
190
196
 
191
197
  # Builds the object from hash
@@ -193,12 +199,12 @@ module AylienNewsApi
193
199
  # @return [Object] Returns the model itself
194
200
  def build_from_hash(attributes)
195
201
  return nil unless attributes.is_a?(Hash)
196
- self.class.api_types.each_pair do |key, type|
202
+ self.class.openapi_types.each_pair do |key, type|
197
203
  if type =~ /\AArray<(.*)>/i
198
- # check to ensure the input is an array given that the the attribute
204
+ # check to ensure the input is an array given that the attribute
199
205
  # is documented as an array but the input is not
200
206
  if attributes[self.class.attribute_map[key]].is_a?(Array)
201
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
207
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
202
208
  end
203
209
  elsif !attributes[self.class.attribute_map[key]].nil?
204
210
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
@@ -224,7 +230,7 @@ module AylienNewsApi
224
230
  value.to_i
225
231
  when :Float
226
232
  value.to_f
227
- when :BOOLEAN
233
+ when :Boolean
228
234
  if value.to_s =~ /\A(true|t|yes|y|1)\z/i
229
235
  true
230
236
  else
@@ -245,8 +251,7 @@ module AylienNewsApi
245
251
  end
246
252
  end
247
253
  else # model
248
- temp_model = AylienNewsApi.const_get(type).new
249
- temp_model.build_from_hash(value)
254
+ AylienNewsApi.const_get(type).build_from_hash(value)
250
255
  end
251
256
  end
252
257
 
@@ -280,7 +285,7 @@ module AylienNewsApi
280
285
  # @return [Hash] Returns the value in the form of hash
281
286
  def _to_hash(value)
282
287
  if value.is_a?(Array)
283
- value.compact.map{ |v| _to_hash(v) }
288
+ value.compact.map { |v| _to_hash(v) }
284
289
  elsif value.is_a?(Hash)
285
290
  {}.tap do |hash|
286
291
  value.each { |k, v| hash[k] = _to_hash(v) }
@@ -291,7 +296,5 @@ module AylienNewsApi
291
296
  value
292
297
  end
293
298
  end
294
-
295
299
  end
296
-
297
300
  end