context.dev 2.11.0 → 2.13.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 +18 -0
- data/README.md +4 -4
- data/lib/context_dev/models/ai_extract_product_response.rb +102 -2
- data/lib/context_dev/models/ai_extract_products_response.rb +102 -2
- data/lib/context_dev/models/batch_get_results_response.rb +56 -1
- data/lib/context_dev/models/batch_submit_response.rb +54 -1
- data/lib/context_dev/models/brand_retrieve_response.rb +58 -3
- data/lib/context_dev/models/brand_retrieve_simplified_response.rb +55 -1
- data/lib/context_dev/models/news_search_params.rb +1 -0
- data/lib/context_dev/models/web_extract_fonts_response.rb +54 -1
- data/lib/context_dev/models/web_extract_params.rb +169 -6
- data/lib/context_dev/models/web_extract_response.rb +139 -2
- data/lib/context_dev/models/web_extract_styleguide_response.rb +55 -1
- data/lib/context_dev/models/web_screenshot_response.rb +54 -1
- data/lib/context_dev/models/web_search_response.rb +54 -1
- data/lib/context_dev/models/web_web_crawl_md_params.rb +7 -5
- data/lib/context_dev/models/web_web_crawl_md_response.rb +54 -1
- data/lib/context_dev/models/web_web_scrape_html_params.rb +99 -3
- data/lib/context_dev/models/web_web_scrape_html_response.rb +54 -1
- data/lib/context_dev/models/web_web_scrape_images_params.rb +99 -3
- data/lib/context_dev/models/web_web_scrape_images_response.rb +139 -1
- data/lib/context_dev/models/web_web_scrape_md_params.rb +99 -3
- data/lib/context_dev/models/web_web_scrape_md_response.rb +54 -1
- data/lib/context_dev/resources/web.rb +9 -7
- data/lib/context_dev/version.rb +1 -1
- data/rbi/context_dev/models/ai_extract_product_response.rbi +218 -0
- data/rbi/context_dev/models/ai_extract_products_response.rbi +218 -0
- data/rbi/context_dev/models/batch_get_results_response.rbi +121 -0
- data/rbi/context_dev/models/batch_submit_response.rbi +117 -0
- data/rbi/context_dev/models/brand_retrieve_response.rbi +123 -2
- data/rbi/context_dev/models/brand_retrieve_simplified_response.rbi +121 -0
- data/rbi/context_dev/models/news_search_params.rbi +5 -0
- data/rbi/context_dev/models/web_extract_fonts_response.rbi +119 -0
- data/rbi/context_dev/models/web_extract_params.rbi +353 -8
- data/rbi/context_dev/models/web_extract_response.rbi +289 -3
- data/rbi/context_dev/models/web_extract_styleguide_response.rbi +119 -0
- data/rbi/context_dev/models/web_screenshot_response.rbi +117 -0
- data/rbi/context_dev/models/web_search_response.rbi +117 -0
- data/rbi/context_dev/models/web_web_crawl_md_params.rbi +10 -6
- data/rbi/context_dev/models/web_web_crawl_md_response.rbi +117 -0
- data/rbi/context_dev/models/web_web_scrape_html_params.rbi +218 -4
- data/rbi/context_dev/models/web_web_scrape_html_response.rbi +119 -0
- data/rbi/context_dev/models/web_web_scrape_images_params.rbi +218 -4
- data/rbi/context_dev/models/web_web_scrape_images_response.rbi +288 -0
- data/rbi/context_dev/models/web_web_scrape_md_params.rbi +218 -4
- data/rbi/context_dev/models/web_web_scrape_md_response.rbi +117 -0
- data/rbi/context_dev/resources/web.rbi +31 -10
- data/sig/context_dev/models/ai_extract_product_response.rbs +79 -0
- data/sig/context_dev/models/ai_extract_products_response.rbs +79 -0
- data/sig/context_dev/models/batch_get_results_response.rbs +39 -0
- data/sig/context_dev/models/batch_submit_response.rbs +39 -0
- data/sig/context_dev/models/brand_retrieve_response.rbs +39 -0
- data/sig/context_dev/models/brand_retrieve_simplified_response.rbs +39 -0
- data/sig/context_dev/models/news_search_params.rbs +2 -0
- data/sig/context_dev/models/web_extract_fonts_response.rbs +39 -0
- data/sig/context_dev/models/web_extract_params.rbs +117 -0
- data/sig/context_dev/models/web_extract_response.rbs +120 -3
- data/sig/context_dev/models/web_extract_styleguide_response.rbs +39 -0
- data/sig/context_dev/models/web_screenshot_response.rbs +39 -0
- data/sig/context_dev/models/web_search_response.rbs +39 -0
- data/sig/context_dev/models/web_web_crawl_md_response.rbs +39 -0
- data/sig/context_dev/models/web_web_scrape_html_params.rbs +74 -0
- data/sig/context_dev/models/web_web_scrape_html_response.rbs +39 -0
- data/sig/context_dev/models/web_web_scrape_images_params.rbs +74 -0
- data/sig/context_dev/models/web_web_scrape_images_response.rbs +117 -0
- data/sig/context_dev/models/web_web_scrape_md_params.rbs +74 -0
- data/sig/context_dev/models/web_web_scrape_md_response.rbs +39 -0
- data/sig/context_dev/resources/web.rbs +1 -0
- metadata +2 -2
|
@@ -11,6 +11,20 @@ module ContextDev
|
|
|
11
11
|
)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
+
# Cache outcome for this response. Composite responses are hits only when every
|
|
15
|
+
# cache-controlled fetch contributing to the output was a hit; age_ms is the
|
|
16
|
+
# oldest contributing hit.
|
|
17
|
+
sig { returns(ContextDev::Models::WebWebScrapeMdResponse::CacheMetadata) }
|
|
18
|
+
attr_reader :cache_metadata
|
|
19
|
+
|
|
20
|
+
sig do
|
|
21
|
+
params(
|
|
22
|
+
cache_metadata:
|
|
23
|
+
ContextDev::Models::WebWebScrapeMdResponse::CacheMetadata::OrHash
|
|
24
|
+
).void
|
|
25
|
+
end
|
|
26
|
+
attr_writer :cache_metadata
|
|
27
|
+
|
|
14
28
|
# UTF-8 byte length of the returned Markdown. Use 0 to identify an empty result
|
|
15
29
|
# and compare small values against your workload's minimum useful-content
|
|
16
30
|
# threshold.
|
|
@@ -100,6 +114,8 @@ module ContextDev
|
|
|
100
114
|
|
|
101
115
|
sig do
|
|
102
116
|
params(
|
|
117
|
+
cache_metadata:
|
|
118
|
+
ContextDev::Models::WebWebScrapeMdResponse::CacheMetadata::OrHash,
|
|
103
119
|
content_length: Integer,
|
|
104
120
|
markdown: String,
|
|
105
121
|
metadata:
|
|
@@ -118,6 +134,10 @@ module ContextDev
|
|
|
118
134
|
).returns(T.attached_class)
|
|
119
135
|
end
|
|
120
136
|
def self.new(
|
|
137
|
+
# Cache outcome for this response. Composite responses are hits only when every
|
|
138
|
+
# cache-controlled fetch contributing to the output was a hit; age_ms is the
|
|
139
|
+
# oldest contributing hit.
|
|
140
|
+
cache_metadata:,
|
|
121
141
|
# UTF-8 byte length of the returned Markdown. Use 0 to identify an empty result
|
|
122
142
|
# and compare small values against your workload's minimum useful-content
|
|
123
143
|
# threshold.
|
|
@@ -148,6 +168,8 @@ module ContextDev
|
|
|
148
168
|
sig do
|
|
149
169
|
override.returns(
|
|
150
170
|
{
|
|
171
|
+
cache_metadata:
|
|
172
|
+
ContextDev::Models::WebWebScrapeMdResponse::CacheMetadata,
|
|
151
173
|
content_length: Integer,
|
|
152
174
|
markdown: String,
|
|
153
175
|
metadata: ContextDev::Models::WebWebScrapeMdResponse::Metadata,
|
|
@@ -168,6 +190,101 @@ module ContextDev
|
|
|
168
190
|
def to_hash
|
|
169
191
|
end
|
|
170
192
|
|
|
193
|
+
class CacheMetadata < ContextDev::Internal::Type::BaseModel
|
|
194
|
+
OrHash =
|
|
195
|
+
T.type_alias do
|
|
196
|
+
T.any(
|
|
197
|
+
ContextDev::Models::WebWebScrapeMdResponse::CacheMetadata,
|
|
198
|
+
ContextDev::Internal::AnyHash
|
|
199
|
+
)
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Age of the cached data in milliseconds. Zero for miss and zdr responses.
|
|
203
|
+
sig { returns(Integer) }
|
|
204
|
+
attr_accessor :age_ms
|
|
205
|
+
|
|
206
|
+
# Whether the response was served from cache, required fresh work, or honored
|
|
207
|
+
# zero-data-retention cache bypass.
|
|
208
|
+
sig do
|
|
209
|
+
returns(
|
|
210
|
+
ContextDev::Models::WebWebScrapeMdResponse::CacheMetadata::Status::TaggedSymbol
|
|
211
|
+
)
|
|
212
|
+
end
|
|
213
|
+
attr_accessor :status
|
|
214
|
+
|
|
215
|
+
# Cache outcome for this response. Composite responses are hits only when every
|
|
216
|
+
# cache-controlled fetch contributing to the output was a hit; age_ms is the
|
|
217
|
+
# oldest contributing hit.
|
|
218
|
+
sig do
|
|
219
|
+
params(
|
|
220
|
+
age_ms: Integer,
|
|
221
|
+
status:
|
|
222
|
+
ContextDev::Models::WebWebScrapeMdResponse::CacheMetadata::Status::OrSymbol
|
|
223
|
+
).returns(T.attached_class)
|
|
224
|
+
end
|
|
225
|
+
def self.new(
|
|
226
|
+
# Age of the cached data in milliseconds. Zero for miss and zdr responses.
|
|
227
|
+
age_ms:,
|
|
228
|
+
# Whether the response was served from cache, required fresh work, or honored
|
|
229
|
+
# zero-data-retention cache bypass.
|
|
230
|
+
status:
|
|
231
|
+
)
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
sig do
|
|
235
|
+
override.returns(
|
|
236
|
+
{
|
|
237
|
+
age_ms: Integer,
|
|
238
|
+
status:
|
|
239
|
+
ContextDev::Models::WebWebScrapeMdResponse::CacheMetadata::Status::TaggedSymbol
|
|
240
|
+
}
|
|
241
|
+
)
|
|
242
|
+
end
|
|
243
|
+
def to_hash
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
# Whether the response was served from cache, required fresh work, or honored
|
|
247
|
+
# zero-data-retention cache bypass.
|
|
248
|
+
module Status
|
|
249
|
+
extend ContextDev::Internal::Type::Enum
|
|
250
|
+
|
|
251
|
+
TaggedSymbol =
|
|
252
|
+
T.type_alias do
|
|
253
|
+
T.all(
|
|
254
|
+
Symbol,
|
|
255
|
+
ContextDev::Models::WebWebScrapeMdResponse::CacheMetadata::Status
|
|
256
|
+
)
|
|
257
|
+
end
|
|
258
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
259
|
+
|
|
260
|
+
HIT =
|
|
261
|
+
T.let(
|
|
262
|
+
:hit,
|
|
263
|
+
ContextDev::Models::WebWebScrapeMdResponse::CacheMetadata::Status::TaggedSymbol
|
|
264
|
+
)
|
|
265
|
+
MISS =
|
|
266
|
+
T.let(
|
|
267
|
+
:miss,
|
|
268
|
+
ContextDev::Models::WebWebScrapeMdResponse::CacheMetadata::Status::TaggedSymbol
|
|
269
|
+
)
|
|
270
|
+
ZDR =
|
|
271
|
+
T.let(
|
|
272
|
+
:zdr,
|
|
273
|
+
ContextDev::Models::WebWebScrapeMdResponse::CacheMetadata::Status::TaggedSymbol
|
|
274
|
+
)
|
|
275
|
+
|
|
276
|
+
sig do
|
|
277
|
+
override.returns(
|
|
278
|
+
T::Array[
|
|
279
|
+
ContextDev::Models::WebWebScrapeMdResponse::CacheMetadata::Status::TaggedSymbol
|
|
280
|
+
]
|
|
281
|
+
)
|
|
282
|
+
end
|
|
283
|
+
def self.values
|
|
284
|
+
end
|
|
285
|
+
end
|
|
286
|
+
end
|
|
287
|
+
|
|
171
288
|
class Metadata < ContextDev::Internal::Type::BaseModel
|
|
172
289
|
OrHash =
|
|
173
290
|
T.type_alias do
|
|
@@ -9,6 +9,14 @@ module ContextDev
|
|
|
9
9
|
params(
|
|
10
10
|
schema: T::Hash[Symbol, T.anything],
|
|
11
11
|
url: String,
|
|
12
|
+
actions:
|
|
13
|
+
T::Array[
|
|
14
|
+
T.any(
|
|
15
|
+
ContextDev::WebExtractParams::Action::Wait::OrHash,
|
|
16
|
+
ContextDev::WebExtractParams::Action::Perform::OrHash,
|
|
17
|
+
ContextDev::WebExtractParams::Action::Scroll::OrHash
|
|
18
|
+
)
|
|
19
|
+
],
|
|
12
20
|
fact_check: T::Boolean,
|
|
13
21
|
follow_subdomains: T::Boolean,
|
|
14
22
|
include_frames: T::Boolean,
|
|
@@ -26,13 +34,20 @@ module ContextDev
|
|
|
26
34
|
).returns(ContextDev::Models::WebExtractResponse)
|
|
27
35
|
end
|
|
28
36
|
def extract(
|
|
29
|
-
# JSON Schema for the returned data object.
|
|
30
|
-
#
|
|
31
|
-
#
|
|
37
|
+
# JSON Schema for the returned data object. Image fields such as `image_urls` or
|
|
38
|
+
# `product_photos` automatically make page image references available to
|
|
39
|
+
# extraction, so product data and photos can be returned in one call. TypeScript
|
|
40
|
+
# Zod users can pass a JSON Schema generated from a Zod object; Python users can
|
|
41
|
+
# pass the equivalent JSON Schema object.
|
|
32
42
|
schema:,
|
|
33
43
|
# The starting website URL to crawl and extract from. Must include http:// or
|
|
34
44
|
# https://.
|
|
35
45
|
url:,
|
|
46
|
+
# Optional browser actions executed in order on the requested page after it loads,
|
|
47
|
+
# before links are discovered or additional pages are crawled. Requires a paid
|
|
48
|
+
# plan. When actions are provided and stopAfterMs is omitted, the crawl budget
|
|
49
|
+
# defaults to 110000 ms.
|
|
50
|
+
actions: nil,
|
|
36
51
|
# When true, every returned value must be grounded in facts stated on the page;
|
|
37
52
|
# fields that cannot be supported by the page are returned as null/empty. When
|
|
38
53
|
# false (default), the model may make reasonable inferences and derivations from
|
|
@@ -61,7 +76,8 @@ module ContextDev
|
|
|
61
76
|
# exchange for more stable output on animated pages.
|
|
62
77
|
settle_animations: nil,
|
|
63
78
|
# Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000
|
|
64
|
-
# (110s).
|
|
79
|
+
# (110s). Defaults to 80000 (80s), or 110000 (110s) when browser actions are
|
|
80
|
+
# provided.
|
|
65
81
|
stop_after_ms: nil,
|
|
66
82
|
# Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
|
|
67
83
|
tags: nil,
|
|
@@ -408,13 +424,15 @@ module ContextDev
|
|
|
408
424
|
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
409
425
|
# value is 300000ms (5 minutes).
|
|
410
426
|
timeout_ms: nil,
|
|
411
|
-
# Regex pattern. Only URLs matching this pattern will be followed and scraped.
|
|
427
|
+
# Regex pattern. Only URLs matching this pattern will be followed and scraped. An
|
|
428
|
+
# automatic prefix scope in the form ^<starting URL> follows a redirect of the
|
|
429
|
+
# starting page.
|
|
412
430
|
url_regex: nil,
|
|
413
431
|
# Extract only the main content, stripping headers, footers, sidebars, and
|
|
414
432
|
# navigation
|
|
415
433
|
use_main_content_only: nil,
|
|
416
|
-
#
|
|
417
|
-
#
|
|
434
|
+
# Browser wait time in milliseconds after initial page load for each crawled page.
|
|
435
|
+
# Defaults to 3500 (3.5 seconds). Min: 0. Max: 30000 (30 seconds).
|
|
418
436
|
wait_for_ms: nil,
|
|
419
437
|
# Set to enabled to bypass shared caches and omit request and response content
|
|
420
438
|
# from retained usage logs. Requires zero data retention to be enabled for your
|
|
@@ -435,7 +453,8 @@ module ContextDev
|
|
|
435
453
|
T::Array[
|
|
436
454
|
T.any(
|
|
437
455
|
ContextDev::WebWebScrapeHTMLParams::Action::Wait::OrHash,
|
|
438
|
-
ContextDev::WebWebScrapeHTMLParams::Action::Perform::OrHash
|
|
456
|
+
ContextDev::WebWebScrapeHTMLParams::Action::Perform::OrHash,
|
|
457
|
+
ContextDev::WebWebScrapeHTMLParams::Action::Scroll::OrHash
|
|
439
458
|
)
|
|
440
459
|
]
|
|
441
460
|
),
|
|
@@ -526,7 +545,8 @@ module ContextDev
|
|
|
526
545
|
T::Array[
|
|
527
546
|
T.any(
|
|
528
547
|
ContextDev::WebWebScrapeImagesParams::Action::Wait::OrHash,
|
|
529
|
-
ContextDev::WebWebScrapeImagesParams::Action::Perform::OrHash
|
|
548
|
+
ContextDev::WebWebScrapeImagesParams::Action::Perform::OrHash,
|
|
549
|
+
ContextDev::WebWebScrapeImagesParams::Action::Scroll::OrHash
|
|
530
550
|
)
|
|
531
551
|
]
|
|
532
552
|
),
|
|
@@ -615,7 +635,8 @@ module ContextDev
|
|
|
615
635
|
T::Array[
|
|
616
636
|
T.any(
|
|
617
637
|
ContextDev::WebWebScrapeMdParams::Action::Wait::OrHash,
|
|
618
|
-
ContextDev::WebWebScrapeMdParams::Action::Perform::OrHash
|
|
638
|
+
ContextDev::WebWebScrapeMdParams::Action::Perform::OrHash,
|
|
639
|
+
ContextDev::WebWebScrapeMdParams::Action::Scroll::OrHash
|
|
619
640
|
)
|
|
620
641
|
]
|
|
621
642
|
),
|
|
@@ -2,6 +2,7 @@ module ContextDev
|
|
|
2
2
|
module Models
|
|
3
3
|
type ai_extract_product_response =
|
|
4
4
|
{
|
|
5
|
+
cache_metadata: ContextDev::Models::AIExtractProductResponse::CacheMetadata,
|
|
5
6
|
is_product_page: bool,
|
|
6
7
|
key_metadata: ContextDev::Models::AIExtractProductResponse::KeyMetadata,
|
|
7
8
|
platform: ContextDev::Models::AIExtractProductResponse::platform?,
|
|
@@ -9,6 +10,8 @@ module ContextDev
|
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
class AIExtractProductResponse < ContextDev::Internal::Type::BaseModel
|
|
13
|
+
attr_accessor cache_metadata: ContextDev::Models::AIExtractProductResponse::CacheMetadata
|
|
14
|
+
|
|
12
15
|
attr_reader is_product_page: bool?
|
|
13
16
|
|
|
14
17
|
def is_product_page=: (bool) -> bool
|
|
@@ -24,6 +27,7 @@ module ContextDev
|
|
|
24
27
|
attr_accessor product: ContextDev::Models::AIExtractProductResponse::Product?
|
|
25
28
|
|
|
26
29
|
def initialize: (
|
|
30
|
+
cache_metadata: ContextDev::Models::AIExtractProductResponse::CacheMetadata,
|
|
27
31
|
?is_product_page: bool,
|
|
28
32
|
?key_metadata: ContextDev::Models::AIExtractProductResponse::KeyMetadata,
|
|
29
33
|
?platform: ContextDev::Models::AIExtractProductResponse::platform?,
|
|
@@ -31,12 +35,47 @@ module ContextDev
|
|
|
31
35
|
) -> void
|
|
32
36
|
|
|
33
37
|
def to_hash: -> {
|
|
38
|
+
cache_metadata: ContextDev::Models::AIExtractProductResponse::CacheMetadata,
|
|
34
39
|
is_product_page: bool,
|
|
35
40
|
key_metadata: ContextDev::Models::AIExtractProductResponse::KeyMetadata,
|
|
36
41
|
platform: ContextDev::Models::AIExtractProductResponse::platform?,
|
|
37
42
|
product: ContextDev::Models::AIExtractProductResponse::Product?
|
|
38
43
|
}
|
|
39
44
|
|
|
45
|
+
type cache_metadata =
|
|
46
|
+
{
|
|
47
|
+
age_ms: Integer,
|
|
48
|
+
status: ContextDev::Models::AIExtractProductResponse::CacheMetadata::status
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
class CacheMetadata < ContextDev::Internal::Type::BaseModel
|
|
52
|
+
attr_accessor age_ms: Integer
|
|
53
|
+
|
|
54
|
+
attr_accessor status: ContextDev::Models::AIExtractProductResponse::CacheMetadata::status
|
|
55
|
+
|
|
56
|
+
def initialize: (
|
|
57
|
+
age_ms: Integer,
|
|
58
|
+
status: ContextDev::Models::AIExtractProductResponse::CacheMetadata::status
|
|
59
|
+
) -> void
|
|
60
|
+
|
|
61
|
+
def to_hash: -> {
|
|
62
|
+
age_ms: Integer,
|
|
63
|
+
status: ContextDev::Models::AIExtractProductResponse::CacheMetadata::status
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
type status = :hit | :miss | :zdr
|
|
67
|
+
|
|
68
|
+
module Status
|
|
69
|
+
extend ContextDev::Internal::Type::Enum
|
|
70
|
+
|
|
71
|
+
HIT: :hit
|
|
72
|
+
MISS: :miss
|
|
73
|
+
ZDR: :zdr
|
|
74
|
+
|
|
75
|
+
def self?.values: -> ::Array[ContextDev::Models::AIExtractProductResponse::CacheMetadata::status]
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
40
79
|
type key_metadata =
|
|
41
80
|
{ credits_consumed: Integer, credits_remaining: Integer }
|
|
42
81
|
|
|
@@ -78,12 +117,15 @@ module ContextDev
|
|
|
78
117
|
sku: String?,
|
|
79
118
|
tags: ::Array[String],
|
|
80
119
|
target_audience: ::Array[String],
|
|
120
|
+
availability: ContextDev::Models::AIExtractProductResponse::Product::availability?,
|
|
81
121
|
billing_frequency: ContextDev::Models::AIExtractProductResponse::Product::billing_frequency?,
|
|
82
122
|
category: String?,
|
|
83
123
|
currency: String?,
|
|
124
|
+
dimensions: ::Array[String],
|
|
84
125
|
image_url: String?,
|
|
85
126
|
price: Float?,
|
|
86
127
|
pricing_model: ContextDev::Models::AIExtractProductResponse::Product::pricing_model?,
|
|
128
|
+
regular_price: Float?,
|
|
87
129
|
url: String?
|
|
88
130
|
}
|
|
89
131
|
|
|
@@ -102,18 +144,26 @@ module ContextDev
|
|
|
102
144
|
|
|
103
145
|
attr_accessor target_audience: ::Array[String]
|
|
104
146
|
|
|
147
|
+
attr_accessor availability: ContextDev::Models::AIExtractProductResponse::Product::availability?
|
|
148
|
+
|
|
105
149
|
attr_accessor billing_frequency: ContextDev::Models::AIExtractProductResponse::Product::billing_frequency?
|
|
106
150
|
|
|
107
151
|
attr_accessor category: String?
|
|
108
152
|
|
|
109
153
|
attr_accessor currency: String?
|
|
110
154
|
|
|
155
|
+
attr_reader dimensions: ::Array[String]?
|
|
156
|
+
|
|
157
|
+
def dimensions=: (::Array[String]) -> ::Array[String]
|
|
158
|
+
|
|
111
159
|
attr_accessor image_url: String?
|
|
112
160
|
|
|
113
161
|
attr_accessor price: Float?
|
|
114
162
|
|
|
115
163
|
attr_accessor pricing_model: ContextDev::Models::AIExtractProductResponse::Product::pricing_model?
|
|
116
164
|
|
|
165
|
+
attr_accessor regular_price: Float?
|
|
166
|
+
|
|
117
167
|
attr_accessor url: String?
|
|
118
168
|
|
|
119
169
|
def initialize: (
|
|
@@ -124,12 +174,15 @@ module ContextDev
|
|
|
124
174
|
sku: String?,
|
|
125
175
|
tags: ::Array[String],
|
|
126
176
|
target_audience: ::Array[String],
|
|
177
|
+
?availability: ContextDev::Models::AIExtractProductResponse::Product::availability?,
|
|
127
178
|
?billing_frequency: ContextDev::Models::AIExtractProductResponse::Product::billing_frequency?,
|
|
128
179
|
?category: String?,
|
|
129
180
|
?currency: String?,
|
|
181
|
+
?dimensions: ::Array[String],
|
|
130
182
|
?image_url: String?,
|
|
131
183
|
?price: Float?,
|
|
132
184
|
?pricing_model: ContextDev::Models::AIExtractProductResponse::Product::pricing_model?,
|
|
185
|
+
?regular_price: Float?,
|
|
133
186
|
?url: String?
|
|
134
187
|
) -> void
|
|
135
188
|
|
|
@@ -141,15 +194,41 @@ module ContextDev
|
|
|
141
194
|
sku: String?,
|
|
142
195
|
tags: ::Array[String],
|
|
143
196
|
target_audience: ::Array[String],
|
|
197
|
+
availability: ContextDev::Models::AIExtractProductResponse::Product::availability?,
|
|
144
198
|
billing_frequency: ContextDev::Models::AIExtractProductResponse::Product::billing_frequency?,
|
|
145
199
|
category: String?,
|
|
146
200
|
currency: String?,
|
|
201
|
+
dimensions: ::Array[String],
|
|
147
202
|
image_url: String?,
|
|
148
203
|
price: Float?,
|
|
149
204
|
pricing_model: ContextDev::Models::AIExtractProductResponse::Product::pricing_model?,
|
|
205
|
+
regular_price: Float?,
|
|
150
206
|
url: String?
|
|
151
207
|
}
|
|
152
208
|
|
|
209
|
+
type availability =
|
|
210
|
+
:in_stock
|
|
211
|
+
| :out_of_stock
|
|
212
|
+
| :limited_availability
|
|
213
|
+
| :preorder
|
|
214
|
+
| :backorder
|
|
215
|
+
| :made_to_order
|
|
216
|
+
| :discontinued
|
|
217
|
+
|
|
218
|
+
module Availability
|
|
219
|
+
extend ContextDev::Internal::Type::Enum
|
|
220
|
+
|
|
221
|
+
IN_STOCK: :in_stock
|
|
222
|
+
OUT_OF_STOCK: :out_of_stock
|
|
223
|
+
LIMITED_AVAILABILITY: :limited_availability
|
|
224
|
+
PREORDER: :preorder
|
|
225
|
+
BACKORDER: :backorder
|
|
226
|
+
MADE_TO_ORDER: :made_to_order
|
|
227
|
+
DISCONTINUED: :discontinued
|
|
228
|
+
|
|
229
|
+
def self?.values: -> ::Array[ContextDev::Models::AIExtractProductResponse::Product::availability]
|
|
230
|
+
end
|
|
231
|
+
|
|
153
232
|
type billing_frequency = :monthly | :yearly | :one_time | :usage_based
|
|
154
233
|
|
|
155
234
|
module BillingFrequency
|
|
@@ -2,11 +2,14 @@ module ContextDev
|
|
|
2
2
|
module Models
|
|
3
3
|
type ai_extract_products_response =
|
|
4
4
|
{
|
|
5
|
+
cache_metadata: ContextDev::Models::AIExtractProductsResponse::CacheMetadata,
|
|
5
6
|
key_metadata: ContextDev::Models::AIExtractProductsResponse::KeyMetadata,
|
|
6
7
|
products: ::Array[ContextDev::Models::AIExtractProductsResponse::Product]
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
class AIExtractProductsResponse < ContextDev::Internal::Type::BaseModel
|
|
11
|
+
attr_accessor cache_metadata: ContextDev::Models::AIExtractProductsResponse::CacheMetadata
|
|
12
|
+
|
|
10
13
|
attr_reader key_metadata: ContextDev::Models::AIExtractProductsResponse::KeyMetadata?
|
|
11
14
|
|
|
12
15
|
def key_metadata=: (
|
|
@@ -20,15 +23,51 @@ module ContextDev
|
|
|
20
23
|
) -> ::Array[ContextDev::Models::AIExtractProductsResponse::Product]
|
|
21
24
|
|
|
22
25
|
def initialize: (
|
|
26
|
+
cache_metadata: ContextDev::Models::AIExtractProductsResponse::CacheMetadata,
|
|
23
27
|
?key_metadata: ContextDev::Models::AIExtractProductsResponse::KeyMetadata,
|
|
24
28
|
?products: ::Array[ContextDev::Models::AIExtractProductsResponse::Product]
|
|
25
29
|
) -> void
|
|
26
30
|
|
|
27
31
|
def to_hash: -> {
|
|
32
|
+
cache_metadata: ContextDev::Models::AIExtractProductsResponse::CacheMetadata,
|
|
28
33
|
key_metadata: ContextDev::Models::AIExtractProductsResponse::KeyMetadata,
|
|
29
34
|
products: ::Array[ContextDev::Models::AIExtractProductsResponse::Product]
|
|
30
35
|
}
|
|
31
36
|
|
|
37
|
+
type cache_metadata =
|
|
38
|
+
{
|
|
39
|
+
age_ms: Integer,
|
|
40
|
+
status: ContextDev::Models::AIExtractProductsResponse::CacheMetadata::status
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
class CacheMetadata < ContextDev::Internal::Type::BaseModel
|
|
44
|
+
attr_accessor age_ms: Integer
|
|
45
|
+
|
|
46
|
+
attr_accessor status: ContextDev::Models::AIExtractProductsResponse::CacheMetadata::status
|
|
47
|
+
|
|
48
|
+
def initialize: (
|
|
49
|
+
age_ms: Integer,
|
|
50
|
+
status: ContextDev::Models::AIExtractProductsResponse::CacheMetadata::status
|
|
51
|
+
) -> void
|
|
52
|
+
|
|
53
|
+
def to_hash: -> {
|
|
54
|
+
age_ms: Integer,
|
|
55
|
+
status: ContextDev::Models::AIExtractProductsResponse::CacheMetadata::status
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
type status = :hit | :miss | :zdr
|
|
59
|
+
|
|
60
|
+
module Status
|
|
61
|
+
extend ContextDev::Internal::Type::Enum
|
|
62
|
+
|
|
63
|
+
HIT: :hit
|
|
64
|
+
MISS: :miss
|
|
65
|
+
ZDR: :zdr
|
|
66
|
+
|
|
67
|
+
def self?.values: -> ::Array[ContextDev::Models::AIExtractProductsResponse::CacheMetadata::status]
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
32
71
|
type key_metadata =
|
|
33
72
|
{ credits_consumed: Integer, credits_remaining: Integer }
|
|
34
73
|
|
|
@@ -57,12 +96,15 @@ module ContextDev
|
|
|
57
96
|
sku: String?,
|
|
58
97
|
tags: ::Array[String],
|
|
59
98
|
target_audience: ::Array[String],
|
|
99
|
+
availability: ContextDev::Models::AIExtractProductsResponse::Product::availability?,
|
|
60
100
|
billing_frequency: ContextDev::Models::AIExtractProductsResponse::Product::billing_frequency?,
|
|
61
101
|
category: String?,
|
|
62
102
|
currency: String?,
|
|
103
|
+
dimensions: ::Array[String],
|
|
63
104
|
image_url: String?,
|
|
64
105
|
price: Float?,
|
|
65
106
|
pricing_model: ContextDev::Models::AIExtractProductsResponse::Product::pricing_model?,
|
|
107
|
+
regular_price: Float?,
|
|
66
108
|
url: String?
|
|
67
109
|
}
|
|
68
110
|
|
|
@@ -81,18 +123,26 @@ module ContextDev
|
|
|
81
123
|
|
|
82
124
|
attr_accessor target_audience: ::Array[String]
|
|
83
125
|
|
|
126
|
+
attr_accessor availability: ContextDev::Models::AIExtractProductsResponse::Product::availability?
|
|
127
|
+
|
|
84
128
|
attr_accessor billing_frequency: ContextDev::Models::AIExtractProductsResponse::Product::billing_frequency?
|
|
85
129
|
|
|
86
130
|
attr_accessor category: String?
|
|
87
131
|
|
|
88
132
|
attr_accessor currency: String?
|
|
89
133
|
|
|
134
|
+
attr_reader dimensions: ::Array[String]?
|
|
135
|
+
|
|
136
|
+
def dimensions=: (::Array[String]) -> ::Array[String]
|
|
137
|
+
|
|
90
138
|
attr_accessor image_url: String?
|
|
91
139
|
|
|
92
140
|
attr_accessor price: Float?
|
|
93
141
|
|
|
94
142
|
attr_accessor pricing_model: ContextDev::Models::AIExtractProductsResponse::Product::pricing_model?
|
|
95
143
|
|
|
144
|
+
attr_accessor regular_price: Float?
|
|
145
|
+
|
|
96
146
|
attr_accessor url: String?
|
|
97
147
|
|
|
98
148
|
def initialize: (
|
|
@@ -103,12 +153,15 @@ module ContextDev
|
|
|
103
153
|
sku: String?,
|
|
104
154
|
tags: ::Array[String],
|
|
105
155
|
target_audience: ::Array[String],
|
|
156
|
+
?availability: ContextDev::Models::AIExtractProductsResponse::Product::availability?,
|
|
106
157
|
?billing_frequency: ContextDev::Models::AIExtractProductsResponse::Product::billing_frequency?,
|
|
107
158
|
?category: String?,
|
|
108
159
|
?currency: String?,
|
|
160
|
+
?dimensions: ::Array[String],
|
|
109
161
|
?image_url: String?,
|
|
110
162
|
?price: Float?,
|
|
111
163
|
?pricing_model: ContextDev::Models::AIExtractProductsResponse::Product::pricing_model?,
|
|
164
|
+
?regular_price: Float?,
|
|
112
165
|
?url: String?
|
|
113
166
|
) -> void
|
|
114
167
|
|
|
@@ -120,15 +173,41 @@ module ContextDev
|
|
|
120
173
|
sku: String?,
|
|
121
174
|
tags: ::Array[String],
|
|
122
175
|
target_audience: ::Array[String],
|
|
176
|
+
availability: ContextDev::Models::AIExtractProductsResponse::Product::availability?,
|
|
123
177
|
billing_frequency: ContextDev::Models::AIExtractProductsResponse::Product::billing_frequency?,
|
|
124
178
|
category: String?,
|
|
125
179
|
currency: String?,
|
|
180
|
+
dimensions: ::Array[String],
|
|
126
181
|
image_url: String?,
|
|
127
182
|
price: Float?,
|
|
128
183
|
pricing_model: ContextDev::Models::AIExtractProductsResponse::Product::pricing_model?,
|
|
184
|
+
regular_price: Float?,
|
|
129
185
|
url: String?
|
|
130
186
|
}
|
|
131
187
|
|
|
188
|
+
type availability =
|
|
189
|
+
:in_stock
|
|
190
|
+
| :out_of_stock
|
|
191
|
+
| :limited_availability
|
|
192
|
+
| :preorder
|
|
193
|
+
| :backorder
|
|
194
|
+
| :made_to_order
|
|
195
|
+
| :discontinued
|
|
196
|
+
|
|
197
|
+
module Availability
|
|
198
|
+
extend ContextDev::Internal::Type::Enum
|
|
199
|
+
|
|
200
|
+
IN_STOCK: :in_stock
|
|
201
|
+
OUT_OF_STOCK: :out_of_stock
|
|
202
|
+
LIMITED_AVAILABILITY: :limited_availability
|
|
203
|
+
PREORDER: :preorder
|
|
204
|
+
BACKORDER: :backorder
|
|
205
|
+
MADE_TO_ORDER: :made_to_order
|
|
206
|
+
DISCONTINUED: :discontinued
|
|
207
|
+
|
|
208
|
+
def self?.values: -> ::Array[ContextDev::Models::AIExtractProductsResponse::Product::availability]
|
|
209
|
+
end
|
|
210
|
+
|
|
132
211
|
type billing_frequency = :monthly | :yearly | :one_time | :usage_based
|
|
133
212
|
|
|
134
213
|
module BillingFrequency
|
|
@@ -50,6 +50,7 @@ module ContextDev
|
|
|
50
50
|
|
|
51
51
|
type ok =
|
|
52
52
|
{
|
|
53
|
+
cache_metadata: ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata,
|
|
53
54
|
final_url: String,
|
|
54
55
|
http_status: Integer?,
|
|
55
56
|
metadata: ContextDev::Models::BatchGetResultsResponse::Data::Ok::Metadata,
|
|
@@ -63,6 +64,8 @@ module ContextDev
|
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
class Ok < ContextDev::Internal::Type::BaseModel
|
|
67
|
+
attr_accessor cache_metadata: ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata
|
|
68
|
+
|
|
66
69
|
attr_accessor final_url: String
|
|
67
70
|
|
|
68
71
|
attr_accessor http_status: Integer?
|
|
@@ -94,6 +97,7 @@ module ContextDev
|
|
|
94
97
|
def ocr_pages=: (Integer) -> Integer
|
|
95
98
|
|
|
96
99
|
def initialize: (
|
|
100
|
+
cache_metadata: ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata,
|
|
97
101
|
final_url: String,
|
|
98
102
|
http_status: Integer?,
|
|
99
103
|
metadata: ContextDev::Models::BatchGetResultsResponse::Data::Ok::Metadata,
|
|
@@ -107,6 +111,7 @@ module ContextDev
|
|
|
107
111
|
) -> void
|
|
108
112
|
|
|
109
113
|
def to_hash: -> {
|
|
114
|
+
cache_metadata: ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata,
|
|
110
115
|
final_url: String,
|
|
111
116
|
http_status: Integer?,
|
|
112
117
|
metadata: ContextDev::Models::BatchGetResultsResponse::Data::Ok::Metadata,
|
|
@@ -119,6 +124,40 @@ module ContextDev
|
|
|
119
124
|
ocr_pages: Integer
|
|
120
125
|
}
|
|
121
126
|
|
|
127
|
+
type cache_metadata =
|
|
128
|
+
{
|
|
129
|
+
age_ms: Integer,
|
|
130
|
+
status: ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata::status
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
class CacheMetadata < ContextDev::Internal::Type::BaseModel
|
|
134
|
+
attr_accessor age_ms: Integer
|
|
135
|
+
|
|
136
|
+
attr_accessor status: ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata::status
|
|
137
|
+
|
|
138
|
+
def initialize: (
|
|
139
|
+
age_ms: Integer,
|
|
140
|
+
status: ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata::status
|
|
141
|
+
) -> void
|
|
142
|
+
|
|
143
|
+
def to_hash: -> {
|
|
144
|
+
age_ms: Integer,
|
|
145
|
+
status: ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata::status
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
type status = :hit | :miss | :zdr
|
|
149
|
+
|
|
150
|
+
module Status
|
|
151
|
+
extend ContextDev::Internal::Type::Enum
|
|
152
|
+
|
|
153
|
+
HIT: :hit
|
|
154
|
+
MISS: :miss
|
|
155
|
+
ZDR: :zdr
|
|
156
|
+
|
|
157
|
+
def self?.values: -> ::Array[ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata::status]
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
|
|
122
161
|
type metadata =
|
|
123
162
|
{
|
|
124
163
|
final_url: String,
|