aylien_news_api 4.3.0 → 4.5.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 (50) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +100 -31
  3. data/docs/DefaultApi.md +357 -189
  4. data/docs/DeprecatedEntities.md +19 -0
  5. data/docs/DeprecatedEntity.md +33 -0
  6. data/docs/DeprecatedEntitySurfaceForm.md +21 -0
  7. data/docs/DeprecatedRelatedStories.md +27 -0
  8. data/docs/DeprecatedStories.md +25 -0
  9. data/docs/DeprecatedStory.md +61 -0
  10. data/docs/Entity.md +12 -10
  11. data/docs/EntityInText.md +19 -0
  12. data/docs/EntityMention.md +19 -0
  13. data/docs/EntityMentionIndex.md +19 -0
  14. data/docs/EntitySurfaceForm.md +4 -2
  15. data/docs/Story.md +1 -1
  16. data/lib/aylien_news_api/api/default_api.rb +452 -200
  17. data/lib/aylien_news_api/models/deprecated_entities.rb +221 -0
  18. data/lib/aylien_news_api/models/deprecated_entity.rb +314 -0
  19. data/lib/aylien_news_api/models/deprecated_entity_surface_form.rb +244 -0
  20. data/lib/aylien_news_api/models/deprecated_related_stories.rb +260 -0
  21. data/lib/aylien_news_api/models/deprecated_stories.rb +252 -0
  22. data/lib/aylien_news_api/models/deprecated_story.rb +429 -0
  23. data/lib/aylien_news_api/models/entity.rb +90 -44
  24. data/lib/aylien_news_api/models/entity_in_text.rb +217 -0
  25. data/lib/aylien_news_api/models/entity_mention.rb +215 -0
  26. data/lib/aylien_news_api/models/entity_mention_index.rb +265 -0
  27. data/lib/aylien_news_api/models/entity_surface_form.rb +34 -9
  28. data/lib/aylien_news_api/models/related_stories.rb +1 -0
  29. data/lib/aylien_news_api/models/stories.rb +1 -0
  30. data/lib/aylien_news_api/models/story.rb +5 -2
  31. data/lib/aylien_news_api/version.rb +1 -1
  32. data/lib/aylien_news_api.rb +9 -1
  33. data/spec/api/default_api_spec.rb +208 -4
  34. data/spec/models/deprecated_entities_spec.rb +47 -0
  35. data/spec/models/deprecated_entity_spec.rb +89 -0
  36. data/spec/models/deprecated_entity_surface_form_spec.rb +53 -0
  37. data/spec/models/deprecated_related_stories_spec.rb +71 -0
  38. data/spec/models/deprecated_stories_spec.rb +65 -0
  39. data/spec/models/deprecated_story_spec.rb +173 -0
  40. data/spec/models/entity_in_text_spec.rb +47 -0
  41. data/spec/models/entity_links_spec.rb +6 -0
  42. data/spec/models/entity_mention_index_spec.rb +47 -0
  43. data/spec/models/entity_mention_spec.rb +47 -0
  44. data/spec/models/entity_spec.rb +23 -5
  45. data/spec/models/entity_surface_form_spec.rb +7 -1
  46. data/spec/models/nested_entity_spec.rb +19 -1
  47. data/spec/models/story_spec.rb +6 -0
  48. data/spec/models/time_series_spec.rb +6 -0
  49. data/spec/models/trend_spec.rb +6 -0
  50. metadata +38 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e8872966c462dd5f9290c8c20a39242b89cb12ae562e3261a7a7d04b067dc4e3
4
- data.tar.gz: e8085663acd78a8350d58c42acc3f6cd0dd411fd882fc21ac78713ca2dd713ee
3
+ metadata.gz: e176f5b1e738c3030926956cb506f764011dec94ef941f919dc8a3e9d4867548
4
+ data.tar.gz: adc5ecf9f8e8f0830c61ac641cffd833852726a977e45845aa78361716f66571
5
5
  SHA512:
6
- metadata.gz: ddc8364806c89ea1b4617bc16cb4eac9cd91be97d0c71398747bcb87c7caa6e83d2ef1511f9545727f60556f66ae174a9be214df1976a09e4c560b6aae99bc24
7
- data.tar.gz: ba2f333894e776d1375549d6ce7c751964ac532a31c42e823a3324a4574cadf3d084368a69571722bd1f4f60535e61bff8ac30eb3fb9e1a0a0b22e69947727ec
6
+ metadata.gz: d5c7cd99b6bdeae64f2bc452ea6d28297a39a0370b60d4956a0e2624f1655fae77e85bf5aae9cdefda19373eb6fc7b359a69f5b2aa55f3ecbaea1eabd0cb5073
7
+ data.tar.gz: 83323addc9aa798e9ae1375246daad57e5df13f4f5465fe17be0a6f8030bf84ead2d9dd05eee08cea01f69c7f0bf677f15192fb3d20aa96c4da01d1726053e2a
data/README.md CHANGED
@@ -1,22 +1,46 @@
1
- # AYLIEN News API - Ruby SDK
1
+ # aylien_news_api
2
2
 
3
- 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.
3
+ AylienNewsApi - the Ruby gem for the AYLIEN News API
4
4
 
5
- Sign up at [https://newsapi.aylien.com/](https://newsapi.aylien.com/).
5
+ 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.
6
6
 
7
- For more documentation see [https://newsapi.aylien.com/docs/](https://newsapi.aylien.com/docs/).
7
+
8
+ This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
9
+
10
+ - API version: 3.0
11
+ - Package version: 4.5.0
12
+ - Build package: org.openapitools.codegen.languages.RubyClientCodegen
13
+ For more information, please visit [https://newsapi.aylien.com/](https://newsapi.aylien.com/)
8
14
 
9
15
  ## Installation
10
16
 
11
- Add this to the Gemfile:
17
+ ### Build a gem
18
+
19
+ To build the Ruby code into a gem:
20
+
21
+ ```shell
22
+ gem build aylien_news_api.gemspec
23
+ ```
24
+
25
+ Then either install the gem locally:
12
26
 
13
- gem 'aylien_news_api', '~> 3.0.0'
27
+ ```shell
28
+ gem install ./aylien_news_api-4.5.0.gem
29
+ ```
30
+
31
+ (for development, run `gem install --dev ./aylien_news_api-4.5.0.gem` to install the development dependencies)
32
+
33
+ or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
34
+
35
+ Finally add this to the Gemfile:
36
+
37
+ gem 'aylien_news_api', '~> 4.5.0'
14
38
 
15
39
  ### Install from Git
16
40
 
17
- If the Ruby gem is hosted at a git repository: https://github.com/aylien/aylien_newsapi_ruby, then add the following in the Gemfile:
41
+ If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
18
42
 
19
- gem 'aylien_news_api', :git => 'https://github.com/aylien/aylien_newsapi_ruby.git'
43
+ gem 'aylien_news_api', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
20
44
 
21
45
  ### Include the Ruby code directly
22
46
 
@@ -29,39 +53,44 @@ ruby -Ilib script.rb
29
53
  ## Getting Started
30
54
 
31
55
  Please follow the [installation](#installation) procedure and then run the following code:
56
+
32
57
  ```ruby
33
58
  # Load the gem
34
59
  require 'aylien_news_api'
35
60
 
36
61
  # Setup authorization
37
62
  AylienNewsApi.configure do |config|
38
- config.api_key['X-AYLIEN-NewsAPI-Application-ID'] = ENV['NEWSAPI_APP_ID']
39
- config.api_key['X-AYLIEN-NewsAPI-Application-Key'] = ENV['NEWSAPI_APP_KEY']
63
+ # Configure API key authorization: app_id
64
+ config.api_key['X-AYLIEN-NewsAPI-Application-ID'] = 'YOUR API KEY'
65
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
66
+ #config.api_key_prefix['X-AYLIEN-NewsAPI-Application-ID'] = 'Bearer'
67
+
68
+ # Configure API key authorization: app_key
69
+ config.api_key['X-AYLIEN-NewsAPI-Application-Key'] = 'YOUR API KEY'
70
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
71
+ #config.api_key_prefix['X-AYLIEN-NewsAPI-Application-Key'] = 'Bearer'
40
72
  end
41
73
 
42
74
  api_instance = AylienNewsApi::DefaultApi.new
43
-
75
+ unknown_base_type = {"$and":[{"$or":[{"body":{"$text":"Tim Cook"}},{"social.shares.count.reddit.max":{"$gte":5000,"$boost":5}}]},{"entity":{"$and":[{"name":{"$text":"Apple","$boost":2}},{"$not":[{"type":{"$eq":"Fruit"}}]}]}}]} # UNKNOWN_BASE_TYPE | /stories body schema to perform an advanced search with logical operators and nested objects.
44
76
  opts = {
45
- title: 'trump',
46
- published_at_start: "NOW-7DAYS",
47
- published_at_end: "NOW",
48
- entities_body_links_dbpedia: [
49
- 'http://dbpedia.org/resource/Donald_Trump',
50
- ],
51
- not_language: ['en'],
52
- sort_by: 'social_shares_count.facebook'
77
+ published_at_start: 'published_at_start_example', # String | This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates).
78
+ published_at_end: 'published_at_end_example', # String | This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates).
79
+ _return: ['_return_example'], # Array<String> | This parameter is used for specifying return fields.
80
+ sort_by: 'published_at', # String | This parameter is used for changing the order column of the results. You can read about sorting results [here](https://newsapi.aylien.com/docs/sorting-results).
81
+ sort_direction: 'desc', # String | This parameter is used for changing the order direction of the result. You can read about sorting results [here](https://newsapi.aylien.com/docs/sorting-results).
82
+ cursor: '*', # String | This parameter is used for finding a specific page. You can read more about pagination of results [here](https://newsapi.aylien.com/docs/pagination-of-results).
83
+ per_page: 10 # Integer | This parameter is used for specifying number of items in each page You can read more about pagination of results [here](https://newsapi.aylien.com/docs/pagination-of-results)
53
84
  }
54
85
 
55
-
56
86
  begin
57
- result = api_instance.list_stories(opts)
58
- result.stories.each do |story|
59
- puts "#{story.title} / #{story.source.name}"
60
- end
87
+ #List Stories
88
+ result = api_instance.advanced_list_stories(unknown_base_type, opts)
89
+ p result
61
90
  rescue AylienNewsApi::ApiError => e
62
- puts "Exception when calling DefaultApi->list_stories: #{e}"
63
- puts e.response_body
91
+ puts "Exception when calling DefaultApi->advanced_list_stories: #{e}"
64
92
  end
93
+
65
94
  ```
66
95
 
67
96
  ## Documentation for API Endpoints
@@ -70,11 +99,12 @@ All URIs are relative to *https://api.aylien.com/news*
70
99
 
71
100
  Class | Method | HTTP request | Description
72
101
  ------------ | ------------- | ------------- | -------------
102
+ *AylienNewsApi::DefaultApi* | [**advanced_list_stories**](docs/DefaultApi.md#advanced_list_stories) | **POST** /stories | List Stories
73
103
  *AylienNewsApi::DefaultApi* | [**list_autocompletes**](docs/DefaultApi.md#list_autocompletes) | **GET** /autocompletes | List autocompletes
74
104
  *AylienNewsApi::DefaultApi* | [**list_clusters**](docs/DefaultApi.md#list_clusters) | **GET** /clusters | List Clusters
75
- *AylienNewsApi::DefaultApi* | [**list_coverages**](docs/DefaultApi.md#list_coverages) | **GET** /coverages | List coverages
76
105
  *AylienNewsApi::DefaultApi* | [**list_histograms**](docs/DefaultApi.md#list_histograms) | **GET** /histograms | List histograms
77
- *AylienNewsApi::DefaultApi* | [**list_related_stories**](docs/DefaultApi.md#list_related_stories) | **GET** /related_stories | List related stories
106
+ *AylienNewsApi::DefaultApi* | [**list_related_stories_get**](docs/DefaultApi.md#list_related_stories_get) | **GET** /related_stories |
107
+ *AylienNewsApi::DefaultApi* | [**list_related_stories_post**](docs/DefaultApi.md#list_related_stories_post) | **POST** /related_stories |
78
108
  *AylienNewsApi::DefaultApi* | [**list_stories**](docs/DefaultApi.md#list_stories) | **GET** /stories | List Stories
79
109
  *AylienNewsApi::DefaultApi* | [**list_time_series**](docs/DefaultApi.md#list_time_series) | **GET** /time_series | List time series
80
110
  *AylienNewsApi::DefaultApi* | [**list_trends**](docs/DefaultApi.md#list_trends) | **GET** /trends | List trends
@@ -82,30 +112,49 @@ Class | Method | HTTP request | Description
82
112
 
83
113
  ## Documentation for Models
84
114
 
115
+ - [AylienNewsApi::AggregatedSentiment](docs/AggregatedSentiment.md)
85
116
  - [AylienNewsApi::Author](docs/Author.md)
86
117
  - [AylienNewsApi::Autocomplete](docs/Autocomplete.md)
87
118
  - [AylienNewsApi::Autocompletes](docs/Autocompletes.md)
88
119
  - [AylienNewsApi::Category](docs/Category.md)
89
120
  - [AylienNewsApi::CategoryLinks](docs/CategoryLinks.md)
121
+ - [AylienNewsApi::CategoryTaxonomy](docs/CategoryTaxonomy.md)
90
122
  - [AylienNewsApi::Cluster](docs/Cluster.md)
91
123
  - [AylienNewsApi::Clusters](docs/Clusters.md)
92
- - [AylienNewsApi::Coverages](docs/Coverages.md)
93
- - [AylienNewsApi::Entities](docs/Entities.md)
124
+ - [AylienNewsApi::DeprecatedEntities](docs/DeprecatedEntities.md)
125
+ - [AylienNewsApi::DeprecatedEntity](docs/DeprecatedEntity.md)
126
+ - [AylienNewsApi::DeprecatedEntitySurfaceForm](docs/DeprecatedEntitySurfaceForm.md)
127
+ - [AylienNewsApi::DeprecatedRelatedStories](docs/DeprecatedRelatedStories.md)
128
+ - [AylienNewsApi::DeprecatedStories](docs/DeprecatedStories.md)
129
+ - [AylienNewsApi::DeprecatedStory](docs/DeprecatedStory.md)
94
130
  - [AylienNewsApi::Entity](docs/Entity.md)
131
+ - [AylienNewsApi::EntityInText](docs/EntityInText.md)
95
132
  - [AylienNewsApi::EntityLinks](docs/EntityLinks.md)
133
+ - [AylienNewsApi::EntityMention](docs/EntityMention.md)
134
+ - [AylienNewsApi::EntityMentionIndex](docs/EntityMentionIndex.md)
135
+ - [AylienNewsApi::EntitySentiment](docs/EntitySentiment.md)
136
+ - [AylienNewsApi::EntitySurfaceForm](docs/EntitySurfaceForm.md)
96
137
  - [AylienNewsApi::Error](docs/Error.md)
97
138
  - [AylienNewsApi::ErrorLinks](docs/ErrorLinks.md)
98
139
  - [AylienNewsApi::Errors](docs/Errors.md)
99
140
  - [AylienNewsApi::HistogramInterval](docs/HistogramInterval.md)
100
141
  - [AylienNewsApi::Histograms](docs/Histograms.md)
101
142
  - [AylienNewsApi::Location](docs/Location.md)
143
+ - [AylienNewsApi::Logicals](docs/Logicals.md)
102
144
  - [AylienNewsApi::Media](docs/Media.md)
145
+ - [AylienNewsApi::MediaFormat](docs/MediaFormat.md)
146
+ - [AylienNewsApi::MediaType](docs/MediaType.md)
147
+ - [AylienNewsApi::NestedEntity](docs/NestedEntity.md)
148
+ - [AylienNewsApi::Parameter](docs/Parameter.md)
149
+ - [AylienNewsApi::Query](docs/Query.md)
103
150
  - [AylienNewsApi::Rank](docs/Rank.md)
104
151
  - [AylienNewsApi::Rankings](docs/Rankings.md)
105
152
  - [AylienNewsApi::RelatedStories](docs/RelatedStories.md)
106
153
  - [AylienNewsApi::RepresentativeStory](docs/RepresentativeStory.md)
107
154
  - [AylienNewsApi::Scope](docs/Scope.md)
155
+ - [AylienNewsApi::ScopeLevel](docs/ScopeLevel.md)
108
156
  - [AylienNewsApi::Sentiment](docs/Sentiment.md)
157
+ - [AylienNewsApi::SentimentPolarity](docs/SentimentPolarity.md)
109
158
  - [AylienNewsApi::Sentiments](docs/Sentiments.md)
110
159
  - [AylienNewsApi::ShareCount](docs/ShareCount.md)
111
160
  - [AylienNewsApi::ShareCounts](docs/ShareCounts.md)
@@ -114,10 +163,30 @@ Class | Method | HTTP request | Description
114
163
  - [AylienNewsApi::Story](docs/Story.md)
115
164
  - [AylienNewsApi::StoryCluster](docs/StoryCluster.md)
116
165
  - [AylienNewsApi::StoryLinks](docs/StoryLinks.md)
166
+ - [AylienNewsApi::StoryTranslation](docs/StoryTranslation.md)
117
167
  - [AylienNewsApi::StoryTranslations](docs/StoryTranslations.md)
118
- - [AylienNewsApi::StoryTranslationsEn](docs/StoryTranslationsEn.md)
119
168
  - [AylienNewsApi::Summary](docs/Summary.md)
120
169
  - [AylienNewsApi::TimeSeries](docs/TimeSeries.md)
121
170
  - [AylienNewsApi::TimeSeriesList](docs/TimeSeriesList.md)
122
171
  - [AylienNewsApi::Trend](docs/Trend.md)
123
172
  - [AylienNewsApi::Trends](docs/Trends.md)
173
+ - [AylienNewsApi::Warning](docs/Warning.md)
174
+
175
+
176
+ ## Documentation for Authorization
177
+
178
+
179
+ ### app_id
180
+
181
+
182
+ - **Type**: API key
183
+ - **API key parameter name**: X-AYLIEN-NewsAPI-Application-ID
184
+ - **Location**: HTTP header
185
+
186
+ ### app_key
187
+
188
+
189
+ - **Type**: API key
190
+ - **API key parameter name**: X-AYLIEN-NewsAPI-Application-Key
191
+ - **Location**: HTTP header
192
+