Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.23.0"
".": "0.24.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 15
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-10f7ae53f4fe4f2394c22788b648d9db742a178ed41a87beb39de741660e646b.yml
openapi_spec_hash: 9885c47a02677471a38f16dddbad1823
config_hash: 6f10592c7d0c3bafefc1271472283217
configured_endpoints: 16
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-f6fec0ae4fa4572aefa111e660f98f6acfb6149c22cbd413bd3defad6c100478.yml
openapi_spec_hash: a82bf07982eae3814e8a60eb368e0ce5
config_hash: c3aaaa9794dba44d524c06591ab17894
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.24.0 (2026-02-09)

Full Changelog: [v0.23.0...v0.24.0](https://github.com/brand-dot-dev/ruby-sdk/compare/v0.23.0...v0.24.0)

### Features

* **api:** manual updates ([d51dcea](https://github.com/brand-dot-dev/ruby-sdk/commit/d51dcea705ad031b9010a391b7ed3a26c115beab))

## 0.23.0 (2026-02-07)

Full Changelog: [v0.22.0...v0.23.0](https://github.com/brand-dot-dev/ruby-sdk/compare/v0.22.0...v0.23.0)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
brand.dev (0.23.0)
brand.dev (0.24.0)
cgi
connection_pool

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application
<!-- x-release-please-start-version -->

```ruby
gem "brand.dev", "~> 0.23.0"
gem "brand.dev", "~> 0.24.0"
```

<!-- x-release-please-end -->
Expand Down
2 changes: 2 additions & 0 deletions lib/brand_dev.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
require_relative "brand_dev/internal/transport/base_client"
require_relative "brand_dev/internal/transport/pooled_net_requester"
require_relative "brand_dev/client"
require_relative "brand_dev/models/brand_ai_product_params"
require_relative "brand_dev/models/brand_ai_product_response"
require_relative "brand_dev/models/brand_ai_products_params"
require_relative "brand_dev/models/brand_ai_products_response"
require_relative "brand_dev/models/brand_ai_query_params"
Expand Down
2 changes: 2 additions & 0 deletions lib/brand_dev/models.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ module BrandDev
mod.define_sorbet_constant!(const) { T.type_alias { mod.to_sorbet_type } }
end

BrandAIProductParams = BrandDev::Models::BrandAIProductParams

BrandAIProductsParams = BrandDev::Models::BrandAIProductsParams

BrandAIQueryParams = BrandDev::Models::BrandAIQueryParams
Expand Down
34 changes: 34 additions & 0 deletions lib/brand_dev/models/brand_ai_product_params.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# frozen_string_literal: true

module BrandDev
module Models
# @see BrandDev::Resources::Brand#ai_product
class BrandAIProductParams < BrandDev::Internal::Type::BaseModel
extend BrandDev::Internal::Type::RequestParameters::Converter
include BrandDev::Internal::Type::RequestParameters

# @!attribute url
# The product page URL to extract product data from.
#
# @return [String]
required :url, String

# @!attribute timeout_ms
# Optional timeout in milliseconds for the request. Maximum allowed value is
# 300000ms (5 minutes).
#
# @return [Integer, nil]
optional :timeout_ms, Integer, api_name: :timeoutMS

# @!method initialize(url:, timeout_ms: nil, request_options: {})
# Some parameter documentations has been truncated, see
# {BrandDev::Models::BrandAIProductParams} for more details.
#
# @param url [String] The product page URL to extract product data from.
#
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. Maximum allowed value is 30000
#
# @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}]
end
end
end
185 changes: 185 additions & 0 deletions lib/brand_dev/models/brand_ai_product_response.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
# frozen_string_literal: true

module BrandDev
module Models
# @see BrandDev::Resources::Brand#ai_product
class BrandAIProductResponse < BrandDev::Internal::Type::BaseModel
# @!attribute is_product_page
# Whether the given URL is a product detail page
#
# @return [Boolean, nil]
optional :is_product_page, BrandDev::Internal::Type::Boolean

# @!attribute platform
# The detected ecommerce platform, or null if not a product page
#
# @return [Symbol, BrandDev::Models::BrandAIProductResponse::Platform, nil]
optional :platform, enum: -> { BrandDev::Models::BrandAIProductResponse::Platform }, nil?: true

# @!attribute product
# The extracted product data, or null if not a product page
#
# @return [BrandDev::Models::BrandAIProductResponse::Product, nil]
optional :product, -> { BrandDev::Models::BrandAIProductResponse::Product }, nil?: true

# @!method initialize(is_product_page: nil, platform: nil, product: nil)
# @param is_product_page [Boolean] Whether the given URL is a product detail page
#
# @param platform [Symbol, BrandDev::Models::BrandAIProductResponse::Platform, nil] The detected ecommerce platform, or null if not a product page
#
# @param product [BrandDev::Models::BrandAIProductResponse::Product, nil] The extracted product data, or null if not a product page

# The detected ecommerce platform, or null if not a product page
#
# @see BrandDev::Models::BrandAIProductResponse#platform
module Platform
extend BrandDev::Internal::Type::Enum

AMAZON = :amazon
TIKTOK_SHOP = :tiktok_shop
ETSY = :etsy
GENERIC = :generic

# @!method self.values
# @return [Array<Symbol>]
end

# @see BrandDev::Models::BrandAIProductResponse#product
class Product < BrandDev::Internal::Type::BaseModel
# @!attribute description
# Description of the product
#
# @return [String]
required :description, String

# @!attribute features
# List of product features
#
# @return [Array<String>]
required :features, BrandDev::Internal::Type::ArrayOf[String]

# @!attribute name
# Name of the product
#
# @return [String]
required :name, String

# @!attribute tags
# Tags associated with the product
#
# @return [Array<String>]
required :tags, BrandDev::Internal::Type::ArrayOf[String]

# @!attribute target_audience
# Target audience for the product (array of strings)
#
# @return [Array<String>]
required :target_audience, BrandDev::Internal::Type::ArrayOf[String]

# @!attribute billing_frequency
# Billing frequency for the product
#
# @return [Symbol, BrandDev::Models::BrandAIProductResponse::Product::BillingFrequency, nil]
optional :billing_frequency,
enum: -> { BrandDev::Models::BrandAIProductResponse::Product::BillingFrequency },
nil?: true

# @!attribute category
# Category of the product
#
# @return [String, nil]
optional :category, String, nil?: true

# @!attribute currency
# Currency code for the price (e.g., USD, EUR)
#
# @return [String, nil]
optional :currency, String, nil?: true

# @!attribute image_url
# URL to the product image
#
# @return [String, nil]
optional :image_url, String, nil?: true

# @!attribute price
# Price of the product
#
# @return [Float, nil]
optional :price, Float, nil?: true

# @!attribute pricing_model
# Pricing model for the product
#
# @return [Symbol, BrandDev::Models::BrandAIProductResponse::Product::PricingModel, nil]
optional :pricing_model,
enum: -> { BrandDev::Models::BrandAIProductResponse::Product::PricingModel },
nil?: true

# @!attribute url
# URL to the product page
#
# @return [String, nil]
optional :url, String, nil?: true

# @!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)
# The extracted product data, or null if not a product page
#
# @param description [String] Description of the product
#
# @param features [Array<String>] List of product features
#
# @param name [String] Name of the product
#
# @param tags [Array<String>] Tags associated with the product
#
# @param target_audience [Array<String>] Target audience for the product (array of strings)
#
# @param billing_frequency [Symbol, BrandDev::Models::BrandAIProductResponse::Product::BillingFrequency, nil] Billing frequency for the product
#
# @param category [String, nil] Category of the product
#
# @param currency [String, nil] Currency code for the price (e.g., USD, EUR)
#
# @param image_url [String, nil] URL to the product image
#
# @param price [Float, nil] Price of the product
#
# @param pricing_model [Symbol, BrandDev::Models::BrandAIProductResponse::Product::PricingModel, nil] Pricing model for the product
#
# @param url [String, nil] URL to the product page

# Billing frequency for the product
#
# @see BrandDev::Models::BrandAIProductResponse::Product#billing_frequency
module BillingFrequency
extend BrandDev::Internal::Type::Enum

MONTHLY = :monthly
YEARLY = :yearly
ONE_TIME = :one_time
USAGE_BASED = :usage_based

# @!method self.values
# @return [Array<Symbol>]
end

# Pricing model for the product
#
# @see BrandDev::Models::BrandAIProductResponse::Product#pricing_model
module PricingModel
extend BrandDev::Internal::Type::Enum

PER_SEAT = :per_seat
FLAT = :flat
TIERED = :tiered
FREEMIUM = :freemium
CUSTOM = :custom

# @!method self.values
# @return [Array<Symbol>]
end
end
end
end
end
29 changes: 29 additions & 0 deletions lib/brand_dev/resources/brand.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,35 @@ def retrieve(params)
)
end

# Some parameter documentations has been truncated, see
# {BrandDev::Models::BrandAIProductParams} for more details.
#
# Beta feature: Given a single URL, determines if it is a product detail page,
# classifies the platform/product type, and extracts the product information.
# Supports Amazon, TikTok Shop, Etsy, and generic ecommerce sites.
#
# @overload ai_product(url:, timeout_ms: nil, request_options: {})
#
# @param url [String] The product page URL to extract product data from.
#
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. Maximum allowed value is 30000
#
# @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}, nil]
#
# @return [BrandDev::Models::BrandAIProductResponse]
#
# @see BrandDev::Models::BrandAIProductParams
def ai_product(params)
parsed, options = BrandDev::BrandAIProductParams.dump_request(params)
@client.request(
method: :post,
path: "brand/ai/product",
body: parsed,
model: BrandDev::Models::BrandAIProductResponse,
options: options
)
end

# Some parameter documentations has been truncated, see
# {BrandDev::Models::BrandAIProductsParams} for more details.
#
Expand Down
2 changes: 1 addition & 1 deletion lib/brand_dev/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module BrandDev
VERSION = "0.23.0"
VERSION = "0.24.0"
end
2 changes: 2 additions & 0 deletions rbi/brand_dev/models.rbi
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# typed: strong

module BrandDev
BrandAIProductParams = BrandDev::Models::BrandAIProductParams

BrandAIProductsParams = BrandDev::Models::BrandAIProductsParams

BrandAIQueryParams = BrandDev::Models::BrandAIQueryParams
Expand Down
56 changes: 56 additions & 0 deletions rbi/brand_dev/models/brand_ai_product_params.rbi
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# typed: strong

module BrandDev
module Models
class BrandAIProductParams < BrandDev::Internal::Type::BaseModel
extend BrandDev::Internal::Type::RequestParameters::Converter
include BrandDev::Internal::Type::RequestParameters

OrHash =
T.type_alias do
T.any(BrandDev::BrandAIProductParams, BrandDev::Internal::AnyHash)
end

# The product page URL to extract product data from.
sig { returns(String) }
attr_accessor :url

# Optional timeout in milliseconds for the request. Maximum allowed value is
# 300000ms (5 minutes).
sig { returns(T.nilable(Integer)) }
attr_reader :timeout_ms

sig { params(timeout_ms: Integer).void }
attr_writer :timeout_ms

sig do
params(
url: String,
timeout_ms: Integer,
request_options: BrandDev::RequestOptions::OrHash
).returns(T.attached_class)
end
def self.new(
# The product page URL to extract product data from.
url:,
# Optional timeout in milliseconds for the request. Maximum allowed value is
# 300000ms (5 minutes).
timeout_ms: nil,
request_options: {}
)
end

sig do
override.returns(
{
url: String,
timeout_ms: Integer,
request_options: BrandDev::RequestOptions
}
)
end
def to_hash
end
end
end
end
Loading
Loading