context.dev 2.9.0 → 2.11.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 (80) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +23 -0
  3. data/README.md +1 -1
  4. data/lib/context_dev/client.rb +5 -0
  5. data/lib/context_dev/models/batch_get_results_response.rb +33 -3
  6. data/lib/context_dev/models/batch_submit_params.rb +44 -316
  7. data/lib/context_dev/models/brand_retrieve_response.rb +29 -1
  8. data/lib/context_dev/models/brand_retrieve_simplified_response.rb +30 -1
  9. data/lib/context_dev/models/brand_search_params.rb +41 -3
  10. data/lib/context_dev/models/news_search_params.rb +467 -0
  11. data/lib/context_dev/models/news_search_response.rb +284 -0
  12. data/lib/context_dev/models/parse_handle_params.rb +15 -144
  13. data/lib/context_dev/models/person_enrich_response.rb +61 -1
  14. data/lib/context_dev/models/utility_prefetch_params.rb +19 -16
  15. data/lib/context_dev/models/utility_prefetch_response.rb +4 -5
  16. data/lib/context_dev/models/web_screenshot_params.rb +16 -31
  17. data/lib/context_dev/models/web_web_crawl_md_response.rb +30 -1
  18. data/lib/context_dev/models/web_web_scrape_html_params.rb +15 -153
  19. data/lib/context_dev/models/web_web_scrape_html_response.rb +30 -1
  20. data/lib/context_dev/models/web_web_scrape_images_params.rb +12 -124
  21. data/lib/context_dev/models/web_web_scrape_md_params.rb +35 -238
  22. data/lib/context_dev/models/web_web_scrape_md_response.rb +41 -2
  23. data/lib/context_dev/models.rb +2 -0
  24. data/lib/context_dev/resources/brand.rb +10 -11
  25. data/lib/context_dev/resources/news.rb +51 -0
  26. data/lib/context_dev/resources/parse.rb +5 -5
  27. data/lib/context_dev/resources/utility.rb +7 -6
  28. data/lib/context_dev/resources/web.rb +30 -24
  29. data/lib/context_dev/version.rb +1 -1
  30. data/lib/context_dev.rb +3 -0
  31. data/rbi/context_dev/client.rbi +4 -0
  32. data/rbi/context_dev/models/batch_get_results_response.rbi +71 -2
  33. data/rbi/context_dev/models/batch_submit_params.rbi +58 -592
  34. data/rbi/context_dev/models/brand_retrieve_response.rbi +80 -3
  35. data/rbi/context_dev/models/brand_retrieve_simplified_response.rbi +80 -3
  36. data/rbi/context_dev/models/brand_search_params.rbi +71 -2
  37. data/rbi/context_dev/models/news_search_params.rbi +1294 -0
  38. data/rbi/context_dev/models/news_search_response.rbi +489 -0
  39. data/rbi/context_dev/models/parse_handle_params.rbi +20 -316
  40. data/rbi/context_dev/models/person_enrich_response.rbi +87 -0
  41. data/rbi/context_dev/models/utility_prefetch_params.rbi +24 -16
  42. data/rbi/context_dev/models/utility_prefetch_response.rbi +8 -6
  43. data/rbi/context_dev/models/web_screenshot_params.rbi +23 -71
  44. data/rbi/context_dev/models/web_web_crawl_md_response.rbi +67 -0
  45. data/rbi/context_dev/models/web_web_scrape_html_params.rbi +20 -356
  46. data/rbi/context_dev/models/web_web_scrape_html_response.rbi +65 -0
  47. data/rbi/context_dev/models/web_web_scrape_images_params.rbi +16 -287
  48. data/rbi/context_dev/models/web_web_scrape_md_params.rbi +47 -551
  49. data/rbi/context_dev/models/web_web_scrape_md_response.rbi +80 -0
  50. data/rbi/context_dev/models.rbi +2 -0
  51. data/rbi/context_dev/resources/brand.rbi +14 -9
  52. data/rbi/context_dev/resources/news.rbi +46 -0
  53. data/rbi/context_dev/resources/parse.rbi +5 -21
  54. data/rbi/context_dev/resources/utility.rbi +8 -6
  55. data/rbi/context_dev/resources/web.rbi +34 -66
  56. data/sig/context_dev/client.rbs +2 -0
  57. data/sig/context_dev/models/batch_get_results_response.rbs +21 -0
  58. data/sig/context_dev/models/batch_submit_params.rbs +54 -144
  59. data/sig/context_dev/models/brand_retrieve_response.rbs +33 -3
  60. data/sig/context_dev/models/brand_retrieve_simplified_response.rbs +33 -3
  61. data/sig/context_dev/models/brand_search_params.rbs +38 -1
  62. data/sig/context_dev/models/news_search_params.rbs +532 -0
  63. data/sig/context_dev/models/news_search_response.rbs +206 -0
  64. data/sig/context_dev/models/parse_handle_params.rbs +25 -90
  65. data/sig/context_dev/models/person_enrich_response.rbs +31 -0
  66. data/sig/context_dev/models/utility_prefetch_params.rbs +2 -1
  67. data/sig/context_dev/models/utility_prefetch_response.rbs +2 -1
  68. data/sig/context_dev/models/web_screenshot_params.rbs +12 -18
  69. data/sig/context_dev/models/web_web_crawl_md_response.rbs +21 -0
  70. data/sig/context_dev/models/web_web_scrape_html_params.rbs +24 -94
  71. data/sig/context_dev/models/web_web_scrape_html_response.rbs +21 -0
  72. data/sig/context_dev/models/web_web_scrape_images_params.rbs +20 -72
  73. data/sig/context_dev/models/web_web_scrape_md_params.rbs +46 -148
  74. data/sig/context_dev/models/web_web_scrape_md_response.rbs +28 -0
  75. data/sig/context_dev/models.rbs +2 -0
  76. data/sig/context_dev/resources/brand.rbs +3 -0
  77. data/sig/context_dev/resources/news.rbs +17 -0
  78. data/sig/context_dev/resources/parse.rbs +5 -5
  79. data/sig/context_dev/resources/web.rbs +13 -11
  80. metadata +11 -2
@@ -344,10 +344,38 @@ module ContextDev
344
344
  # @return [String, nil]
345
345
  optional :name, String
346
346
 
347
- # @!method initialize(hex: nil, name: nil)
347
+ # @!attribute source
348
+ # Where the color was observed: 'site' colors come from the website's own theme
349
+ # signals (rendered page colors, manifest, theme-color meta), 'logo' colors from
350
+ # logo image pixels.
351
+ #
352
+ # @return [Symbol, ContextDev::Models::BrandRetrieveResponse::Brand::Color::Source, nil]
353
+ optional :source, enum: -> { ContextDev::Models::BrandRetrieveResponse::Brand::Color::Source }
354
+
355
+ # @!method initialize(hex: nil, name: nil, source: nil)
356
+ # Some parameter documentations has been truncated, see
357
+ # {ContextDev::Models::BrandRetrieveResponse::Brand::Color} for more details.
358
+ #
348
359
  # @param hex [String] Color in hexadecimal format
349
360
  #
350
361
  # @param name [String] Name of the color
362
+ #
363
+ # @param source [Symbol, ContextDev::Models::BrandRetrieveResponse::Brand::Color::Source] Where the color was observed: 'site' colors come from the website's own theme si
364
+
365
+ # Where the color was observed: 'site' colors come from the website's own theme
366
+ # signals (rendered page colors, manifest, theme-color meta), 'logo' colors from
367
+ # logo image pixels.
368
+ #
369
+ # @see ContextDev::Models::BrandRetrieveResponse::Brand::Color#source
370
+ module Source
371
+ extend ContextDev::Internal::Type::Enum
372
+
373
+ SITE = :site
374
+ LOGO = :logo
375
+
376
+ # @!method self.values
377
+ # @return [Array<Symbol>]
378
+ end
351
379
  end
352
380
 
353
381
  # @see ContextDev::Models::BrandRetrieveResponse::Brand#employees
@@ -180,10 +180,39 @@ module ContextDev
180
180
  # @return [String, nil]
181
181
  optional :name, String
182
182
 
183
- # @!method initialize(hex: nil, name: nil)
183
+ # @!attribute source
184
+ # Where the color was observed: 'site' colors come from the website's own theme
185
+ # signals (rendered page colors, manifest, theme-color meta), 'logo' colors from
186
+ # logo image pixels.
187
+ #
188
+ # @return [Symbol, ContextDev::Models::BrandRetrieveSimplifiedResponse::Brand::Color::Source, nil]
189
+ optional :source, enum: -> { ContextDev::Models::BrandRetrieveSimplifiedResponse::Brand::Color::Source }
190
+
191
+ # @!method initialize(hex: nil, name: nil, source: nil)
192
+ # Some parameter documentations has been truncated, see
193
+ # {ContextDev::Models::BrandRetrieveSimplifiedResponse::Brand::Color} for more
194
+ # details.
195
+ #
184
196
  # @param hex [String] Color in hexadecimal format
185
197
  #
186
198
  # @param name [String] Name of the color
199
+ #
200
+ # @param source [Symbol, ContextDev::Models::BrandRetrieveSimplifiedResponse::Brand::Color::Source] Where the color was observed: 'site' colors come from the website's own theme si
201
+
202
+ # Where the color was observed: 'site' colors come from the website's own theme
203
+ # signals (rendered page colors, manifest, theme-color meta), 'logo' colors from
204
+ # logo image pixels.
205
+ #
206
+ # @see ContextDev::Models::BrandRetrieveSimplifiedResponse::Brand::Color#source
207
+ module Source
208
+ extend ContextDev::Internal::Type::Enum
209
+
210
+ SITE = :site
211
+ LOGO = :logo
212
+
213
+ # @!method self.values
214
+ # @return [Array<Symbol>]
215
+ end
187
216
  end
188
217
 
189
218
  class Logo < ContextDev::Internal::Type::BaseModel
@@ -8,12 +8,27 @@ module ContextDev
8
8
  include ContextDev::Internal::Type::RequestParameters
9
9
 
10
10
  # @!attribute query
11
- # Search term, matched against brand names and domains by prefix (e.g. 'nike',
11
+ # Search term, matched against the fields selected by queryBy (e.g. 'nike',
12
12
  # 'nike.com', 'nik').
13
13
  #
14
14
  # @return [String]
15
15
  required :query, String
16
16
 
17
+ # @!attribute autocomplete
18
+ # Whether the search term matches by prefix, so partial words match as they are
19
+ # typed (e.g. 'nik' matches Nike). Set to false to match whole words only.
20
+ #
21
+ # @return [Boolean, nil]
22
+ optional :autocomplete, ContextDev::Internal::Type::Boolean
23
+
24
+ # @!attribute query_by
25
+ # Fields to match the search term against, as a comma-separated list or repeated
26
+ # parameter: 'name', 'domain', or both. Defaults to both.
27
+ #
28
+ # @return [Array<Symbol, ContextDev::Models::BrandSearchParams::QueryBy>, nil]
29
+ optional :query_by,
30
+ -> { ContextDev::Internal::Type::ArrayOf[enum: ContextDev::BrandSearchParams::QueryBy] }
31
+
17
32
  # @!attribute tags
18
33
  # Optional comma-separated caller-defined tags for tracking this request. Tags are
19
34
  # recorded on the request's usage log and can be used to filter usage on the
@@ -22,15 +37,38 @@ module ContextDev
22
37
  # @return [Array<String>, nil]
23
38
  optional :tags, ContextDev::Internal::Type::ArrayOf[String]
24
39
 
25
- # @!method initialize(query:, tags: nil, request_options: {})
40
+ # @!attribute typo_tolerance
41
+ # Maximum number of typos tolerated when matching, from 0 to 2. Defaults to 0 (no
42
+ # typo tolerance).
43
+ #
44
+ # @return [Integer, nil]
45
+ optional :typo_tolerance, Integer
46
+
47
+ # @!method initialize(query:, autocomplete: nil, query_by: nil, tags: nil, typo_tolerance: nil, request_options: {})
26
48
  # Some parameter documentations has been truncated, see
27
49
  # {ContextDev::Models::BrandSearchParams} for more details.
28
50
  #
29
- # @param query [String] Search term, matched against brand names and domains by prefix (e.g. 'nike', 'ni
51
+ # @param query [String] Search term, matched against the fields selected by queryBy (e.g. 'nike', 'nike.
52
+ #
53
+ # @param autocomplete [Boolean] Whether the search term matches by prefix, so partial words match as they are ty
54
+ #
55
+ # @param query_by [Array<Symbol, ContextDev::Models::BrandSearchParams::QueryBy>] Fields to match the search term against, as a comma-separated list or repeated p
30
56
  #
31
57
  # @param tags [Array<String>] Optional comma-separated caller-defined tags for tracking this request. Tags are
32
58
  #
59
+ # @param typo_tolerance [Integer] Maximum number of typos tolerated when matching, from 0 to 2. Defaults to 0 (no
60
+ #
33
61
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
62
+
63
+ module QueryBy
64
+ extend ContextDev::Internal::Type::Enum
65
+
66
+ NAME = :name
67
+ DOMAIN = :domain
68
+
69
+ # @!method self.values
70
+ # @return [Array<Symbol>]
71
+ end
34
72
  end
35
73
  end
36
74
  end
@@ -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