context.dev 2.8.0 → 2.10.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +28 -0
- data/README.md +1 -1
- data/lib/context_dev/client.rb +10 -0
- data/lib/context_dev/models/batch_delete_params.rb +22 -0
- data/lib/context_dev/models/batch_delete_response.rb +60 -0
- data/lib/context_dev/models/batch_get_results_response.rb +46 -4
- data/lib/context_dev/models/batch_list_response.rb +13 -4
- data/lib/context_dev/models/batch_retrieve_response.rb +13 -4
- data/lib/context_dev/models/batch_submit_params.rb +2080 -26
- data/lib/context_dev/models/batch_submit_response.rb +125 -531
- data/lib/context_dev/models/brand_retrieve_response.rb +50 -1
- data/lib/context_dev/models/brand_search_params.rb +41 -3
- data/lib/context_dev/models/brand_search_response.rb +3 -2
- data/lib/context_dev/models/crawl_controls.rb +21 -15
- data/lib/context_dev/models/news_search_params.rb +467 -0
- data/lib/context_dev/models/news_search_response.rb +238 -0
- data/lib/context_dev/models/parse_handle_params.rb +20 -147
- data/lib/context_dev/models/person_enrich_params.rb +176 -0
- data/lib/context_dev/models/person_enrich_response.rb +641 -0
- data/lib/context_dev/models/utility_prefetch_params.rb +19 -16
- data/lib/context_dev/models/utility_prefetch_response.rb +4 -5
- data/lib/context_dev/models/web_screenshot_params.rb +3 -30
- data/lib/context_dev/models/web_search_response.rb +1 -0
- data/lib/context_dev/models/web_web_crawl_md_params.rb +5 -4
- data/lib/context_dev/models/web_web_crawl_md_response.rb +30 -1
- data/lib/context_dev/models/web_web_scrape_html_params.rb +20 -156
- data/lib/context_dev/models/web_web_scrape_html_response.rb +30 -1
- data/lib/context_dev/models/web_web_scrape_images_params.rb +12 -124
- data/lib/context_dev/models/web_web_scrape_md_params.rb +40 -241
- data/lib/context_dev/models/web_web_scrape_md_response.rb +41 -2
- data/lib/context_dev/models/web_web_scrape_sitemap_params.rb +11 -1
- data/lib/context_dev/models/web_web_scrape_sitemap_response.rb +3 -2
- data/lib/context_dev/models.rb +6 -0
- data/lib/context_dev/resources/batch.rb +33 -7
- data/lib/context_dev/resources/brand.rb +10 -10
- data/lib/context_dev/resources/news.rb +51 -0
- data/lib/context_dev/resources/parse.rb +5 -5
- data/lib/context_dev/resources/people.rb +56 -0
- data/lib/context_dev/resources/utility.rb +7 -6
- data/lib/context_dev/resources/web.rb +46 -24
- data/lib/context_dev/version.rb +1 -1
- data/lib/context_dev.rb +8 -0
- data/rbi/context_dev/client.rbi +8 -0
- data/rbi/context_dev/models/batch_delete_params.rbi +40 -0
- data/rbi/context_dev/models/batch_delete_response.rbi +116 -0
- data/rbi/context_dev/models/batch_get_results_response.rbi +85 -3
- data/rbi/context_dev/models/batch_list_response.rbi +24 -8
- data/rbi/context_dev/models/batch_retrieve_response.rbi +24 -8
- data/rbi/context_dev/models/batch_submit_params.rbi +6421 -44
- data/rbi/context_dev/models/batch_submit_response.rbi +184 -1151
- data/rbi/context_dev/models/brand_retrieve_response.rbi +152 -0
- data/rbi/context_dev/models/brand_search_params.rbi +71 -2
- data/rbi/context_dev/models/brand_search_response.rbi +4 -2
- data/rbi/context_dev/models/crawl_controls.rbi +22 -28
- data/rbi/context_dev/models/news_search_params.rbi +1294 -0
- data/rbi/context_dev/models/news_search_response.rbi +423 -0
- data/rbi/context_dev/models/parse_handle_params.rbi +30 -323
- data/rbi/context_dev/models/person_enrich_params.rbi +332 -0
- data/rbi/context_dev/models/person_enrich_response.rbi +1295 -0
- data/rbi/context_dev/models/utility_prefetch_params.rbi +24 -16
- data/rbi/context_dev/models/utility_prefetch_response.rbi +8 -6
- data/rbi/context_dev/models/web_screenshot_params.rbi +4 -71
- data/rbi/context_dev/models/web_search_response.rbi +5 -0
- data/rbi/context_dev/models/web_web_crawl_md_params.rbi +8 -6
- data/rbi/context_dev/models/web_web_crawl_md_response.rbi +67 -0
- data/rbi/context_dev/models/web_web_scrape_html_params.rbi +30 -363
- data/rbi/context_dev/models/web_web_scrape_html_response.rbi +65 -0
- data/rbi/context_dev/models/web_web_scrape_images_params.rbi +16 -287
- data/rbi/context_dev/models/web_web_scrape_md_params.rbi +57 -558
- data/rbi/context_dev/models/web_web_scrape_md_response.rbi +80 -0
- data/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +15 -0
- data/rbi/context_dev/models/web_web_scrape_sitemap_response.rbi +4 -2
- data/rbi/context_dev/models.rbi +6 -0
- data/rbi/context_dev/resources/batch.rbi +32 -10
- data/rbi/context_dev/resources/brand.rbi +14 -8
- data/rbi/context_dev/resources/news.rbi +46 -0
- data/rbi/context_dev/resources/parse.rbi +10 -26
- data/rbi/context_dev/resources/people.rbi +47 -0
- data/rbi/context_dev/resources/utility.rbi +8 -6
- data/rbi/context_dev/resources/web.rbi +49 -66
- data/sig/context_dev/client.rbs +4 -0
- data/sig/context_dev/models/batch_delete_params.rbs +23 -0
- data/sig/context_dev/models/batch_delete_response.rbs +57 -0
- data/sig/context_dev/models/batch_get_results_response.rbs +30 -2
- data/sig/context_dev/models/batch_list_response.rbs +16 -2
- data/sig/context_dev/models/batch_retrieve_response.rbs +16 -2
- data/sig/context_dev/models/batch_submit_params.rbs +2666 -15
- data/sig/context_dev/models/batch_submit_response.rbs +78 -466
- data/sig/context_dev/models/brand_retrieve_response.rbs +62 -0
- data/sig/context_dev/models/brand_search_params.rbs +38 -1
- data/sig/context_dev/models/crawl_controls.rbs +16 -16
- data/sig/context_dev/models/news_search_params.rbs +532 -0
- data/sig/context_dev/models/news_search_response.rbs +206 -0
- data/sig/context_dev/models/parse_handle_params.rbs +25 -90
- data/sig/context_dev/models/person_enrich_params.rbs +199 -0
- data/sig/context_dev/models/person_enrich_response.rbs +638 -0
- data/sig/context_dev/models/utility_prefetch_params.rbs +2 -1
- data/sig/context_dev/models/utility_prefetch_response.rbs +2 -1
- data/sig/context_dev/models/web_screenshot_params.rbs +5 -18
- data/sig/context_dev/models/web_search_response.rbs +2 -0
- data/sig/context_dev/models/web_web_crawl_md_response.rbs +21 -0
- data/sig/context_dev/models/web_web_scrape_html_params.rbs +24 -94
- data/sig/context_dev/models/web_web_scrape_html_response.rbs +21 -0
- data/sig/context_dev/models/web_web_scrape_images_params.rbs +20 -72
- data/sig/context_dev/models/web_web_scrape_md_params.rbs +46 -148
- data/sig/context_dev/models/web_web_scrape_md_response.rbs +28 -0
- data/sig/context_dev/models/web_web_scrape_sitemap_params.rbs +7 -0
- data/sig/context_dev/models.rbs +6 -0
- data/sig/context_dev/resources/batch.rbs +8 -2
- data/sig/context_dev/resources/brand.rbs +3 -0
- data/sig/context_dev/resources/news.rbs +17 -0
- data/sig/context_dev/resources/parse.rbs +5 -5
- data/sig/context_dev/resources/people.rbs +19 -0
- data/sig/context_dev/resources/web.rbs +13 -11
- metadata +26 -2
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module ContextDev
|
|
4
|
+
module Models
|
|
5
|
+
# @see ContextDev::Resources::News#search
|
|
6
|
+
class NewsSearchParams < ContextDev::Internal::Type::BaseModel
|
|
7
|
+
extend ContextDev::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include ContextDev::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute search_by
|
|
11
|
+
# What to search for.
|
|
12
|
+
#
|
|
13
|
+
# @return [ContextDev::Models::NewsSearchParams::SearchBy]
|
|
14
|
+
required :search_by, -> { ContextDev::NewsSearchParams::SearchBy }, api_name: :searchBy
|
|
15
|
+
|
|
16
|
+
# @!attribute cursor
|
|
17
|
+
# Opaque next_cursor from the previous response, or null for the first page.
|
|
18
|
+
#
|
|
19
|
+
# @return [String, nil]
|
|
20
|
+
optional :cursor, String, nil?: true
|
|
21
|
+
|
|
22
|
+
# @!attribute filter_by
|
|
23
|
+
# Optional result filters.
|
|
24
|
+
#
|
|
25
|
+
# @return [ContextDev::Models::NewsSearchParams::FilterBy, nil]
|
|
26
|
+
optional :filter_by, -> { ContextDev::NewsSearchParams::FilterBy }, api_name: :filterBy
|
|
27
|
+
|
|
28
|
+
# @!attribute limit
|
|
29
|
+
# Maximum results to return. Defaults to 10.
|
|
30
|
+
#
|
|
31
|
+
# @return [Integer, nil]
|
|
32
|
+
optional :limit, Integer
|
|
33
|
+
|
|
34
|
+
# @!attribute sort_by
|
|
35
|
+
# Result ordering. Defaults to newest.
|
|
36
|
+
#
|
|
37
|
+
# @return [ContextDev::Models::NewsSearchParams::SortBy, nil]
|
|
38
|
+
optional :sort_by, -> { ContextDev::NewsSearchParams::SortBy }, api_name: :sortBy
|
|
39
|
+
|
|
40
|
+
# @!attribute tags
|
|
41
|
+
# Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
|
|
42
|
+
#
|
|
43
|
+
# @return [Array<String>, nil]
|
|
44
|
+
optional :tags, ContextDev::Internal::Type::ArrayOf[String]
|
|
45
|
+
|
|
46
|
+
# @!method initialize(search_by:, cursor: nil, filter_by: nil, limit: nil, sort_by: nil, tags: nil, request_options: {})
|
|
47
|
+
# @param search_by [ContextDev::Models::NewsSearchParams::SearchBy] What to search for.
|
|
48
|
+
#
|
|
49
|
+
# @param cursor [String, nil] Opaque next_cursor from the previous response, or null for the first page.
|
|
50
|
+
#
|
|
51
|
+
# @param filter_by [ContextDev::Models::NewsSearchParams::FilterBy] Optional result filters.
|
|
52
|
+
#
|
|
53
|
+
# @param limit [Integer] Maximum results to return. Defaults to 10.
|
|
54
|
+
#
|
|
55
|
+
# @param sort_by [ContextDev::Models::NewsSearchParams::SortBy] Result ordering. Defaults to newest.
|
|
56
|
+
#
|
|
57
|
+
# @param tags [Array<String>] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
|
|
58
|
+
#
|
|
59
|
+
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
|
|
60
|
+
|
|
61
|
+
class SearchBy < ContextDev::Internal::Type::BaseModel
|
|
62
|
+
# @!attribute entity
|
|
63
|
+
# The company to search news for, identified by name, domain, ticker, or ISIN.
|
|
64
|
+
#
|
|
65
|
+
# @return [ContextDev::Models::NewsSearchParams::SearchBy::Entity::Name, ContextDev::Models::NewsSearchParams::SearchBy::Entity::Domain, ContextDev::Models::NewsSearchParams::SearchBy::Entity::Ticker, ContextDev::Models::NewsSearchParams::SearchBy::Entity::Isin]
|
|
66
|
+
required :entity, union: -> { ContextDev::NewsSearchParams::SearchBy::Entity }
|
|
67
|
+
|
|
68
|
+
# @!attribute type
|
|
69
|
+
# How to search. Only entity search is supported.
|
|
70
|
+
#
|
|
71
|
+
# @return [Symbol, ContextDev::Models::NewsSearchParams::SearchBy::Type]
|
|
72
|
+
required :type, enum: -> { ContextDev::NewsSearchParams::SearchBy::Type }
|
|
73
|
+
|
|
74
|
+
# @!method initialize(entity:, type:)
|
|
75
|
+
# What to search for.
|
|
76
|
+
#
|
|
77
|
+
# @param entity [ContextDev::Models::NewsSearchParams::SearchBy::Entity::Name, ContextDev::Models::NewsSearchParams::SearchBy::Entity::Domain, ContextDev::Models::NewsSearchParams::SearchBy::Entity::Ticker, ContextDev::Models::NewsSearchParams::SearchBy::Entity::Isin] The company to search news for, identified by name, domain, ticker, or ISIN.
|
|
78
|
+
#
|
|
79
|
+
# @param type [Symbol, ContextDev::Models::NewsSearchParams::SearchBy::Type] How to search. Only entity search is supported.
|
|
80
|
+
|
|
81
|
+
# The company to search news for, identified by name, domain, ticker, or ISIN.
|
|
82
|
+
#
|
|
83
|
+
# @see ContextDev::Models::NewsSearchParams::SearchBy#entity
|
|
84
|
+
module Entity
|
|
85
|
+
extend ContextDev::Internal::Type::Union
|
|
86
|
+
|
|
87
|
+
discriminator :type
|
|
88
|
+
|
|
89
|
+
# Identify the company by name.
|
|
90
|
+
variant :name, -> { ContextDev::NewsSearchParams::SearchBy::Entity::Name }
|
|
91
|
+
|
|
92
|
+
# Identify the company by website domain.
|
|
93
|
+
variant :domain, -> { ContextDev::NewsSearchParams::SearchBy::Entity::Domain }
|
|
94
|
+
|
|
95
|
+
# Identify the company by stock ticker, optionally scoped to an exchange.
|
|
96
|
+
variant :ticker, -> { ContextDev::NewsSearchParams::SearchBy::Entity::Ticker }
|
|
97
|
+
|
|
98
|
+
# Identify the company by International Securities Identification Number.
|
|
99
|
+
variant :isin, -> { ContextDev::NewsSearchParams::SearchBy::Entity::Isin }
|
|
100
|
+
|
|
101
|
+
class Name < ContextDev::Internal::Type::BaseModel
|
|
102
|
+
# @!attribute name
|
|
103
|
+
# Company name.
|
|
104
|
+
#
|
|
105
|
+
# @return [String]
|
|
106
|
+
required :name, String
|
|
107
|
+
|
|
108
|
+
# @!attribute type
|
|
109
|
+
#
|
|
110
|
+
# @return [Symbol, :name]
|
|
111
|
+
required :type, const: :name
|
|
112
|
+
|
|
113
|
+
# @!method initialize(name:, type: :name)
|
|
114
|
+
# Identify the company by name.
|
|
115
|
+
#
|
|
116
|
+
# @param name [String] Company name.
|
|
117
|
+
#
|
|
118
|
+
# @param type [Symbol, :name]
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
class Domain < ContextDev::Internal::Type::BaseModel
|
|
122
|
+
# @!attribute domain
|
|
123
|
+
# Company website domain, such as apple.com.
|
|
124
|
+
#
|
|
125
|
+
# @return [String]
|
|
126
|
+
required :domain, String
|
|
127
|
+
|
|
128
|
+
# @!attribute type
|
|
129
|
+
#
|
|
130
|
+
# @return [Symbol, :domain]
|
|
131
|
+
required :type, const: :domain
|
|
132
|
+
|
|
133
|
+
# @!method initialize(domain:, type: :domain)
|
|
134
|
+
# Identify the company by website domain.
|
|
135
|
+
#
|
|
136
|
+
# @param domain [String] Company website domain, such as apple.com.
|
|
137
|
+
#
|
|
138
|
+
# @param type [Symbol, :domain]
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
class Ticker < ContextDev::Internal::Type::BaseModel
|
|
142
|
+
# @!attribute ticker
|
|
143
|
+
# Public-company ticker.
|
|
144
|
+
#
|
|
145
|
+
# @return [String]
|
|
146
|
+
required :ticker, String
|
|
147
|
+
|
|
148
|
+
# @!attribute type
|
|
149
|
+
#
|
|
150
|
+
# @return [Symbol, :ticker]
|
|
151
|
+
required :type, const: :ticker
|
|
152
|
+
|
|
153
|
+
# @!attribute exchange
|
|
154
|
+
# Stock exchange the ticker trades on, used to disambiguate tickers listed on
|
|
155
|
+
# multiple exchanges.
|
|
156
|
+
#
|
|
157
|
+
# @return [Symbol, ContextDev::Models::NewsSearchParams::SearchBy::Entity::Ticker::Exchange, nil]
|
|
158
|
+
optional :exchange, enum: -> { ContextDev::NewsSearchParams::SearchBy::Entity::Ticker::Exchange }
|
|
159
|
+
|
|
160
|
+
# @!method initialize(ticker:, exchange: nil, type: :ticker)
|
|
161
|
+
# Some parameter documentations has been truncated, see
|
|
162
|
+
# {ContextDev::Models::NewsSearchParams::SearchBy::Entity::Ticker} for more
|
|
163
|
+
# details.
|
|
164
|
+
#
|
|
165
|
+
# Identify the company by stock ticker, optionally scoped to an exchange.
|
|
166
|
+
#
|
|
167
|
+
# @param ticker [String] Public-company ticker.
|
|
168
|
+
#
|
|
169
|
+
# @param exchange [Symbol, ContextDev::Models::NewsSearchParams::SearchBy::Entity::Ticker::Exchange] Stock exchange the ticker trades on, used to disambiguate tickers listed on mult
|
|
170
|
+
#
|
|
171
|
+
# @param type [Symbol, :ticker]
|
|
172
|
+
|
|
173
|
+
# Stock exchange the ticker trades on, used to disambiguate tickers listed on
|
|
174
|
+
# multiple exchanges.
|
|
175
|
+
#
|
|
176
|
+
# @see ContextDev::Models::NewsSearchParams::SearchBy::Entity::Ticker#exchange
|
|
177
|
+
module Exchange
|
|
178
|
+
extend ContextDev::Internal::Type::Enum
|
|
179
|
+
|
|
180
|
+
AMEX = :AMEX
|
|
181
|
+
AMS = :AMS
|
|
182
|
+
AQS = :AQS
|
|
183
|
+
ASX = :ASX
|
|
184
|
+
ATH = :ATH
|
|
185
|
+
BER = :BER
|
|
186
|
+
BME = :BME
|
|
187
|
+
BRU = :BRU
|
|
188
|
+
BSE = :BSE
|
|
189
|
+
BUD = :BUD
|
|
190
|
+
BUE = :BUE
|
|
191
|
+
BVC = :BVC
|
|
192
|
+
CBOE = :CBOE
|
|
193
|
+
CNQ = :CNQ
|
|
194
|
+
CPH = :CPH
|
|
195
|
+
DFM = :DFM
|
|
196
|
+
DOH = :DOH
|
|
197
|
+
DUB = :DUB
|
|
198
|
+
DUS = :DUS
|
|
199
|
+
DXE = :DXE
|
|
200
|
+
EGX = :EGX
|
|
201
|
+
FSX = :FSX
|
|
202
|
+
HAM = :HAM
|
|
203
|
+
HEL = :HEL
|
|
204
|
+
HKSE = :HKSE
|
|
205
|
+
HOSE = :HOSE
|
|
206
|
+
ICE = :ICE
|
|
207
|
+
IOB = :IOB
|
|
208
|
+
IST = :IST
|
|
209
|
+
JKT = :JKT
|
|
210
|
+
JNB = :JNB
|
|
211
|
+
JPX = :JPX
|
|
212
|
+
KLS = :KLS
|
|
213
|
+
KOE = :KOE
|
|
214
|
+
KSC = :KSC
|
|
215
|
+
KUW = :KUW
|
|
216
|
+
LIS = :LIS
|
|
217
|
+
LSE = :LSE
|
|
218
|
+
MCX = :MCX
|
|
219
|
+
MEX = :MEX
|
|
220
|
+
MIL = :MIL
|
|
221
|
+
MUN = :MUN
|
|
222
|
+
NASDAQ = :NASDAQ
|
|
223
|
+
NEO = :NEO
|
|
224
|
+
NSE = :NSE
|
|
225
|
+
NYSE = :NYSE
|
|
226
|
+
NZE = :NZE
|
|
227
|
+
OSL = :OSL
|
|
228
|
+
OTC = :OTC
|
|
229
|
+
PAR = :PAR
|
|
230
|
+
PNK = :PNK
|
|
231
|
+
PRA = :PRA
|
|
232
|
+
RIS = :RIS
|
|
233
|
+
SAO = :SAO
|
|
234
|
+
SAU = :SAU
|
|
235
|
+
SES = :SES
|
|
236
|
+
SET = :SET
|
|
237
|
+
SGO = :SGO
|
|
238
|
+
SHH = :SHH
|
|
239
|
+
SHZ = :SHZ
|
|
240
|
+
SIX = :SIX
|
|
241
|
+
STO = :STO
|
|
242
|
+
STU = :STU
|
|
243
|
+
TAI = :TAI
|
|
244
|
+
TAL = :TAL
|
|
245
|
+
TLV = :TLV
|
|
246
|
+
TSX = :TSX
|
|
247
|
+
TSXV = :TSXV
|
|
248
|
+
TWO = :TWO
|
|
249
|
+
VIE = :VIE
|
|
250
|
+
WSE = :WSE
|
|
251
|
+
XETRA = :XETRA
|
|
252
|
+
|
|
253
|
+
# @!method self.values
|
|
254
|
+
# @return [Array<Symbol>]
|
|
255
|
+
end
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
class Isin < ContextDev::Internal::Type::BaseModel
|
|
259
|
+
# @!attribute isin
|
|
260
|
+
# International Securities Identification Number.
|
|
261
|
+
#
|
|
262
|
+
# @return [String]
|
|
263
|
+
required :isin, String
|
|
264
|
+
|
|
265
|
+
# @!attribute type
|
|
266
|
+
#
|
|
267
|
+
# @return [Symbol, :isin]
|
|
268
|
+
required :type, const: :isin
|
|
269
|
+
|
|
270
|
+
# @!method initialize(isin:, type: :isin)
|
|
271
|
+
# Identify the company by International Securities Identification Number.
|
|
272
|
+
#
|
|
273
|
+
# @param isin [String] International Securities Identification Number.
|
|
274
|
+
#
|
|
275
|
+
# @param type [Symbol, :isin]
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
# @!method self.variants
|
|
279
|
+
# @return [Array(ContextDev::Models::NewsSearchParams::SearchBy::Entity::Name, ContextDev::Models::NewsSearchParams::SearchBy::Entity::Domain, ContextDev::Models::NewsSearchParams::SearchBy::Entity::Ticker, ContextDev::Models::NewsSearchParams::SearchBy::Entity::Isin)]
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
# How to search. Only entity search is supported.
|
|
283
|
+
#
|
|
284
|
+
# @see ContextDev::Models::NewsSearchParams::SearchBy#type
|
|
285
|
+
module Type
|
|
286
|
+
extend ContextDev::Internal::Type::Enum
|
|
287
|
+
|
|
288
|
+
ENTITY = :entity
|
|
289
|
+
|
|
290
|
+
# @!method self.values
|
|
291
|
+
# @return [Array<Symbol>]
|
|
292
|
+
end
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
class FilterBy < ContextDev::Internal::Type::BaseModel
|
|
296
|
+
# @!attribute article_language
|
|
297
|
+
# Article languages to include. Up to 3.
|
|
298
|
+
#
|
|
299
|
+
# @return [Array<Symbol, ContextDev::Models::NewsSearchParams::FilterBy::ArticleLanguage>, nil]
|
|
300
|
+
optional :article_language,
|
|
301
|
+
-> {
|
|
302
|
+
ContextDev::Internal::Type::ArrayOf[enum: ContextDev::NewsSearchParams::FilterBy::ArticleLanguage]
|
|
303
|
+
},
|
|
304
|
+
api_name: :articleLanguage
|
|
305
|
+
|
|
306
|
+
# @!attribute article_type
|
|
307
|
+
# Article types to include. Up to 3.
|
|
308
|
+
#
|
|
309
|
+
# @return [Array<Symbol, ContextDev::Models::NewsSearchParams::FilterBy::ArticleType>, nil]
|
|
310
|
+
optional :article_type,
|
|
311
|
+
-> {
|
|
312
|
+
ContextDev::Internal::Type::ArrayOf[enum: ContextDev::NewsSearchParams::FilterBy::ArticleType]
|
|
313
|
+
},
|
|
314
|
+
api_name: :articleType
|
|
315
|
+
|
|
316
|
+
# @!attribute date
|
|
317
|
+
# Published-at window in epoch milliseconds.
|
|
318
|
+
#
|
|
319
|
+
# @return [ContextDev::Models::NewsSearchParams::FilterBy::Date, nil]
|
|
320
|
+
optional :date, -> { ContextDev::NewsSearchParams::FilterBy::Date }
|
|
321
|
+
|
|
322
|
+
# @!attribute source_country
|
|
323
|
+
# Publisher countries to include, as lowercase ISO 3166-1 alpha-2 codes. Up to 3.
|
|
324
|
+
#
|
|
325
|
+
# @return [Array<Symbol, ContextDev::Models::NewsSearchParams::FilterBy::SourceCountry>, nil]
|
|
326
|
+
optional :source_country,
|
|
327
|
+
-> {
|
|
328
|
+
ContextDev::Internal::Type::ArrayOf[enum: ContextDev::NewsSearchParams::FilterBy::SourceCountry]
|
|
329
|
+
},
|
|
330
|
+
api_name: :sourceCountry
|
|
331
|
+
|
|
332
|
+
# @!attribute source_domain
|
|
333
|
+
# Publisher domains to include. Up to 3.
|
|
334
|
+
#
|
|
335
|
+
# @return [Array<String>, nil]
|
|
336
|
+
optional :source_domain, ContextDev::Internal::Type::ArrayOf[String], api_name: :sourceDomain
|
|
337
|
+
|
|
338
|
+
# @!method initialize(article_language: nil, article_type: nil, date: nil, source_country: nil, source_domain: nil)
|
|
339
|
+
# Optional result filters.
|
|
340
|
+
#
|
|
341
|
+
# @param article_language [Array<Symbol, ContextDev::Models::NewsSearchParams::FilterBy::ArticleLanguage>] Article languages to include. Up to 3.
|
|
342
|
+
#
|
|
343
|
+
# @param article_type [Array<Symbol, ContextDev::Models::NewsSearchParams::FilterBy::ArticleType>] Article types to include. Up to 3.
|
|
344
|
+
#
|
|
345
|
+
# @param date [ContextDev::Models::NewsSearchParams::FilterBy::Date] Published-at window in epoch milliseconds.
|
|
346
|
+
#
|
|
347
|
+
# @param source_country [Array<Symbol, ContextDev::Models::NewsSearchParams::FilterBy::SourceCountry>] Publisher countries to include, as lowercase ISO 3166-1 alpha-2 codes. Up to 3.
|
|
348
|
+
#
|
|
349
|
+
# @param source_domain [Array<String>] Publisher domains to include. Up to 3.
|
|
350
|
+
|
|
351
|
+
module ArticleLanguage
|
|
352
|
+
extend ContextDev::Internal::Type::Enum
|
|
353
|
+
|
|
354
|
+
AR = :ar
|
|
355
|
+
DE = :de
|
|
356
|
+
EN = :en
|
|
357
|
+
ES = :es
|
|
358
|
+
FR = :fr
|
|
359
|
+
HI = :hi
|
|
360
|
+
IT = :it
|
|
361
|
+
JA = :ja
|
|
362
|
+
KO = :ko
|
|
363
|
+
NL = :nl
|
|
364
|
+
PT = :pt
|
|
365
|
+
RU = :ru
|
|
366
|
+
ZH = :zh
|
|
367
|
+
|
|
368
|
+
# @!method self.values
|
|
369
|
+
# @return [Array<Symbol>]
|
|
370
|
+
end
|
|
371
|
+
|
|
372
|
+
module ArticleType
|
|
373
|
+
extend ContextDev::Internal::Type::Enum
|
|
374
|
+
|
|
375
|
+
EDITORIAL = :editorial
|
|
376
|
+
PRESS_RELEASE = :press_release
|
|
377
|
+
REGULATORY_FILING = :regulatory_filing
|
|
378
|
+
ADVISORY = :advisory
|
|
379
|
+
|
|
380
|
+
# @!method self.values
|
|
381
|
+
# @return [Array<Symbol>]
|
|
382
|
+
end
|
|
383
|
+
|
|
384
|
+
# @see ContextDev::Models::NewsSearchParams::FilterBy#date
|
|
385
|
+
class Date < ContextDev::Internal::Type::BaseModel
|
|
386
|
+
# @!attribute from
|
|
387
|
+
# Inclusive start of the published-at window, in epoch milliseconds.
|
|
388
|
+
#
|
|
389
|
+
# @return [Integer, nil]
|
|
390
|
+
optional :from, Integer
|
|
391
|
+
|
|
392
|
+
# @!attribute to
|
|
393
|
+
# Inclusive end of the published-at window, in epoch milliseconds.
|
|
394
|
+
#
|
|
395
|
+
# @return [Integer, nil]
|
|
396
|
+
optional :to, Integer
|
|
397
|
+
|
|
398
|
+
# @!method initialize(from: nil, to: nil)
|
|
399
|
+
# Published-at window in epoch milliseconds.
|
|
400
|
+
#
|
|
401
|
+
# @param from [Integer] Inclusive start of the published-at window, in epoch milliseconds.
|
|
402
|
+
#
|
|
403
|
+
# @param to [Integer] Inclusive end of the published-at window, in epoch milliseconds.
|
|
404
|
+
end
|
|
405
|
+
|
|
406
|
+
module SourceCountry
|
|
407
|
+
extend ContextDev::Internal::Type::Enum
|
|
408
|
+
|
|
409
|
+
AE = :ae
|
|
410
|
+
AR = :ar
|
|
411
|
+
AU = :au
|
|
412
|
+
CA = :ca
|
|
413
|
+
CG = :cg
|
|
414
|
+
CH = :ch
|
|
415
|
+
CL = :cl
|
|
416
|
+
DE = :de
|
|
417
|
+
FI = :fi
|
|
418
|
+
FR = :fr
|
|
419
|
+
GB = :gb
|
|
420
|
+
HK = :hk
|
|
421
|
+
IL = :il
|
|
422
|
+
IN = :in
|
|
423
|
+
JP = :jp
|
|
424
|
+
KR = :kr
|
|
425
|
+
MX = :mx
|
|
426
|
+
NG = :ng
|
|
427
|
+
NL = :nl
|
|
428
|
+
QA = :qa
|
|
429
|
+
SA = :sa
|
|
430
|
+
SE = :se
|
|
431
|
+
SG = :sg
|
|
432
|
+
US = :us
|
|
433
|
+
ZA = :za
|
|
434
|
+
|
|
435
|
+
# @!method self.values
|
|
436
|
+
# @return [Array<Symbol>]
|
|
437
|
+
end
|
|
438
|
+
end
|
|
439
|
+
|
|
440
|
+
class SortBy < ContextDev::Internal::Type::BaseModel
|
|
441
|
+
# @!attribute type
|
|
442
|
+
# Result ordering.
|
|
443
|
+
#
|
|
444
|
+
# @return [Symbol, ContextDev::Models::NewsSearchParams::SortBy::Type]
|
|
445
|
+
required :type, enum: -> { ContextDev::NewsSearchParams::SortBy::Type }
|
|
446
|
+
|
|
447
|
+
# @!method initialize(type:)
|
|
448
|
+
# Result ordering. Defaults to newest.
|
|
449
|
+
#
|
|
450
|
+
# @param type [Symbol, ContextDev::Models::NewsSearchParams::SortBy::Type] Result ordering.
|
|
451
|
+
|
|
452
|
+
# Result ordering.
|
|
453
|
+
#
|
|
454
|
+
# @see ContextDev::Models::NewsSearchParams::SortBy#type
|
|
455
|
+
module Type
|
|
456
|
+
extend ContextDev::Internal::Type::Enum
|
|
457
|
+
|
|
458
|
+
RELEVANCE = :relevance
|
|
459
|
+
NEWEST = :newest
|
|
460
|
+
|
|
461
|
+
# @!method self.values
|
|
462
|
+
# @return [Array<Symbol>]
|
|
463
|
+
end
|
|
464
|
+
end
|
|
465
|
+
end
|
|
466
|
+
end
|
|
467
|
+
end
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module ContextDev
|
|
4
|
+
module Models
|
|
5
|
+
# @see ContextDev::Resources::News#search
|
|
6
|
+
class NewsSearchResponse < ContextDev::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute data
|
|
8
|
+
#
|
|
9
|
+
# @return [Array<ContextDev::Models::NewsSearchResponse::Data>]
|
|
10
|
+
required :data, -> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::NewsSearchResponse::Data] }
|
|
11
|
+
|
|
12
|
+
# @!attribute has_more
|
|
13
|
+
#
|
|
14
|
+
# @return [Boolean]
|
|
15
|
+
required :has_more, ContextDev::Internal::Type::Boolean
|
|
16
|
+
|
|
17
|
+
# @!attribute meta
|
|
18
|
+
#
|
|
19
|
+
# @return [ContextDev::Models::NewsSearchResponse::Meta]
|
|
20
|
+
required :meta, -> { ContextDev::Models::NewsSearchResponse::Meta }
|
|
21
|
+
|
|
22
|
+
# @!attribute next_cursor
|
|
23
|
+
#
|
|
24
|
+
# @return [String, nil]
|
|
25
|
+
required :next_cursor, String, nil?: true
|
|
26
|
+
|
|
27
|
+
# @!attribute key_metadata
|
|
28
|
+
# Metadata about the API key used for the request. Included in every response
|
|
29
|
+
# whenever a valid API key is provided, even when the response status is not 200.
|
|
30
|
+
#
|
|
31
|
+
# @return [ContextDev::Models::NewsSearchResponse::KeyMetadata, nil]
|
|
32
|
+
optional :key_metadata, -> { ContextDev::Models::NewsSearchResponse::KeyMetadata }
|
|
33
|
+
|
|
34
|
+
# @!method initialize(data:, has_more:, meta:, next_cursor:, key_metadata: nil)
|
|
35
|
+
# Some parameter documentations has been truncated, see
|
|
36
|
+
# {ContextDev::Models::NewsSearchResponse} for more details.
|
|
37
|
+
#
|
|
38
|
+
# @param data [Array<ContextDev::Models::NewsSearchResponse::Data>]
|
|
39
|
+
#
|
|
40
|
+
# @param has_more [Boolean]
|
|
41
|
+
#
|
|
42
|
+
# @param meta [ContextDev::Models::NewsSearchResponse::Meta]
|
|
43
|
+
#
|
|
44
|
+
# @param next_cursor [String, nil]
|
|
45
|
+
#
|
|
46
|
+
# @param key_metadata [ContextDev::Models::NewsSearchResponse::KeyMetadata] Metadata about the API key used for the request. Included in every response when
|
|
47
|
+
|
|
48
|
+
class Data < ContextDev::Internal::Type::BaseModel
|
|
49
|
+
# @!attribute id
|
|
50
|
+
#
|
|
51
|
+
# @return [String]
|
|
52
|
+
required :id, String
|
|
53
|
+
|
|
54
|
+
# @!attribute authors
|
|
55
|
+
#
|
|
56
|
+
# @return [Array<String>]
|
|
57
|
+
required :authors, ContextDev::Internal::Type::ArrayOf[String]
|
|
58
|
+
|
|
59
|
+
# @!attribute description
|
|
60
|
+
#
|
|
61
|
+
# @return [String, nil]
|
|
62
|
+
required :description, String, nil?: true
|
|
63
|
+
|
|
64
|
+
# @!attribute image_url
|
|
65
|
+
#
|
|
66
|
+
# @return [String, nil]
|
|
67
|
+
required :image_url, String, nil?: true
|
|
68
|
+
|
|
69
|
+
# @!attribute language
|
|
70
|
+
#
|
|
71
|
+
# @return [String, nil]
|
|
72
|
+
required :language, String, nil?: true
|
|
73
|
+
|
|
74
|
+
# @!attribute match
|
|
75
|
+
#
|
|
76
|
+
# @return [ContextDev::Models::NewsSearchResponse::Data::Match]
|
|
77
|
+
required :match, -> { ContextDev::Models::NewsSearchResponse::Data::Match }
|
|
78
|
+
|
|
79
|
+
# @!attribute published_at
|
|
80
|
+
#
|
|
81
|
+
# @return [Time, nil]
|
|
82
|
+
required :published_at, Time, nil?: true
|
|
83
|
+
|
|
84
|
+
# @!attribute source
|
|
85
|
+
#
|
|
86
|
+
# @return [ContextDev::Models::NewsSearchResponse::Data::Source]
|
|
87
|
+
required :source, -> { ContextDev::Models::NewsSearchResponse::Data::Source }
|
|
88
|
+
|
|
89
|
+
# @!attribute story_id
|
|
90
|
+
# Groups matching normalized headlines published on the same UTC day.
|
|
91
|
+
#
|
|
92
|
+
# @return [String]
|
|
93
|
+
required :story_id, String
|
|
94
|
+
|
|
95
|
+
# @!attribute title
|
|
96
|
+
#
|
|
97
|
+
# @return [String]
|
|
98
|
+
required :title, String
|
|
99
|
+
|
|
100
|
+
# @!attribute type
|
|
101
|
+
#
|
|
102
|
+
# @return [Symbol, ContextDev::Models::NewsSearchResponse::Data::Type]
|
|
103
|
+
required :type, enum: -> { ContextDev::Models::NewsSearchResponse::Data::Type }
|
|
104
|
+
|
|
105
|
+
# @!attribute url
|
|
106
|
+
#
|
|
107
|
+
# @return [String]
|
|
108
|
+
required :url, String
|
|
109
|
+
|
|
110
|
+
# @!method initialize(id:, authors:, description:, image_url:, language:, match:, published_at:, source:, story_id:, title:, type:, url:)
|
|
111
|
+
# @param id [String]
|
|
112
|
+
#
|
|
113
|
+
# @param authors [Array<String>]
|
|
114
|
+
#
|
|
115
|
+
# @param description [String, nil]
|
|
116
|
+
#
|
|
117
|
+
# @param image_url [String, nil]
|
|
118
|
+
#
|
|
119
|
+
# @param language [String, nil]
|
|
120
|
+
#
|
|
121
|
+
# @param match [ContextDev::Models::NewsSearchResponse::Data::Match]
|
|
122
|
+
#
|
|
123
|
+
# @param published_at [Time, nil]
|
|
124
|
+
#
|
|
125
|
+
# @param source [ContextDev::Models::NewsSearchResponse::Data::Source]
|
|
126
|
+
#
|
|
127
|
+
# @param story_id [String] Groups matching normalized headlines published on the same UTC day.
|
|
128
|
+
#
|
|
129
|
+
# @param title [String]
|
|
130
|
+
#
|
|
131
|
+
# @param type [Symbol, ContextDev::Models::NewsSearchResponse::Data::Type]
|
|
132
|
+
#
|
|
133
|
+
# @param url [String]
|
|
134
|
+
|
|
135
|
+
# @see ContextDev::Models::NewsSearchResponse::Data#match
|
|
136
|
+
class Match < ContextDev::Internal::Type::BaseModel
|
|
137
|
+
# @!attribute confidence
|
|
138
|
+
#
|
|
139
|
+
# @return [Float, nil]
|
|
140
|
+
required :confidence, Float, nil?: true
|
|
141
|
+
|
|
142
|
+
# @!attribute level
|
|
143
|
+
#
|
|
144
|
+
# @return [Symbol, ContextDev::Models::NewsSearchResponse::Data::Match::Level]
|
|
145
|
+
required :level, enum: -> { ContextDev::Models::NewsSearchResponse::Data::Match::Level }
|
|
146
|
+
|
|
147
|
+
# @!method initialize(confidence:, level:)
|
|
148
|
+
# @param confidence [Float, nil]
|
|
149
|
+
# @param level [Symbol, ContextDev::Models::NewsSearchResponse::Data::Match::Level]
|
|
150
|
+
|
|
151
|
+
# @see ContextDev::Models::NewsSearchResponse::Data::Match#level
|
|
152
|
+
module Level
|
|
153
|
+
extend ContextDev::Internal::Type::Enum
|
|
154
|
+
|
|
155
|
+
PRIMARY = :primary
|
|
156
|
+
SECONDARY = :secondary
|
|
157
|
+
|
|
158
|
+
# @!method self.values
|
|
159
|
+
# @return [Array<Symbol>]
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# @see ContextDev::Models::NewsSearchResponse::Data#source
|
|
164
|
+
class Source < ContextDev::Internal::Type::BaseModel
|
|
165
|
+
# @!attribute direct
|
|
166
|
+
# True when Context observed this article in the publisher-owned feed.
|
|
167
|
+
#
|
|
168
|
+
# @return [Boolean]
|
|
169
|
+
required :direct, ContextDev::Internal::Type::Boolean
|
|
170
|
+
|
|
171
|
+
# @!attribute domain
|
|
172
|
+
#
|
|
173
|
+
# @return [String]
|
|
174
|
+
required :domain, String
|
|
175
|
+
|
|
176
|
+
# @!attribute name
|
|
177
|
+
#
|
|
178
|
+
# @return [String]
|
|
179
|
+
required :name, String
|
|
180
|
+
|
|
181
|
+
# @!method initialize(direct:, domain:, name:)
|
|
182
|
+
# @param direct [Boolean] True when Context observed this article in the publisher-owned feed.
|
|
183
|
+
#
|
|
184
|
+
# @param domain [String]
|
|
185
|
+
#
|
|
186
|
+
# @param name [String]
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# @see ContextDev::Models::NewsSearchResponse::Data#type
|
|
190
|
+
module Type
|
|
191
|
+
extend ContextDev::Internal::Type::Enum
|
|
192
|
+
|
|
193
|
+
EDITORIAL = :editorial
|
|
194
|
+
PRESS_RELEASE = :press_release
|
|
195
|
+
REGULATORY_FILING = :regulatory_filing
|
|
196
|
+
ADVISORY = :advisory
|
|
197
|
+
|
|
198
|
+
# @!method self.values
|
|
199
|
+
# @return [Array<Symbol>]
|
|
200
|
+
end
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
# @see ContextDev::Models::NewsSearchResponse#meta
|
|
204
|
+
class Meta < ContextDev::Internal::Type::BaseModel
|
|
205
|
+
# @!attribute count
|
|
206
|
+
#
|
|
207
|
+
# @return [Integer]
|
|
208
|
+
required :count, Integer
|
|
209
|
+
|
|
210
|
+
# @!method initialize(count:)
|
|
211
|
+
# @param count [Integer]
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
# @see ContextDev::Models::NewsSearchResponse#key_metadata
|
|
215
|
+
class KeyMetadata < ContextDev::Internal::Type::BaseModel
|
|
216
|
+
# @!attribute credits_consumed
|
|
217
|
+
# The number of credits consumed by this request.
|
|
218
|
+
#
|
|
219
|
+
# @return [Integer]
|
|
220
|
+
required :credits_consumed, Integer
|
|
221
|
+
|
|
222
|
+
# @!attribute credits_remaining
|
|
223
|
+
# The number of credits remaining for your organization after this request.
|
|
224
|
+
#
|
|
225
|
+
# @return [Integer]
|
|
226
|
+
required :credits_remaining, Integer
|
|
227
|
+
|
|
228
|
+
# @!method initialize(credits_consumed:, credits_remaining:)
|
|
229
|
+
# Metadata about the API key used for the request. Included in every response
|
|
230
|
+
# whenever a valid API key is provided, even when the response status is not 200.
|
|
231
|
+
#
|
|
232
|
+
# @param credits_consumed [Integer] The number of credits consumed by this request.
|
|
233
|
+
#
|
|
234
|
+
# @param credits_remaining [Integer] The number of credits remaining for your organization after this request.
|
|
235
|
+
end
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
end
|