context.dev 2.18.0 → 2.20.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 (116) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +220 -0
  3. data/README.md +1 -1
  4. data/lib/context_dev/client.rb +0 -4
  5. data/lib/context_dev/models/monitor_retrieve_run_params.rb +26 -0
  6. data/lib/context_dev/models/monitor_retrieve_run_response.rb +232 -0
  7. data/lib/context_dev/models/monitor_rotate_webhook_secret_params.rb +20 -0
  8. data/lib/context_dev/models/monitor_rotate_webhook_secret_response.rb +765 -0
  9. data/lib/context_dev/models/{web_web_scrape_sitemap_params.rb → web_map_urls_params.rb} +14 -14
  10. data/lib/context_dev/models/web_map_urls_response.rb +123 -0
  11. data/lib/context_dev/models/web_scrape_params.rb +1035 -0
  12. data/lib/context_dev/models/web_scrape_response.rb +974 -0
  13. data/lib/context_dev/models/web_screenshot_params.rb +15 -1
  14. data/lib/context_dev/models/web_screenshot_response.rb +3 -3
  15. data/lib/context_dev/models.rb +8 -22
  16. data/lib/context_dev/resources/brand.rb +0 -36
  17. data/lib/context_dev/resources/monitors.rb +47 -0
  18. data/lib/context_dev/resources/web.rb +118 -486
  19. data/lib/context_dev/version.rb +1 -1
  20. data/lib/context_dev.rb +8 -23
  21. data/rbi/context_dev/client.rbi +0 -3
  22. data/rbi/context_dev/models/monitor_retrieve_run_params.rbi +46 -0
  23. data/rbi/context_dev/models/monitor_retrieve_run_response.rbi +452 -0
  24. data/rbi/context_dev/models/monitor_rotate_webhook_secret_params.rbi +38 -0
  25. data/rbi/context_dev/models/monitor_rotate_webhook_secret_response.rbi +1367 -0
  26. data/rbi/context_dev/models/{web_web_scrape_sitemap_params.rbi → web_map_urls_params.rbi} +23 -45
  27. data/rbi/context_dev/models/web_map_urls_response.rbi +226 -0
  28. data/rbi/context_dev/models/web_scrape_params.rbi +2221 -0
  29. data/rbi/context_dev/models/web_scrape_response.rbi +1874 -0
  30. data/rbi/context_dev/models/web_screenshot_params.rbi +23 -0
  31. data/rbi/context_dev/models/web_screenshot_response.rbi +4 -4
  32. data/rbi/context_dev/models.rbi +9 -24
  33. data/rbi/context_dev/resources/brand.rbi +0 -35
  34. data/rbi/context_dev/resources/monitors.rbi +24 -0
  35. data/rbi/context_dev/resources/web.rbi +152 -654
  36. data/sig/context_dev/client.rbs +0 -2
  37. data/sig/context_dev/models/monitor_retrieve_run_params.rbs +28 -0
  38. data/sig/context_dev/models/monitor_retrieve_run_response.rbs +182 -0
  39. data/sig/context_dev/models/monitor_rotate_webhook_secret_params.rbs +23 -0
  40. data/sig/context_dev/models/monitor_rotate_webhook_secret_response.rbs +545 -0
  41. data/sig/context_dev/models/{web_web_scrape_sitemap_params.rbs → web_map_urls_params.rbs} +22 -22
  42. data/sig/context_dev/models/web_map_urls_response.rbs +125 -0
  43. data/sig/context_dev/models/web_scrape_params.rbs +925 -0
  44. data/sig/context_dev/models/web_scrape_response.rbs +782 -0
  45. data/sig/context_dev/models/web_screenshot_params.rbs +7 -0
  46. data/sig/context_dev/models.rbs +8 -22
  47. data/sig/context_dev/resources/brand.rbs +0 -9
  48. data/sig/context_dev/resources/monitors.rbs +11 -0
  49. data/sig/context_dev/resources/web.rbs +33 -128
  50. metadata +26 -71
  51. data/lib/context_dev/models/ai_extract_product_params.rb +0 -125
  52. data/lib/context_dev/models/ai_extract_product_response.rb +0 -402
  53. data/lib/context_dev/models/ai_extract_products_params.rb +0 -233
  54. data/lib/context_dev/models/ai_extract_products_response.rb +0 -370
  55. data/lib/context_dev/models/brand_retrieve_simplified_params.rb +0 -120
  56. data/lib/context_dev/models/brand_retrieve_simplified_response.rb +0 -441
  57. data/lib/context_dev/models/web_extract_fonts_params.rb +0 -114
  58. data/lib/context_dev/models/web_extract_fonts_response.rb +0 -291
  59. data/lib/context_dev/models/web_extract_params.rb +0 -419
  60. data/lib/context_dev/models/web_extract_response.rb +0 -287
  61. data/lib/context_dev/models/web_web_scrape_bytes_params.rb +0 -346
  62. data/lib/context_dev/models/web_web_scrape_bytes_response.rb +0 -135
  63. data/lib/context_dev/models/web_web_scrape_html_params.rb +0 -812
  64. data/lib/context_dev/models/web_web_scrape_html_response.rb +0 -628
  65. data/lib/context_dev/models/web_web_scrape_images_params.rb +0 -373
  66. data/lib/context_dev/models/web_web_scrape_images_response.rb +0 -409
  67. data/lib/context_dev/models/web_web_scrape_md_params.rb +0 -670
  68. data/lib/context_dev/models/web_web_scrape_md_response.rb +0 -567
  69. data/lib/context_dev/models/web_web_scrape_screenshot_params.rb +0 -471
  70. data/lib/context_dev/models/web_web_scrape_screenshot_response.rb +0 -169
  71. data/lib/context_dev/models/web_web_scrape_sitemap_response.rb +0 -144
  72. data/lib/context_dev/resources/ai.rb +0 -71
  73. data/rbi/context_dev/models/ai_extract_product_params.rbi +0 -253
  74. data/rbi/context_dev/models/ai_extract_product_response.rbi +0 -791
  75. data/rbi/context_dev/models/ai_extract_products_params.rbi +0 -490
  76. data/rbi/context_dev/models/ai_extract_products_response.rbi +0 -718
  77. data/rbi/context_dev/models/brand_retrieve_simplified_params.rbi +0 -256
  78. data/rbi/context_dev/models/brand_retrieve_simplified_response.rbi +0 -1040
  79. data/rbi/context_dev/models/web_extract_fonts_params.rbi +0 -223
  80. data/rbi/context_dev/models/web_extract_fonts_response.rbi +0 -563
  81. data/rbi/context_dev/models/web_extract_params.rbi +0 -781
  82. data/rbi/context_dev/models/web_extract_response.rbi +0 -512
  83. data/rbi/context_dev/models/web_web_scrape_bytes_params.rbi +0 -702
  84. data/rbi/context_dev/models/web_web_scrape_bytes_response.rbi +0 -238
  85. data/rbi/context_dev/models/web_web_scrape_html_params.rbi +0 -1690
  86. data/rbi/context_dev/models/web_web_scrape_html_response.rbi +0 -1287
  87. data/rbi/context_dev/models/web_web_scrape_images_params.rbi +0 -728
  88. data/rbi/context_dev/models/web_web_scrape_images_response.rbi +0 -910
  89. data/rbi/context_dev/models/web_web_scrape_md_params.rbi +0 -1052
  90. data/rbi/context_dev/models/web_web_scrape_md_response.rbi +0 -1088
  91. data/rbi/context_dev/models/web_web_scrape_screenshot_params.rbi +0 -1580
  92. data/rbi/context_dev/models/web_web_scrape_screenshot_response.rbi +0 -332
  93. data/rbi/context_dev/models/web_web_scrape_sitemap_response.rbi +0 -258
  94. data/rbi/context_dev/resources/ai.rbi +0 -63
  95. data/sig/context_dev/models/ai_extract_product_params.rbs +0 -106
  96. data/sig/context_dev/models/ai_extract_product_response.rbs +0 -314
  97. data/sig/context_dev/models/ai_extract_products_params.rbs +0 -202
  98. data/sig/context_dev/models/ai_extract_products_response.rbs +0 -293
  99. data/sig/context_dev/models/brand_retrieve_simplified_params.rbs +0 -104
  100. data/sig/context_dev/models/brand_retrieve_simplified_response.rbs +0 -413
  101. data/sig/context_dev/models/web_extract_fonts_params.rbs +0 -93
  102. data/sig/context_dev/models/web_extract_fonts_response.rbs +0 -230
  103. data/sig/context_dev/models/web_extract_params.rbs +0 -324
  104. data/sig/context_dev/models/web_extract_response.rbs +0 -239
  105. data/sig/context_dev/models/web_web_scrape_bytes_params.rbs +0 -531
  106. data/sig/context_dev/models/web_web_scrape_bytes_response.rbs +0 -108
  107. data/sig/context_dev/models/web_web_scrape_html_params.rbs +0 -878
  108. data/sig/context_dev/models/web_web_scrape_html_response.rbs +0 -525
  109. data/sig/context_dev/models/web_web_scrape_images_params.rbs +0 -281
  110. data/sig/context_dev/models/web_web_scrape_images_response.rbs +0 -371
  111. data/sig/context_dev/models/web_web_scrape_md_params.rbs +0 -758
  112. data/sig/context_dev/models/web_web_scrape_md_response.rbs +0 -465
  113. data/sig/context_dev/models/web_web_scrape_screenshot_params.rbs +0 -619
  114. data/sig/context_dev/models/web_web_scrape_screenshot_response.rbs +0 -127
  115. data/sig/context_dev/models/web_web_scrape_sitemap_response.rbs +0 -117
  116. data/sig/context_dev/resources/ai.rbs +0 -21
@@ -1,125 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ContextDev
4
- module Models
5
- # @see ContextDev::Resources::AI#extract_product
6
- class AIExtractProductParams < ContextDev::Internal::Type::BaseModel
7
- extend ContextDev::Internal::Type::RequestParameters::Converter
8
- include ContextDev::Internal::Type::RequestParameters
9
-
10
- # @!attribute url
11
- # The product page URL to extract product data from.
12
- #
13
- # @return [String]
14
- required :url, String
15
-
16
- # @!attribute max_age_ms
17
- # Return a cached result if a prior scrape for the same parameters exists and is
18
- # younger than this many milliseconds. Defaults to 7 days (604800000 ms) when
19
- # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
20
- #
21
- # @return [Integer, nil]
22
- optional :max_age_ms, Integer, api_name: :maxAgeMs
23
-
24
- # @!attribute tags
25
- # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
26
- #
27
- # @return [Array<String>, nil]
28
- optional :tags, ContextDev::Internal::Type::ArrayOf[String]
29
-
30
- # @!attribute timeout_opts
31
- # Optional request deadline and behavior on timeout. For GET requests, use
32
- # timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
33
- # timeoutOpts object.
34
- #
35
- # @return [ContextDev::Models::AIExtractProductParams::TimeoutOpts, nil]
36
- optional :timeout_opts, -> { ContextDev::AIExtractProductParams::TimeoutOpts }, api_name: :timeoutOpts
37
-
38
- # @!attribute zdr
39
- # Set to enabled to bypass shared caches and omit request and response content
40
- # from retained usage logs. Asset uploads are skipped, so hosted image URLs are
41
- # omitted. Requires zero data retention to be enabled for your organization
42
- # (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
43
- # Successful ZDR responses include X-Context-ZDR: true.
44
- #
45
- # @return [Symbol, ContextDev::Models::AIExtractProductParams::Zdr, nil]
46
- optional :zdr, enum: -> { ContextDev::AIExtractProductParams::Zdr }
47
-
48
- # @!method initialize(url:, max_age_ms: nil, tags: nil, timeout_opts: nil, zdr: nil, request_options: {})
49
- # Some parameter documentations has been truncated, see
50
- # {ContextDev::Models::AIExtractProductParams} for more details.
51
- #
52
- # @param url [String] The product page URL to extract product data from.
53
- #
54
- # @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
55
- #
56
- # @param tags [Array<String>] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
57
- #
58
- # @param timeout_opts [ContextDev::Models::AIExtractProductParams::TimeoutOpts] Optional request deadline and behavior on timeout. For GET requests, use timeout
59
- #
60
- # @param zdr [Symbol, ContextDev::Models::AIExtractProductParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro
61
- #
62
- # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
63
-
64
- class TimeoutOpts < ContextDev::Internal::Type::BaseModel
65
- # @!attribute milliseconds
66
- # Request deadline in milliseconds. Maximum: 300000 (5 minutes).
67
- #
68
- # @return [Integer]
69
- required :milliseconds, Integer
70
-
71
- # @!attribute behavior
72
- # What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
73
- # credits. "return-partial" returns usable results collected so far; if none are
74
- # available, the request still fails without charging credits. Partial results are
75
- # not cached as complete results.
76
- #
77
- # @return [Symbol, ContextDev::Models::AIExtractProductParams::TimeoutOpts::Behavior, nil]
78
- optional :behavior, enum: -> { ContextDev::AIExtractProductParams::TimeoutOpts::Behavior }
79
-
80
- # @!method initialize(milliseconds:, behavior: nil)
81
- # Some parameter documentations has been truncated, see
82
- # {ContextDev::Models::AIExtractProductParams::TimeoutOpts} for more details.
83
- #
84
- # Optional request deadline and behavior on timeout. For GET requests, use
85
- # timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
86
- # timeoutOpts object.
87
- #
88
- # @param milliseconds [Integer] Request deadline in milliseconds. Maximum: 300000 (5 minutes).
89
- #
90
- # @param behavior [Symbol, ContextDev::Models::AIExtractProductParams::TimeoutOpts::Behavior] What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
91
-
92
- # What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
93
- # credits. "return-partial" returns usable results collected so far; if none are
94
- # available, the request still fails without charging credits. Partial results are
95
- # not cached as complete results.
96
- #
97
- # @see ContextDev::Models::AIExtractProductParams::TimeoutOpts#behavior
98
- module Behavior
99
- extend ContextDev::Internal::Type::Enum
100
-
101
- FAIL = :fail
102
- RETURN_PARTIAL = :"return-partial"
103
-
104
- # @!method self.values
105
- # @return [Array<Symbol>]
106
- end
107
- end
108
-
109
- # Set to enabled to bypass shared caches and omit request and response content
110
- # from retained usage logs. Asset uploads are skipped, so hosted image URLs are
111
- # omitted. Requires zero data retention to be enabled for your organization
112
- # (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
113
- # Successful ZDR responses include X-Context-ZDR: true.
114
- module Zdr
115
- extend ContextDev::Internal::Type::Enum
116
-
117
- ENABLED = :enabled
118
- DISABLED = :disabled
119
-
120
- # @!method self.values
121
- # @return [Array<Symbol>]
122
- end
123
- end
124
- end
125
- end
@@ -1,402 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ContextDev
4
- module Models
5
- # @see ContextDev::Resources::AI#extract_product
6
- class AIExtractProductResponse < ContextDev::Internal::Type::BaseModel
7
- # @!attribute cache_metadata
8
- # Cache outcome for this response. Composite responses are hits only when every
9
- # cache-controlled fetch contributing to the output was a hit; age_ms is the
10
- # oldest contributing hit.
11
- #
12
- # @return [ContextDev::Models::AIExtractProductResponse::CacheMetadata]
13
- required :cache_metadata, -> { ContextDev::Models::AIExtractProductResponse::CacheMetadata }
14
-
15
- # @!attribute request_id
16
- # Unique id of this API call, also sent in the X-Request-Id response header. Quote
17
- # it when contacting support about a failed request.
18
- #
19
- # @return [String]
20
- required :request_id, String
21
-
22
- # @!attribute is_product_page
23
- # Whether the given URL is a product detail page
24
- #
25
- # @return [Boolean, nil]
26
- optional :is_product_page, ContextDev::Internal::Type::Boolean
27
-
28
- # @!attribute key_metadata
29
- # Credit usage, included whenever a valid API key is provided.
30
- #
31
- # @return [ContextDev::Models::AIExtractProductResponse::KeyMetadata, nil]
32
- optional :key_metadata, -> { ContextDev::Models::AIExtractProductResponse::KeyMetadata }
33
-
34
- # @!attribute partial
35
- # True when the timeout ended processing and this response contains only usable
36
- # results completed so far. Unfinished results are omitted.
37
- #
38
- # @return [Boolean, nil]
39
- optional :partial, ContextDev::Internal::Type::Boolean
40
-
41
- # @!attribute platform
42
- # The detected ecommerce platform, or null if not a product page
43
- #
44
- # @return [Symbol, ContextDev::Models::AIExtractProductResponse::Platform, nil]
45
- optional :platform, enum: -> { ContextDev::Models::AIExtractProductResponse::Platform }, nil?: true
46
-
47
- # @!attribute product
48
- # The extracted product data, or null if not a product page
49
- #
50
- # @return [ContextDev::Models::AIExtractProductResponse::Product, nil]
51
- optional :product, -> { ContextDev::Models::AIExtractProductResponse::Product }, nil?: true
52
-
53
- # @!method initialize(cache_metadata:, request_id:, is_product_page: nil, key_metadata: nil, partial: nil, platform: nil, product: nil)
54
- # Some parameter documentations has been truncated, see
55
- # {ContextDev::Models::AIExtractProductResponse} for more details.
56
- #
57
- # @param cache_metadata [ContextDev::Models::AIExtractProductResponse::CacheMetadata] Cache outcome for this response. Composite responses are hits only when every ca
58
- #
59
- # @param request_id [String] Unique id of this API call, also sent in the X-Request-Id response header. Quote
60
- #
61
- # @param is_product_page [Boolean] Whether the given URL is a product detail page
62
- #
63
- # @param key_metadata [ContextDev::Models::AIExtractProductResponse::KeyMetadata] Credit usage, included whenever a valid API key is provided.
64
- #
65
- # @param partial [Boolean] True when the timeout ended processing and this response contains only usable re
66
- #
67
- # @param platform [Symbol, ContextDev::Models::AIExtractProductResponse::Platform, nil] The detected ecommerce platform, or null if not a product page
68
- #
69
- # @param product [ContextDev::Models::AIExtractProductResponse::Product, nil] The extracted product data, or null if not a product page
70
-
71
- # @see ContextDev::Models::AIExtractProductResponse#cache_metadata
72
- class CacheMetadata < ContextDev::Internal::Type::BaseModel
73
- # @!attribute age_ms
74
- # Age of the cached data in milliseconds. Zero for miss and zdr responses.
75
- #
76
- # @return [Integer]
77
- required :age_ms, Integer
78
-
79
- # @!attribute status
80
- # Whether the response was served from cache, required fresh work, or honored
81
- # zero-data-retention cache bypass.
82
- #
83
- # @return [Symbol, ContextDev::Models::AIExtractProductResponse::CacheMetadata::Status]
84
- required :status, enum: -> { ContextDev::Models::AIExtractProductResponse::CacheMetadata::Status }
85
-
86
- # @!method initialize(age_ms:, status:)
87
- # Some parameter documentations has been truncated, see
88
- # {ContextDev::Models::AIExtractProductResponse::CacheMetadata} for more details.
89
- #
90
- # Cache outcome for this response. Composite responses are hits only when every
91
- # cache-controlled fetch contributing to the output was a hit; age_ms is the
92
- # oldest contributing hit.
93
- #
94
- # @param age_ms [Integer] Age of the cached data in milliseconds. Zero for miss and zdr responses.
95
- #
96
- # @param status [Symbol, ContextDev::Models::AIExtractProductResponse::CacheMetadata::Status] Whether the response was served from cache, required fresh work, or honored zero
97
-
98
- # Whether the response was served from cache, required fresh work, or honored
99
- # zero-data-retention cache bypass.
100
- #
101
- # @see ContextDev::Models::AIExtractProductResponse::CacheMetadata#status
102
- module Status
103
- extend ContextDev::Internal::Type::Enum
104
-
105
- HIT = :hit
106
- MISS = :miss
107
- ZDR = :zdr
108
-
109
- # @!method self.values
110
- # @return [Array<Symbol>]
111
- end
112
- end
113
-
114
- # @see ContextDev::Models::AIExtractProductResponse#key_metadata
115
- class KeyMetadata < ContextDev::Internal::Type::BaseModel
116
- # @!attribute credits_consumed
117
- # Credits used by this request.
118
- #
119
- # @return [Integer]
120
- required :credits_consumed, Integer
121
-
122
- # @!attribute credits_remaining
123
- # Credits remaining for your organization.
124
- #
125
- # @return [Integer]
126
- required :credits_remaining, Integer
127
-
128
- # @!method initialize(credits_consumed:, credits_remaining:)
129
- # Credit usage, included whenever a valid API key is provided.
130
- #
131
- # @param credits_consumed [Integer] Credits used by this request.
132
- #
133
- # @param credits_remaining [Integer] Credits remaining for your organization.
134
- end
135
-
136
- # The detected ecommerce platform, or null if not a product page
137
- #
138
- # @see ContextDev::Models::AIExtractProductResponse#platform
139
- module Platform
140
- extend ContextDev::Internal::Type::Enum
141
-
142
- AMAZON = :amazon
143
- TIKTOK_SHOP = :tiktok_shop
144
- ETSY = :etsy
145
- GENERIC = :generic
146
-
147
- # @!method self.values
148
- # @return [Array<Symbol>]
149
- end
150
-
151
- # @see ContextDev::Models::AIExtractProductResponse#product
152
- class Product < ContextDev::Internal::Type::BaseModel
153
- # @!attribute description
154
- # Description of the product
155
- #
156
- # @return [String]
157
- required :description, String
158
-
159
- # @!attribute features
160
- # List of product features
161
- #
162
- # @return [Array<String>]
163
- required :features, ContextDev::Internal::Type::ArrayOf[String]
164
-
165
- # @!attribute images
166
- # URLs to product images on the page (up to 7)
167
- #
168
- # @return [Array<String>]
169
- required :images, ContextDev::Internal::Type::ArrayOf[String]
170
-
171
- # @!attribute name
172
- # Name of the product
173
- #
174
- # @return [String]
175
- required :name, String
176
-
177
- # @!attribute sku
178
- # Stock Keeping Unit (product identifier). Null if no identifier is found.
179
- #
180
- # @return [String, nil]
181
- required :sku, String, nil?: true
182
-
183
- # @!attribute tags
184
- # Tags associated with the product
185
- #
186
- # @return [Array<String>]
187
- required :tags, ContextDev::Internal::Type::ArrayOf[String]
188
-
189
- # @!attribute target_audience
190
- # Target audience for the product (array of strings)
191
- #
192
- # @return [Array<String>]
193
- required :target_audience, ContextDev::Internal::Type::ArrayOf[String]
194
-
195
- # @!attribute availability
196
- # Normalized stock or ordering availability
197
- #
198
- # @return [Symbol, ContextDev::Models::AIExtractProductResponse::Product::Availability, nil]
199
- optional :availability,
200
- enum: -> { ContextDev::Models::AIExtractProductResponse::Product::Availability },
201
- nil?: true
202
-
203
- # @!attribute billing_frequency
204
- # Billing frequency for the product
205
- #
206
- # @return [Symbol, ContextDev::Models::AIExtractProductResponse::Product::BillingFrequency, nil]
207
- optional :billing_frequency,
208
- enum: -> { ContextDev::Models::AIExtractProductResponse::Product::BillingFrequency },
209
- nil?: true
210
-
211
- # @!attribute category
212
- # Category of the product
213
- #
214
- # @return [String, nil]
215
- optional :category, String, nil?: true
216
-
217
- # @!attribute currency
218
- # Currency code for the price (e.g., USD, EUR)
219
- #
220
- # @return [String, nil]
221
- optional :currency, String, nil?: true
222
-
223
- # @!attribute dimensions
224
- # Dimension statements shown for the product, preserving labels, values, and units
225
- #
226
- # @return [Array<String>, nil]
227
- optional :dimensions, ContextDev::Internal::Type::ArrayOf[String]
228
-
229
- # @!attribute image_url
230
- # URL to the product image
231
- #
232
- # @return [String, nil]
233
- optional :image_url, String, nil?: true
234
-
235
- # @!attribute price
236
- # Price of the product
237
- #
238
- # @return [Float, nil]
239
- optional :price, Float, nil?: true
240
-
241
- # @!attribute pricing_model
242
- # Pricing model for the product
243
- #
244
- # @return [Symbol, ContextDev::Models::AIExtractProductResponse::Product::PricingModel, nil]
245
- optional :pricing_model,
246
- enum: -> { ContextDev::Models::AIExtractProductResponse::Product::PricingModel },
247
- nil?: true
248
-
249
- # @!attribute regular_price
250
- # Original or regular price before a displayed discount
251
- #
252
- # @return [Float, nil]
253
- optional :regular_price, Float, nil?: true
254
-
255
- # @!attribute url
256
- # URL to the product page
257
- #
258
- # @return [String, nil]
259
- optional :url, String, nil?: true
260
-
261
- # @!attribute variants
262
- # Product variations, such as different colors or sizes, with their attributes and
263
- # images. Empty if none are found. May not include every variation offered by the
264
- # store.
265
- #
266
- # @return [Array<ContextDev::Models::AIExtractProductResponse::Product::Variant>, nil]
267
- optional :variants,
268
- -> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::AIExtractProductResponse::Product::Variant] }
269
-
270
- # @!method initialize(description:, features:, images:, name:, sku:, tags:, target_audience:, availability: nil, billing_frequency: nil, category: nil, currency: nil, dimensions: nil, image_url: nil, price: nil, pricing_model: nil, regular_price: nil, url: nil, variants: nil)
271
- # Some parameter documentations has been truncated, see
272
- # {ContextDev::Models::AIExtractProductResponse::Product} for more details.
273
- #
274
- # The extracted product data, or null if not a product page
275
- #
276
- # @param description [String] Description of the product
277
- #
278
- # @param features [Array<String>] List of product features
279
- #
280
- # @param images [Array<String>] URLs to product images on the page (up to 7)
281
- #
282
- # @param name [String] Name of the product
283
- #
284
- # @param sku [String, nil] Stock Keeping Unit (product identifier). Null if no identifier is found.
285
- #
286
- # @param tags [Array<String>] Tags associated with the product
287
- #
288
- # @param target_audience [Array<String>] Target audience for the product (array of strings)
289
- #
290
- # @param availability [Symbol, ContextDev::Models::AIExtractProductResponse::Product::Availability, nil] Normalized stock or ordering availability
291
- #
292
- # @param billing_frequency [Symbol, ContextDev::Models::AIExtractProductResponse::Product::BillingFrequency, nil] Billing frequency for the product
293
- #
294
- # @param category [String, nil] Category of the product
295
- #
296
- # @param currency [String, nil] Currency code for the price (e.g., USD, EUR)
297
- #
298
- # @param dimensions [Array<String>] Dimension statements shown for the product, preserving labels, values, and units
299
- #
300
- # @param image_url [String, nil] URL to the product image
301
- #
302
- # @param price [Float, nil] Price of the product
303
- #
304
- # @param pricing_model [Symbol, ContextDev::Models::AIExtractProductResponse::Product::PricingModel, nil] Pricing model for the product
305
- #
306
- # @param regular_price [Float, nil] Original or regular price before a displayed discount
307
- #
308
- # @param url [String, nil] URL to the product page
309
- #
310
- # @param variants [Array<ContextDev::Models::AIExtractProductResponse::Product::Variant>] Product variations, such as different colors or sizes, with their attributes and
311
-
312
- # Normalized stock or ordering availability
313
- #
314
- # @see ContextDev::Models::AIExtractProductResponse::Product#availability
315
- module Availability
316
- extend ContextDev::Internal::Type::Enum
317
-
318
- IN_STOCK = :in_stock
319
- OUT_OF_STOCK = :out_of_stock
320
- LIMITED_AVAILABILITY = :limited_availability
321
- PREORDER = :preorder
322
- BACKORDER = :backorder
323
- MADE_TO_ORDER = :made_to_order
324
- DISCONTINUED = :discontinued
325
-
326
- # @!method self.values
327
- # @return [Array<Symbol>]
328
- end
329
-
330
- # Billing frequency for the product
331
- #
332
- # @see ContextDev::Models::AIExtractProductResponse::Product#billing_frequency
333
- module BillingFrequency
334
- extend ContextDev::Internal::Type::Enum
335
-
336
- MONTHLY = :monthly
337
- YEARLY = :yearly
338
- ONE_TIME = :one_time
339
- USAGE_BASED = :usage_based
340
-
341
- # @!method self.values
342
- # @return [Array<Symbol>]
343
- end
344
-
345
- # Pricing model for the product
346
- #
347
- # @see ContextDev::Models::AIExtractProductResponse::Product#pricing_model
348
- module PricingModel
349
- extend ContextDev::Internal::Type::Enum
350
-
351
- PER_SEAT = :per_seat
352
- FLAT = :flat
353
- TIERED = :tiered
354
- FREEMIUM = :freemium
355
- CUSTOM = :custom
356
-
357
- # @!method self.values
358
- # @return [Array<Symbol>]
359
- end
360
-
361
- class Variant < ContextDev::Internal::Type::BaseModel
362
- # @!attribute attributes
363
- # Explicit variant attributes such as color, size, material, pattern and
364
- # properties declared by page.
365
- #
366
- # @return [Hash{Symbol=>String}]
367
- required :attributes, ContextDev::Internal::Type::HashOf[String]
368
-
369
- # @!attribute images
370
- # Original source image URLs explicitly attached to this variant.
371
- #
372
- # @return [Array<String>]
373
- required :images, ContextDev::Internal::Type::ArrayOf[String]
374
-
375
- # @!attribute sku
376
- #
377
- # @return [String, nil]
378
- required :sku, String, nil?: true
379
-
380
- # @!attribute url
381
- # Variant or offer URL when provided by the source. May be shared by variants.
382
- #
383
- # @return [String, nil]
384
- required :url, String, nil?: true
385
-
386
- # @!method initialize(attributes:, images:, sku:, url:)
387
- # Some parameter documentations has been truncated, see
388
- # {ContextDev::Models::AIExtractProductResponse::Product::Variant} for more
389
- # details.
390
- #
391
- # @param attributes [Hash{Symbol=>String}] Explicit variant attributes such as color, size, material, pattern and propertie
392
- #
393
- # @param images [Array<String>] Original source image URLs explicitly attached to this variant.
394
- #
395
- # @param sku [String, nil]
396
- #
397
- # @param url [String, nil] Variant or offer URL when provided by the source. May be shared by variants.
398
- end
399
- end
400
- end
401
- end
402
- end