Skip to content

Commit 58d3d58

Browse files
feat(api): manual updates
1 parent cf0fc12 commit 58d3d58

15 files changed

Lines changed: 807 additions & 2 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 14
1+
configured_endpoints: 15
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-c45c9faa82a7f8b0b0221deab17a0f6cc6b096906e192aea9ef535e17667008f.yml
33
openapi_spec_hash: f3330c699ed3a55e48cdeecfce379e7b
4-
config_hash: 7f48d078645cb8331328bcd6f6ab3281
4+
config_hash: 6f10592c7d0c3bafefc1271472283217

lib/brand_dev.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252
require_relative "brand_dev/internal/transport/base_client"
5353
require_relative "brand_dev/internal/transport/pooled_net_requester"
5454
require_relative "brand_dev/client"
55+
require_relative "brand_dev/models/brand_ai_products_params"
56+
require_relative "brand_dev/models/brand_ai_products_response"
5557
require_relative "brand_dev/models/brand_ai_query_params"
5658
require_relative "brand_dev/models/brand_ai_query_response"
5759
require_relative "brand_dev/models/brand_fonts_params"

lib/brand_dev/models.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ module BrandDev
3939
mod.define_sorbet_constant!(const) { T.type_alias { mod.to_sorbet_type } }
4040
end
4141

42+
BrandAIProductsParams = BrandDev::Models::BrandAIProductsParams
43+
4244
BrandAIQueryParams = BrandDev::Models::BrandAIQueryParams
4345

4446
BrandFontsParams = BrandDev::Models::BrandFontsParams
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# frozen_string_literal: true
2+
3+
module BrandDev
4+
module Models
5+
# @see BrandDev::Resources::Brand#ai_products
6+
class BrandAIProductsParams < BrandDev::Internal::Type::BaseModel
7+
extend BrandDev::Internal::Type::RequestParameters::Converter
8+
include BrandDev::Internal::Type::RequestParameters
9+
10+
# @!attribute domain
11+
# The domain name to analyze
12+
#
13+
# @return [String]
14+
required :domain, String
15+
16+
# @!attribute max_products
17+
# Maximum number of products to extract.
18+
#
19+
# @return [Integer, nil]
20+
optional :max_products, Integer, api_name: :maxProducts
21+
22+
# @!attribute timeout_ms
23+
# Optional timeout in milliseconds for the request. If the request takes longer
24+
# than this value, it will be aborted with a 408 status code. Maximum allowed
25+
# value is 300000ms (5 minutes).
26+
#
27+
# @return [Integer, nil]
28+
optional :timeout_ms, Integer, api_name: :timeoutMS
29+
30+
# @!method initialize(domain:, max_products: nil, timeout_ms: nil, request_options: {})
31+
# Some parameter documentations has been truncated, see
32+
# {BrandDev::Models::BrandAIProductsParams} for more details.
33+
#
34+
# @param domain [String] The domain name to analyze
35+
#
36+
# @param max_products [Integer] Maximum number of products to extract.
37+
#
38+
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
39+
#
40+
# @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}]
41+
end
42+
end
43+
end
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
# frozen_string_literal: true
2+
3+
module BrandDev
4+
module Models
5+
# @see BrandDev::Resources::Brand#ai_products
6+
class BrandAIProductsResponse < BrandDev::Internal::Type::BaseModel
7+
# @!attribute products
8+
# Array of products extracted from the website
9+
#
10+
# @return [Array<BrandDev::Models::BrandAIProductsResponse::Product>, nil]
11+
optional :products,
12+
-> { BrandDev::Internal::Type::ArrayOf[BrandDev::Models::BrandAIProductsResponse::Product] }
13+
14+
# @!method initialize(products: nil)
15+
# @param products [Array<BrandDev::Models::BrandAIProductsResponse::Product>] Array of products extracted from the website
16+
17+
class Product < BrandDev::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, BrandDev::Internal::Type::ArrayOf[String]
29+
30+
# @!attribute name
31+
# Name of the product
32+
#
33+
# @return [String]
34+
required :name, String
35+
36+
# @!attribute tags
37+
# Tags associated with the product
38+
#
39+
# @return [Array<String>]
40+
required :tags, BrandDev::Internal::Type::ArrayOf[String]
41+
42+
# @!attribute target_audience
43+
# Target audience for the product (array of strings)
44+
#
45+
# @return [Array<String>]
46+
required :target_audience, BrandDev::Internal::Type::ArrayOf[String]
47+
48+
# @!attribute billing_frequency
49+
# Billing frequency for the product
50+
#
51+
# @return [Symbol, BrandDev::Models::BrandAIProductsResponse::Product::BillingFrequency, nil]
52+
optional :billing_frequency,
53+
enum: -> { BrandDev::Models::BrandAIProductsResponse::Product::BillingFrequency },
54+
nil?: true
55+
56+
# @!attribute category
57+
# Category of the product
58+
#
59+
# @return [String, nil]
60+
optional :category, String, nil?: true
61+
62+
# @!attribute currency
63+
# Currency code for the price (e.g., USD, EUR)
64+
#
65+
# @return [String, nil]
66+
optional :currency, String, nil?: true
67+
68+
# @!attribute image_url
69+
# URL to the product image
70+
#
71+
# @return [String, nil]
72+
optional :image_url, String, nil?: true
73+
74+
# @!attribute price
75+
# Price of the product
76+
#
77+
# @return [Float, nil]
78+
optional :price, Float, nil?: true
79+
80+
# @!attribute pricing_model
81+
# Pricing model for the product
82+
#
83+
# @return [Symbol, BrandDev::Models::BrandAIProductsResponse::Product::PricingModel, nil]
84+
optional :pricing_model,
85+
enum: -> { BrandDev::Models::BrandAIProductsResponse::Product::PricingModel },
86+
nil?: true
87+
88+
# @!attribute url
89+
# URL to the product page
90+
#
91+
# @return [String, nil]
92+
optional :url, String, nil?: true
93+
94+
# @!method initialize(description:, features:, name:, tags:, target_audience:, billing_frequency: nil, category: nil, currency: nil, image_url: nil, price: nil, pricing_model: nil, url: nil)
95+
# @param description [String] Description of the product
96+
#
97+
# @param features [Array<String>] List of product features
98+
#
99+
# @param name [String] Name of the product
100+
#
101+
# @param tags [Array<String>] Tags associated with the product
102+
#
103+
# @param target_audience [Array<String>] Target audience for the product (array of strings)
104+
#
105+
# @param billing_frequency [Symbol, BrandDev::Models::BrandAIProductsResponse::Product::BillingFrequency, nil] Billing frequency for the product
106+
#
107+
# @param category [String, nil] Category of the product
108+
#
109+
# @param currency [String, nil] Currency code for the price (e.g., USD, EUR)
110+
#
111+
# @param image_url [String, nil] URL to the product image
112+
#
113+
# @param price [Float, nil] Price of the product
114+
#
115+
# @param pricing_model [Symbol, BrandDev::Models::BrandAIProductsResponse::Product::PricingModel, nil] Pricing model for the product
116+
#
117+
# @param url [String, nil] URL to the product page
118+
119+
# Billing frequency for the product
120+
#
121+
# @see BrandDev::Models::BrandAIProductsResponse::Product#billing_frequency
122+
module BillingFrequency
123+
extend BrandDev::Internal::Type::Enum
124+
125+
MONTHLY = :monthly
126+
YEARLY = :yearly
127+
ONE_TIME = :one_time
128+
USAGE_BASED = :usage_based
129+
130+
# @!method self.values
131+
# @return [Array<Symbol>]
132+
end
133+
134+
# Pricing model for the product
135+
#
136+
# @see BrandDev::Models::BrandAIProductsResponse::Product#pricing_model
137+
module PricingModel
138+
extend BrandDev::Internal::Type::Enum
139+
140+
PER_SEAT = :per_seat
141+
FLAT = :flat
142+
TIERED = :tiered
143+
FREEMIUM = :freemium
144+
CUSTOM = :custom
145+
146+
# @!method self.values
147+
# @return [Array<Symbol>]
148+
end
149+
end
150+
end
151+
end
152+
end

lib/brand_dev/resources/brand.rb

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,37 @@ def retrieve(params = {})
3535
)
3636
end
3737

38+
# Some parameter documentations has been truncated, see
39+
# {BrandDev::Models::BrandAIProductsParams} for more details.
40+
#
41+
# Beta feature: Use AI to extract product information from a brand's website. The
42+
# AI will analyze the website and return a list of products with details such as
43+
# name, description, pricing, features, and more.
44+
#
45+
# @overload ai_products(domain:, max_products: nil, timeout_ms: nil, request_options: {})
46+
#
47+
# @param domain [String] The domain name to analyze
48+
#
49+
# @param max_products [Integer] Maximum number of products to extract.
50+
#
51+
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
52+
#
53+
# @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}, nil]
54+
#
55+
# @return [BrandDev::Models::BrandAIProductsResponse]
56+
#
57+
# @see BrandDev::Models::BrandAIProductsParams
58+
def ai_products(params)
59+
parsed, options = BrandDev::BrandAIProductsParams.dump_request(params)
60+
@client.request(
61+
method: :post,
62+
path: "brand/ai/products",
63+
body: parsed,
64+
model: BrandDev::Models::BrandAIProductsResponse,
65+
options: options
66+
)
67+
end
68+
3869
# Some parameter documentations has been truncated, see
3970
# {BrandDev::Models::BrandAIQueryParams} for more details.
4071
#

rbi/brand_dev/models.rbi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# typed: strong
22

33
module BrandDev
4+
BrandAIProductsParams = BrandDev::Models::BrandAIProductsParams
5+
46
BrandAIQueryParams = BrandDev::Models::BrandAIQueryParams
57

68
BrandFontsParams = BrandDev::Models::BrandFontsParams
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# typed: strong
2+
3+
module BrandDev
4+
module Models
5+
class BrandAIProductsParams < BrandDev::Internal::Type::BaseModel
6+
extend BrandDev::Internal::Type::RequestParameters::Converter
7+
include BrandDev::Internal::Type::RequestParameters
8+
9+
OrHash =
10+
T.type_alias do
11+
T.any(BrandDev::BrandAIProductsParams, BrandDev::Internal::AnyHash)
12+
end
13+
14+
# The domain name to analyze
15+
sig { returns(String) }
16+
attr_accessor :domain
17+
18+
# Maximum number of products to extract.
19+
sig { returns(T.nilable(Integer)) }
20+
attr_reader :max_products
21+
22+
sig { params(max_products: Integer).void }
23+
attr_writer :max_products
24+
25+
# Optional timeout in milliseconds for the request. If the request takes longer
26+
# than this value, it will be aborted with a 408 status code. Maximum allowed
27+
# value is 300000ms (5 minutes).
28+
sig { returns(T.nilable(Integer)) }
29+
attr_reader :timeout_ms
30+
31+
sig { params(timeout_ms: Integer).void }
32+
attr_writer :timeout_ms
33+
34+
sig do
35+
params(
36+
domain: String,
37+
max_products: Integer,
38+
timeout_ms: Integer,
39+
request_options: BrandDev::RequestOptions::OrHash
40+
).returns(T.attached_class)
41+
end
42+
def self.new(
43+
# The domain name to analyze
44+
domain:,
45+
# Maximum number of products to extract.
46+
max_products: nil,
47+
# Optional timeout in milliseconds for the request. If the request takes longer
48+
# than this value, it will be aborted with a 408 status code. Maximum allowed
49+
# value is 300000ms (5 minutes).
50+
timeout_ms: nil,
51+
request_options: {}
52+
)
53+
end
54+
55+
sig do
56+
override.returns(
57+
{
58+
domain: String,
59+
max_products: Integer,
60+
timeout_ms: Integer,
61+
request_options: BrandDev::RequestOptions
62+
}
63+
)
64+
end
65+
def to_hash
66+
end
67+
end
68+
end
69+
end

0 commit comments

Comments
 (0)