context.dev 0.0.2
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 +7 -0
- data/.ignore +2 -0
- data/CHANGELOG.md +10 -0
- data/README.md +244 -0
- data/SECURITY.md +27 -0
- data/lib/context_dev/client.rb +74 -0
- data/lib/context_dev/errors.rb +228 -0
- data/lib/context_dev/file_part.rb +58 -0
- data/lib/context_dev/internal/transport/base_client.rb +573 -0
- data/lib/context_dev/internal/transport/pooled_net_requester.rb +210 -0
- data/lib/context_dev/internal/type/array_of.rb +168 -0
- data/lib/context_dev/internal/type/base_model.rb +531 -0
- data/lib/context_dev/internal/type/base_page.rb +55 -0
- data/lib/context_dev/internal/type/boolean.rb +77 -0
- data/lib/context_dev/internal/type/converter.rb +327 -0
- data/lib/context_dev/internal/type/enum.rb +131 -0
- data/lib/context_dev/internal/type/file_input.rb +111 -0
- data/lib/context_dev/internal/type/hash_of.rb +188 -0
- data/lib/context_dev/internal/type/request_parameters.rb +42 -0
- data/lib/context_dev/internal/type/union.rb +237 -0
- data/lib/context_dev/internal/type/unknown.rb +81 -0
- data/lib/context_dev/internal/util.rb +951 -0
- data/lib/context_dev/internal.rb +20 -0
- data/lib/context_dev/models/brand_ai_product_params.rb +34 -0
- data/lib/context_dev/models/brand_ai_product_response.rb +193 -0
- data/lib/context_dev/models/brand_ai_products_params.rb +94 -0
- data/lib/context_dev/models/brand_ai_products_response.rb +160 -0
- data/lib/context_dev/models/brand_ai_query_params.rb +236 -0
- data/lib/context_dev/models/brand_ai_query_response.rb +98 -0
- data/lib/context_dev/models/brand_fonts_params.rb +36 -0
- data/lib/context_dev/models/brand_fonts_response.rb +100 -0
- data/lib/context_dev/models/brand_identify_from_transaction_params.rb +407 -0
- data/lib/context_dev/models/brand_identify_from_transaction_response.rb +854 -0
- data/lib/context_dev/models/brand_prefetch_by_email_params.rb +37 -0
- data/lib/context_dev/models/brand_prefetch_by_email_response.rb +33 -0
- data/lib/context_dev/models/brand_prefetch_params.rb +35 -0
- data/lib/context_dev/models/brand_prefetch_response.rb +33 -0
- data/lib/context_dev/models/brand_retrieve_by_email_params.rb +116 -0
- data/lib/context_dev/models/brand_retrieve_by_email_response.rb +851 -0
- data/lib/context_dev/models/brand_retrieve_by_isin_params.rb +116 -0
- data/lib/context_dev/models/brand_retrieve_by_isin_response.rb +850 -0
- data/lib/context_dev/models/brand_retrieve_by_name_params.rb +115 -0
- data/lib/context_dev/models/brand_retrieve_by_name_response.rb +850 -0
- data/lib/context_dev/models/brand_retrieve_by_ticker_params.rb +204 -0
- data/lib/context_dev/models/brand_retrieve_by_ticker_response.rb +852 -0
- data/lib/context_dev/models/brand_retrieve_naics_params.rb +54 -0
- data/lib/context_dev/models/brand_retrieve_naics_response.rb +83 -0
- data/lib/context_dev/models/brand_retrieve_params.rb +117 -0
- data/lib/context_dev/models/brand_retrieve_response.rb +850 -0
- data/lib/context_dev/models/brand_retrieve_simplified_params.rb +35 -0
- data/lib/context_dev/models/brand_retrieve_simplified_response.rb +307 -0
- data/lib/context_dev/models/brand_screenshot_params.rb +103 -0
- data/lib/context_dev/models/brand_screenshot_response.rb +64 -0
- data/lib/context_dev/models/brand_styleguide_params.rb +70 -0
- data/lib/context_dev/models/brand_styleguide_response.rb +790 -0
- data/lib/context_dev/models/brand_web_scrape_html_params.rb +22 -0
- data/lib/context_dev/models/brand_web_scrape_html_response.rb +45 -0
- data/lib/context_dev/models/brand_web_scrape_images_params.rb +22 -0
- data/lib/context_dev/models/brand_web_scrape_images_response.rb +111 -0
- data/lib/context_dev/models/brand_web_scrape_md_params.rb +50 -0
- data/lib/context_dev/models/brand_web_scrape_md_response.rb +45 -0
- data/lib/context_dev/models/brand_web_scrape_sitemap_params.rb +26 -0
- data/lib/context_dev/models/brand_web_scrape_sitemap_response.rb +91 -0
- data/lib/context_dev/models.rb +81 -0
- data/lib/context_dev/request_options.rb +77 -0
- data/lib/context_dev/resources/brand.rb +654 -0
- data/lib/context_dev/version.rb +5 -0
- data/lib/context_dev.rb +96 -0
- data/manifest.yaml +17 -0
- data/rbi/context_dev/client.rbi +49 -0
- data/rbi/context_dev/errors.rbi +205 -0
- data/rbi/context_dev/file_part.rbi +37 -0
- data/rbi/context_dev/internal/transport/base_client.rbi +300 -0
- data/rbi/context_dev/internal/transport/pooled_net_requester.rbi +84 -0
- data/rbi/context_dev/internal/type/array_of.rbi +104 -0
- data/rbi/context_dev/internal/type/base_model.rbi +308 -0
- data/rbi/context_dev/internal/type/base_page.rbi +42 -0
- data/rbi/context_dev/internal/type/boolean.rbi +58 -0
- data/rbi/context_dev/internal/type/converter.rbi +216 -0
- data/rbi/context_dev/internal/type/enum.rbi +82 -0
- data/rbi/context_dev/internal/type/file_input.rbi +59 -0
- data/rbi/context_dev/internal/type/hash_of.rbi +104 -0
- data/rbi/context_dev/internal/type/request_parameters.rbi +29 -0
- data/rbi/context_dev/internal/type/union.rbi +128 -0
- data/rbi/context_dev/internal/type/unknown.rbi +58 -0
- data/rbi/context_dev/internal/util.rbi +507 -0
- data/rbi/context_dev/internal.rbi +18 -0
- data/rbi/context_dev/models/brand_ai_product_params.rbi +56 -0
- data/rbi/context_dev/models/brand_ai_product_response.rbi +380 -0
- data/rbi/context_dev/models/brand_ai_products_params.rbi +188 -0
- data/rbi/context_dev/models/brand_ai_products_response.rbi +310 -0
- data/rbi/context_dev/models/brand_ai_query_params.rbi +504 -0
- data/rbi/context_dev/models/brand_ai_query_response.rbi +205 -0
- data/rbi/context_dev/models/brand_fonts_params.rbi +60 -0
- data/rbi/context_dev/models/brand_fonts_response.rbi +147 -0
- data/rbi/context_dev/models/brand_identify_from_transaction_params.rbi +1682 -0
- data/rbi/context_dev/models/brand_identify_from_transaction_response.rbi +2595 -0
- data/rbi/context_dev/models/brand_prefetch_by_email_params.rbi +65 -0
- data/rbi/context_dev/models/brand_prefetch_by_email_response.rbi +57 -0
- data/rbi/context_dev/models/brand_prefetch_params.rbi +58 -0
- data/rbi/context_dev/models/brand_prefetch_response.rbi +57 -0
- data/rbi/context_dev/models/brand_retrieve_by_email_params.rbi +386 -0
- data/rbi/context_dev/models/brand_retrieve_by_email_response.rbi +2591 -0
- data/rbi/context_dev/models/brand_retrieve_by_isin_params.rbi +386 -0
- data/rbi/context_dev/models/brand_retrieve_by_isin_response.rbi +2590 -0
- data/rbi/context_dev/models/brand_retrieve_by_name_params.rbi +384 -0
- data/rbi/context_dev/models/brand_retrieve_by_name_response.rbi +2590 -0
- data/rbi/context_dev/models/brand_retrieve_by_ticker_params.rbi +796 -0
- data/rbi/context_dev/models/brand_retrieve_by_ticker_response.rbi +2592 -0
- data/rbi/context_dev/models/brand_retrieve_naics_params.rbi +89 -0
- data/rbi/context_dev/models/brand_retrieve_naics_response.rbi +190 -0
- data/rbi/context_dev/models/brand_retrieve_params.rbi +382 -0
- data/rbi/context_dev/models/brand_retrieve_response.rbi +2574 -0
- data/rbi/context_dev/models/brand_retrieve_simplified_params.rbi +61 -0
- data/rbi/context_dev/models/brand_retrieve_simplified_response.rbi +763 -0
- data/rbi/context_dev/models/brand_screenshot_params.rbi +225 -0
- data/rbi/context_dev/models/brand_screenshot_response.rbi +135 -0
- data/rbi/context_dev/models/brand_styleguide_params.rbi +139 -0
- data/rbi/context_dev/models/brand_styleguide_response.rbi +1707 -0
- data/rbi/context_dev/models/brand_web_scrape_html_params.rbi +43 -0
- data/rbi/context_dev/models/brand_web_scrape_html_response.rbi +92 -0
- data/rbi/context_dev/models/brand_web_scrape_images_params.rbi +43 -0
- data/rbi/context_dev/models/brand_web_scrape_images_response.rbi +261 -0
- data/rbi/context_dev/models/brand_web_scrape_md_params.rbi +81 -0
- data/rbi/context_dev/models/brand_web_scrape_md_response.rbi +92 -0
- data/rbi/context_dev/models/brand_web_scrape_sitemap_params.rbi +45 -0
- data/rbi/context_dev/models/brand_web_scrape_sitemap_response.rbi +167 -0
- data/rbi/context_dev/models.rbi +45 -0
- data/rbi/context_dev/request_options.rbi +59 -0
- data/rbi/context_dev/resources/brand.rbi +545 -0
- data/rbi/context_dev/version.rbi +5 -0
- data/sig/context_dev/client.rbs +26 -0
- data/sig/context_dev/errors.rbs +117 -0
- data/sig/context_dev/file_part.rbs +21 -0
- data/sig/context_dev/internal/transport/base_client.rbs +133 -0
- data/sig/context_dev/internal/transport/pooled_net_requester.rbs +48 -0
- data/sig/context_dev/internal/type/array_of.rbs +48 -0
- data/sig/context_dev/internal/type/base_model.rbs +102 -0
- data/sig/context_dev/internal/type/base_page.rbs +24 -0
- data/sig/context_dev/internal/type/boolean.rbs +26 -0
- data/sig/context_dev/internal/type/converter.rbs +79 -0
- data/sig/context_dev/internal/type/enum.rbs +32 -0
- data/sig/context_dev/internal/type/file_input.rbs +25 -0
- data/sig/context_dev/internal/type/hash_of.rbs +48 -0
- data/sig/context_dev/internal/type/request_parameters.rbs +19 -0
- data/sig/context_dev/internal/type/union.rbs +52 -0
- data/sig/context_dev/internal/type/unknown.rbs +26 -0
- data/sig/context_dev/internal/util.rbs +195 -0
- data/sig/context_dev/internal.rbs +9 -0
- data/sig/context_dev/models/brand_ai_product_params.rbs +30 -0
- data/sig/context_dev/models/brand_ai_product_response.rbs +149 -0
- data/sig/context_dev/models/brand_ai_products_params.rbs +88 -0
- data/sig/context_dev/models/brand_ai_products_response.rbs +128 -0
- data/sig/context_dev/models/brand_ai_query_params.rbs +218 -0
- data/sig/context_dev/models/brand_ai_query_response.rbs +93 -0
- data/sig/context_dev/models/brand_fonts_params.rbs +30 -0
- data/sig/context_dev/models/brand_fonts_response.rbs +82 -0
- data/sig/context_dev/models/brand_identify_from_transaction_params.rbs +686 -0
- data/sig/context_dev/models/brand_identify_from_transaction_response.rbs +1076 -0
- data/sig/context_dev/models/brand_prefetch_by_email_params.rbs +30 -0
- data/sig/context_dev/models/brand_prefetch_by_email_response.rbs +28 -0
- data/sig/context_dev/models/brand_prefetch_params.rbs +30 -0
- data/sig/context_dev/models/brand_prefetch_response.rbs +28 -0
- data/sig/context_dev/models/brand_retrieve_by_email_params.rbs +162 -0
- data/sig/context_dev/models/brand_retrieve_by_email_response.rbs +1076 -0
- data/sig/context_dev/models/brand_retrieve_by_isin_params.rbs +162 -0
- data/sig/context_dev/models/brand_retrieve_by_isin_response.rbs +1076 -0
- data/sig/context_dev/models/brand_retrieve_by_name_params.rbs +162 -0
- data/sig/context_dev/models/brand_retrieve_by_name_response.rbs +1076 -0
- data/sig/context_dev/models/brand_retrieve_by_ticker_params.rbs +324 -0
- data/sig/context_dev/models/brand_retrieve_by_ticker_response.rbs +1076 -0
- data/sig/context_dev/models/brand_retrieve_naics_params.rbs +47 -0
- data/sig/context_dev/models/brand_retrieve_naics_response.rbs +84 -0
- data/sig/context_dev/models/brand_retrieve_params.rbs +162 -0
- data/sig/context_dev/models/brand_retrieve_response.rbs +1076 -0
- data/sig/context_dev/models/brand_retrieve_simplified_params.rbs +30 -0
- data/sig/context_dev/models/brand_retrieve_simplified_response.rbs +312 -0
- data/sig/context_dev/models/brand_screenshot_params.rbs +100 -0
- data/sig/context_dev/models/brand_screenshot_response.rbs +63 -0
- data/sig/context_dev/models/brand_styleguide_params.rbs +62 -0
- data/sig/context_dev/models/brand_styleguide_response.rbs +945 -0
- data/sig/context_dev/models/brand_web_scrape_html_params.rbs +23 -0
- data/sig/context_dev/models/brand_web_scrape_html_response.rbs +40 -0
- data/sig/context_dev/models/brand_web_scrape_images_params.rbs +23 -0
- data/sig/context_dev/models/brand_web_scrape_images_response.rbs +98 -0
- data/sig/context_dev/models/brand_web_scrape_md_params.rbs +47 -0
- data/sig/context_dev/models/brand_web_scrape_md_response.rbs +40 -0
- data/sig/context_dev/models/brand_web_scrape_sitemap_params.rbs +23 -0
- data/sig/context_dev/models/brand_web_scrape_sitemap_response.rbs +77 -0
- data/sig/context_dev/models.rbs +41 -0
- data/sig/context_dev/request_options.rbs +36 -0
- data/sig/context_dev/resources/brand.rbs +151 -0
- data/sig/context_dev/version.rbs +3 -0
- metadata +265 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module ContextDev
|
|
4
|
+
module Internal
|
|
5
|
+
extend ContextDev::Internal::Util::SorbetRuntimeSupport
|
|
6
|
+
|
|
7
|
+
OMIT =
|
|
8
|
+
Object.new.tap do
|
|
9
|
+
_1.define_singleton_method(:inspect) { "#<#{ContextDev::Internal}::OMIT>" }
|
|
10
|
+
end
|
|
11
|
+
.freeze
|
|
12
|
+
|
|
13
|
+
define_sorbet_constant!(:AnyHash) do
|
|
14
|
+
T.type_alias { T::Hash[Symbol, T.anything] }
|
|
15
|
+
end
|
|
16
|
+
define_sorbet_constant!(:FileInput) do
|
|
17
|
+
T.type_alias { T.any(Pathname, StringIO, IO, String, ContextDev::FilePart) }
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module ContextDev
|
|
4
|
+
module Models
|
|
5
|
+
# @see ContextDev::Resources::Brand#ai_product
|
|
6
|
+
class BrandAIProductParams < 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 timeout_ms
|
|
17
|
+
# Optional timeout in milliseconds for the request. Maximum allowed value is
|
|
18
|
+
# 300000ms (5 minutes).
|
|
19
|
+
#
|
|
20
|
+
# @return [Integer, nil]
|
|
21
|
+
optional :timeout_ms, Integer, api_name: :timeoutMS
|
|
22
|
+
|
|
23
|
+
# @!method initialize(url:, timeout_ms: nil, request_options: {})
|
|
24
|
+
# Some parameter documentations has been truncated, see
|
|
25
|
+
# {ContextDev::Models::BrandAIProductParams} for more details.
|
|
26
|
+
#
|
|
27
|
+
# @param url [String] The product page URL to extract product data from.
|
|
28
|
+
#
|
|
29
|
+
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. Maximum allowed value is 30000
|
|
30
|
+
#
|
|
31
|
+
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module ContextDev
|
|
4
|
+
module Models
|
|
5
|
+
# @see ContextDev::Resources::Brand#ai_product
|
|
6
|
+
class BrandAIProductResponse < ContextDev::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute is_product_page
|
|
8
|
+
# Whether the given URL is a product detail page
|
|
9
|
+
#
|
|
10
|
+
# @return [Boolean, nil]
|
|
11
|
+
optional :is_product_page, ContextDev::Internal::Type::Boolean
|
|
12
|
+
|
|
13
|
+
# @!attribute platform
|
|
14
|
+
# The detected ecommerce platform, or null if not a product page
|
|
15
|
+
#
|
|
16
|
+
# @return [Symbol, ContextDev::Models::BrandAIProductResponse::Platform, nil]
|
|
17
|
+
optional :platform, enum: -> { ContextDev::Models::BrandAIProductResponse::Platform }, nil?: true
|
|
18
|
+
|
|
19
|
+
# @!attribute product
|
|
20
|
+
# The extracted product data, or null if not a product page
|
|
21
|
+
#
|
|
22
|
+
# @return [ContextDev::Models::BrandAIProductResponse::Product, nil]
|
|
23
|
+
optional :product, -> { ContextDev::Models::BrandAIProductResponse::Product }, nil?: true
|
|
24
|
+
|
|
25
|
+
# @!method initialize(is_product_page: nil, platform: nil, product: nil)
|
|
26
|
+
# @param is_product_page [Boolean] Whether the given URL is a product detail page
|
|
27
|
+
#
|
|
28
|
+
# @param platform [Symbol, ContextDev::Models::BrandAIProductResponse::Platform, nil] The detected ecommerce platform, or null if not a product page
|
|
29
|
+
#
|
|
30
|
+
# @param product [ContextDev::Models::BrandAIProductResponse::Product, nil] The extracted product data, or null if not a product page
|
|
31
|
+
|
|
32
|
+
# The detected ecommerce platform, or null if not a product page
|
|
33
|
+
#
|
|
34
|
+
# @see ContextDev::Models::BrandAIProductResponse#platform
|
|
35
|
+
module Platform
|
|
36
|
+
extend ContextDev::Internal::Type::Enum
|
|
37
|
+
|
|
38
|
+
AMAZON = :amazon
|
|
39
|
+
TIKTOK_SHOP = :tiktok_shop
|
|
40
|
+
ETSY = :etsy
|
|
41
|
+
GENERIC = :generic
|
|
42
|
+
|
|
43
|
+
# @!method self.values
|
|
44
|
+
# @return [Array<Symbol>]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# @see ContextDev::Models::BrandAIProductResponse#product
|
|
48
|
+
class Product < ContextDev::Internal::Type::BaseModel
|
|
49
|
+
# @!attribute description
|
|
50
|
+
# Description of the product
|
|
51
|
+
#
|
|
52
|
+
# @return [String]
|
|
53
|
+
required :description, String
|
|
54
|
+
|
|
55
|
+
# @!attribute features
|
|
56
|
+
# List of product features
|
|
57
|
+
#
|
|
58
|
+
# @return [Array<String>]
|
|
59
|
+
required :features, ContextDev::Internal::Type::ArrayOf[String]
|
|
60
|
+
|
|
61
|
+
# @!attribute images
|
|
62
|
+
# URLs to product images on the page (up to 7)
|
|
63
|
+
#
|
|
64
|
+
# @return [Array<String>]
|
|
65
|
+
required :images, ContextDev::Internal::Type::ArrayOf[String]
|
|
66
|
+
|
|
67
|
+
# @!attribute name
|
|
68
|
+
# Name of the product
|
|
69
|
+
#
|
|
70
|
+
# @return [String]
|
|
71
|
+
required :name, String
|
|
72
|
+
|
|
73
|
+
# @!attribute tags
|
|
74
|
+
# Tags associated with the product
|
|
75
|
+
#
|
|
76
|
+
# @return [Array<String>]
|
|
77
|
+
required :tags, ContextDev::Internal::Type::ArrayOf[String]
|
|
78
|
+
|
|
79
|
+
# @!attribute target_audience
|
|
80
|
+
# Target audience for the product (array of strings)
|
|
81
|
+
#
|
|
82
|
+
# @return [Array<String>]
|
|
83
|
+
required :target_audience, ContextDev::Internal::Type::ArrayOf[String]
|
|
84
|
+
|
|
85
|
+
# @!attribute billing_frequency
|
|
86
|
+
# Billing frequency for the product
|
|
87
|
+
#
|
|
88
|
+
# @return [Symbol, ContextDev::Models::BrandAIProductResponse::Product::BillingFrequency, nil]
|
|
89
|
+
optional :billing_frequency,
|
|
90
|
+
enum: -> { ContextDev::Models::BrandAIProductResponse::Product::BillingFrequency },
|
|
91
|
+
nil?: true
|
|
92
|
+
|
|
93
|
+
# @!attribute category
|
|
94
|
+
# Category of the product
|
|
95
|
+
#
|
|
96
|
+
# @return [String, nil]
|
|
97
|
+
optional :category, String, nil?: true
|
|
98
|
+
|
|
99
|
+
# @!attribute currency
|
|
100
|
+
# Currency code for the price (e.g., USD, EUR)
|
|
101
|
+
#
|
|
102
|
+
# @return [String, nil]
|
|
103
|
+
optional :currency, String, nil?: true
|
|
104
|
+
|
|
105
|
+
# @!attribute image_url
|
|
106
|
+
# URL to the product image
|
|
107
|
+
#
|
|
108
|
+
# @return [String, nil]
|
|
109
|
+
optional :image_url, String, nil?: true
|
|
110
|
+
|
|
111
|
+
# @!attribute price
|
|
112
|
+
# Price of the product
|
|
113
|
+
#
|
|
114
|
+
# @return [Float, nil]
|
|
115
|
+
optional :price, Float, nil?: true
|
|
116
|
+
|
|
117
|
+
# @!attribute pricing_model
|
|
118
|
+
# Pricing model for the product
|
|
119
|
+
#
|
|
120
|
+
# @return [Symbol, ContextDev::Models::BrandAIProductResponse::Product::PricingModel, nil]
|
|
121
|
+
optional :pricing_model,
|
|
122
|
+
enum: -> { ContextDev::Models::BrandAIProductResponse::Product::PricingModel },
|
|
123
|
+
nil?: true
|
|
124
|
+
|
|
125
|
+
# @!attribute url
|
|
126
|
+
# URL to the product page
|
|
127
|
+
#
|
|
128
|
+
# @return [String, nil]
|
|
129
|
+
optional :url, String, nil?: true
|
|
130
|
+
|
|
131
|
+
# @!method initialize(description:, features:, images:, name:, tags:, target_audience:, billing_frequency: nil, category: nil, currency: nil, image_url: nil, price: nil, pricing_model: nil, url: nil)
|
|
132
|
+
# The extracted product data, or null if not a product page
|
|
133
|
+
#
|
|
134
|
+
# @param description [String] Description of the product
|
|
135
|
+
#
|
|
136
|
+
# @param features [Array<String>] List of product features
|
|
137
|
+
#
|
|
138
|
+
# @param images [Array<String>] URLs to product images on the page (up to 7)
|
|
139
|
+
#
|
|
140
|
+
# @param name [String] Name of the product
|
|
141
|
+
#
|
|
142
|
+
# @param tags [Array<String>] Tags associated with the product
|
|
143
|
+
#
|
|
144
|
+
# @param target_audience [Array<String>] Target audience for the product (array of strings)
|
|
145
|
+
#
|
|
146
|
+
# @param billing_frequency [Symbol, ContextDev::Models::BrandAIProductResponse::Product::BillingFrequency, nil] Billing frequency for the product
|
|
147
|
+
#
|
|
148
|
+
# @param category [String, nil] Category of the product
|
|
149
|
+
#
|
|
150
|
+
# @param currency [String, nil] Currency code for the price (e.g., USD, EUR)
|
|
151
|
+
#
|
|
152
|
+
# @param image_url [String, nil] URL to the product image
|
|
153
|
+
#
|
|
154
|
+
# @param price [Float, nil] Price of the product
|
|
155
|
+
#
|
|
156
|
+
# @param pricing_model [Symbol, ContextDev::Models::BrandAIProductResponse::Product::PricingModel, nil] Pricing model for the product
|
|
157
|
+
#
|
|
158
|
+
# @param url [String, nil] URL to the product page
|
|
159
|
+
|
|
160
|
+
# Billing frequency for the product
|
|
161
|
+
#
|
|
162
|
+
# @see ContextDev::Models::BrandAIProductResponse::Product#billing_frequency
|
|
163
|
+
module BillingFrequency
|
|
164
|
+
extend ContextDev::Internal::Type::Enum
|
|
165
|
+
|
|
166
|
+
MONTHLY = :monthly
|
|
167
|
+
YEARLY = :yearly
|
|
168
|
+
ONE_TIME = :one_time
|
|
169
|
+
USAGE_BASED = :usage_based
|
|
170
|
+
|
|
171
|
+
# @!method self.values
|
|
172
|
+
# @return [Array<Symbol>]
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Pricing model for the product
|
|
176
|
+
#
|
|
177
|
+
# @see ContextDev::Models::BrandAIProductResponse::Product#pricing_model
|
|
178
|
+
module PricingModel
|
|
179
|
+
extend ContextDev::Internal::Type::Enum
|
|
180
|
+
|
|
181
|
+
PER_SEAT = :per_seat
|
|
182
|
+
FLAT = :flat
|
|
183
|
+
TIERED = :tiered
|
|
184
|
+
FREEMIUM = :freemium
|
|
185
|
+
CUSTOM = :custom
|
|
186
|
+
|
|
187
|
+
# @!method self.values
|
|
188
|
+
# @return [Array<Symbol>]
|
|
189
|
+
end
|
|
190
|
+
end
|
|
191
|
+
end
|
|
192
|
+
end
|
|
193
|
+
end
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module ContextDev
|
|
4
|
+
module Models
|
|
5
|
+
# @see ContextDev::Resources::Brand#ai_products
|
|
6
|
+
class BrandAIProductsParams < ContextDev::Internal::Type::BaseModel
|
|
7
|
+
extend ContextDev::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include ContextDev::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute body
|
|
11
|
+
#
|
|
12
|
+
# @return [ContextDev::Models::BrandAIProductsParams::Body::ByDomain, ContextDev::Models::BrandAIProductsParams::Body::ByDirectURL]
|
|
13
|
+
required :body, union: -> { ContextDev::BrandAIProductsParams::Body }
|
|
14
|
+
|
|
15
|
+
# @!method initialize(body:, request_options: {})
|
|
16
|
+
# @param body [ContextDev::Models::BrandAIProductsParams::Body::ByDomain, ContextDev::Models::BrandAIProductsParams::Body::ByDirectURL]
|
|
17
|
+
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
|
|
18
|
+
|
|
19
|
+
module Body
|
|
20
|
+
extend ContextDev::Internal::Type::Union
|
|
21
|
+
|
|
22
|
+
variant -> { ContextDev::BrandAIProductsParams::Body::ByDomain }
|
|
23
|
+
|
|
24
|
+
variant -> { ContextDev::BrandAIProductsParams::Body::ByDirectURL }
|
|
25
|
+
|
|
26
|
+
class ByDomain < ContextDev::Internal::Type::BaseModel
|
|
27
|
+
# @!attribute domain
|
|
28
|
+
# The domain name to analyze.
|
|
29
|
+
#
|
|
30
|
+
# @return [String]
|
|
31
|
+
required :domain, String
|
|
32
|
+
|
|
33
|
+
# @!attribute max_products
|
|
34
|
+
# Maximum number of products to extract.
|
|
35
|
+
#
|
|
36
|
+
# @return [Integer, nil]
|
|
37
|
+
optional :max_products, Integer, api_name: :maxProducts
|
|
38
|
+
|
|
39
|
+
# @!attribute timeout_ms
|
|
40
|
+
# Optional timeout in milliseconds for the request. Maximum allowed value is
|
|
41
|
+
# 300000ms (5 minutes).
|
|
42
|
+
#
|
|
43
|
+
# @return [Integer, nil]
|
|
44
|
+
optional :timeout_ms, Integer, api_name: :timeoutMS
|
|
45
|
+
|
|
46
|
+
# @!method initialize(domain:, max_products: nil, timeout_ms: nil)
|
|
47
|
+
# Some parameter documentations has been truncated, see
|
|
48
|
+
# {ContextDev::Models::BrandAIProductsParams::Body::ByDomain} for more details.
|
|
49
|
+
#
|
|
50
|
+
# @param domain [String] The domain name to analyze.
|
|
51
|
+
#
|
|
52
|
+
# @param max_products [Integer] Maximum number of products to extract.
|
|
53
|
+
#
|
|
54
|
+
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. Maximum allowed value is 30000
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
class ByDirectURL < ContextDev::Internal::Type::BaseModel
|
|
58
|
+
# @!attribute direct_url
|
|
59
|
+
# A specific URL to use directly as the starting point for extraction without
|
|
60
|
+
# domain resolution.
|
|
61
|
+
#
|
|
62
|
+
# @return [String]
|
|
63
|
+
required :direct_url, String, api_name: :directUrl
|
|
64
|
+
|
|
65
|
+
# @!attribute max_products
|
|
66
|
+
# Maximum number of products to extract.
|
|
67
|
+
#
|
|
68
|
+
# @return [Integer, nil]
|
|
69
|
+
optional :max_products, Integer, api_name: :maxProducts
|
|
70
|
+
|
|
71
|
+
# @!attribute timeout_ms
|
|
72
|
+
# Optional timeout in milliseconds for the request. Maximum allowed value is
|
|
73
|
+
# 300000ms (5 minutes).
|
|
74
|
+
#
|
|
75
|
+
# @return [Integer, nil]
|
|
76
|
+
optional :timeout_ms, Integer, api_name: :timeoutMS
|
|
77
|
+
|
|
78
|
+
# @!method initialize(direct_url:, max_products: nil, timeout_ms: nil)
|
|
79
|
+
# Some parameter documentations has been truncated, see
|
|
80
|
+
# {ContextDev::Models::BrandAIProductsParams::Body::ByDirectURL} for more details.
|
|
81
|
+
#
|
|
82
|
+
# @param direct_url [String] A specific URL to use directly as the starting point for extraction without doma
|
|
83
|
+
#
|
|
84
|
+
# @param max_products [Integer] Maximum number of products to extract.
|
|
85
|
+
#
|
|
86
|
+
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. Maximum allowed value is 30000
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# @!method self.variants
|
|
90
|
+
# @return [Array(ContextDev::Models::BrandAIProductsParams::Body::ByDomain, ContextDev::Models::BrandAIProductsParams::Body::ByDirectURL)]
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module ContextDev
|
|
4
|
+
module Models
|
|
5
|
+
# @see ContextDev::Resources::Brand#ai_products
|
|
6
|
+
class BrandAIProductsResponse < ContextDev::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute products
|
|
8
|
+
# Array of products extracted from the website
|
|
9
|
+
#
|
|
10
|
+
# @return [Array<ContextDev::Models::BrandAIProductsResponse::Product>, nil]
|
|
11
|
+
optional :products,
|
|
12
|
+
-> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::BrandAIProductsResponse::Product] }
|
|
13
|
+
|
|
14
|
+
# @!method initialize(products: nil)
|
|
15
|
+
# @param products [Array<ContextDev::Models::BrandAIProductsResponse::Product>] Array of products extracted from the website
|
|
16
|
+
|
|
17
|
+
class Product < ContextDev::Internal::Type::BaseModel
|
|
18
|
+
# @!attribute description
|
|
19
|
+
# Description of the product
|
|
20
|
+
#
|
|
21
|
+
# @return [String]
|
|
22
|
+
required :description, String
|
|
23
|
+
|
|
24
|
+
# @!attribute features
|
|
25
|
+
# List of product features
|
|
26
|
+
#
|
|
27
|
+
# @return [Array<String>]
|
|
28
|
+
required :features, ContextDev::Internal::Type::ArrayOf[String]
|
|
29
|
+
|
|
30
|
+
# @!attribute images
|
|
31
|
+
# URLs to product images on the page (up to 7)
|
|
32
|
+
#
|
|
33
|
+
# @return [Array<String>]
|
|
34
|
+
required :images, ContextDev::Internal::Type::ArrayOf[String]
|
|
35
|
+
|
|
36
|
+
# @!attribute name
|
|
37
|
+
# Name of the product
|
|
38
|
+
#
|
|
39
|
+
# @return [String]
|
|
40
|
+
required :name, String
|
|
41
|
+
|
|
42
|
+
# @!attribute tags
|
|
43
|
+
# Tags associated with the product
|
|
44
|
+
#
|
|
45
|
+
# @return [Array<String>]
|
|
46
|
+
required :tags, ContextDev::Internal::Type::ArrayOf[String]
|
|
47
|
+
|
|
48
|
+
# @!attribute target_audience
|
|
49
|
+
# Target audience for the product (array of strings)
|
|
50
|
+
#
|
|
51
|
+
# @return [Array<String>]
|
|
52
|
+
required :target_audience, ContextDev::Internal::Type::ArrayOf[String]
|
|
53
|
+
|
|
54
|
+
# @!attribute billing_frequency
|
|
55
|
+
# Billing frequency for the product
|
|
56
|
+
#
|
|
57
|
+
# @return [Symbol, ContextDev::Models::BrandAIProductsResponse::Product::BillingFrequency, nil]
|
|
58
|
+
optional :billing_frequency,
|
|
59
|
+
enum: -> { ContextDev::Models::BrandAIProductsResponse::Product::BillingFrequency },
|
|
60
|
+
nil?: true
|
|
61
|
+
|
|
62
|
+
# @!attribute category
|
|
63
|
+
# Category of the product
|
|
64
|
+
#
|
|
65
|
+
# @return [String, nil]
|
|
66
|
+
optional :category, String, nil?: true
|
|
67
|
+
|
|
68
|
+
# @!attribute currency
|
|
69
|
+
# Currency code for the price (e.g., USD, EUR)
|
|
70
|
+
#
|
|
71
|
+
# @return [String, nil]
|
|
72
|
+
optional :currency, String, nil?: true
|
|
73
|
+
|
|
74
|
+
# @!attribute image_url
|
|
75
|
+
# URL to the product image
|
|
76
|
+
#
|
|
77
|
+
# @return [String, nil]
|
|
78
|
+
optional :image_url, String, nil?: true
|
|
79
|
+
|
|
80
|
+
# @!attribute price
|
|
81
|
+
# Price of the product
|
|
82
|
+
#
|
|
83
|
+
# @return [Float, nil]
|
|
84
|
+
optional :price, Float, nil?: true
|
|
85
|
+
|
|
86
|
+
# @!attribute pricing_model
|
|
87
|
+
# Pricing model for the product
|
|
88
|
+
#
|
|
89
|
+
# @return [Symbol, ContextDev::Models::BrandAIProductsResponse::Product::PricingModel, nil]
|
|
90
|
+
optional :pricing_model,
|
|
91
|
+
enum: -> { ContextDev::Models::BrandAIProductsResponse::Product::PricingModel },
|
|
92
|
+
nil?: true
|
|
93
|
+
|
|
94
|
+
# @!attribute url
|
|
95
|
+
# URL to the product page
|
|
96
|
+
#
|
|
97
|
+
# @return [String, nil]
|
|
98
|
+
optional :url, String, nil?: true
|
|
99
|
+
|
|
100
|
+
# @!method initialize(description:, features:, images:, name:, tags:, target_audience:, billing_frequency: nil, category: nil, currency: nil, image_url: nil, price: nil, pricing_model: nil, url: nil)
|
|
101
|
+
# @param description [String] Description of the product
|
|
102
|
+
#
|
|
103
|
+
# @param features [Array<String>] List of product features
|
|
104
|
+
#
|
|
105
|
+
# @param images [Array<String>] URLs to product images on the page (up to 7)
|
|
106
|
+
#
|
|
107
|
+
# @param name [String] Name of the product
|
|
108
|
+
#
|
|
109
|
+
# @param tags [Array<String>] Tags associated with the product
|
|
110
|
+
#
|
|
111
|
+
# @param target_audience [Array<String>] Target audience for the product (array of strings)
|
|
112
|
+
#
|
|
113
|
+
# @param billing_frequency [Symbol, ContextDev::Models::BrandAIProductsResponse::Product::BillingFrequency, nil] Billing frequency for the product
|
|
114
|
+
#
|
|
115
|
+
# @param category [String, nil] Category of the product
|
|
116
|
+
#
|
|
117
|
+
# @param currency [String, nil] Currency code for the price (e.g., USD, EUR)
|
|
118
|
+
#
|
|
119
|
+
# @param image_url [String, nil] URL to the product image
|
|
120
|
+
#
|
|
121
|
+
# @param price [Float, nil] Price of the product
|
|
122
|
+
#
|
|
123
|
+
# @param pricing_model [Symbol, ContextDev::Models::BrandAIProductsResponse::Product::PricingModel, nil] Pricing model for the product
|
|
124
|
+
#
|
|
125
|
+
# @param url [String, nil] URL to the product page
|
|
126
|
+
|
|
127
|
+
# Billing frequency for the product
|
|
128
|
+
#
|
|
129
|
+
# @see ContextDev::Models::BrandAIProductsResponse::Product#billing_frequency
|
|
130
|
+
module BillingFrequency
|
|
131
|
+
extend ContextDev::Internal::Type::Enum
|
|
132
|
+
|
|
133
|
+
MONTHLY = :monthly
|
|
134
|
+
YEARLY = :yearly
|
|
135
|
+
ONE_TIME = :one_time
|
|
136
|
+
USAGE_BASED = :usage_based
|
|
137
|
+
|
|
138
|
+
# @!method self.values
|
|
139
|
+
# @return [Array<Symbol>]
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Pricing model for the product
|
|
143
|
+
#
|
|
144
|
+
# @see ContextDev::Models::BrandAIProductsResponse::Product#pricing_model
|
|
145
|
+
module PricingModel
|
|
146
|
+
extend ContextDev::Internal::Type::Enum
|
|
147
|
+
|
|
148
|
+
PER_SEAT = :per_seat
|
|
149
|
+
FLAT = :flat
|
|
150
|
+
TIERED = :tiered
|
|
151
|
+
FREEMIUM = :freemium
|
|
152
|
+
CUSTOM = :custom
|
|
153
|
+
|
|
154
|
+
# @!method self.values
|
|
155
|
+
# @return [Array<Symbol>]
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
end
|