Skip to content

Commit f61453c

Browse files
feat(api): api update
1 parent 3739920 commit f61453c

File tree

8 files changed

+80
-23
lines changed

8 files changed

+80
-23
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 15
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-737dbedd830e2c989387e90a9bb5baa3915306ecfef2e46b09d02cb1879f043c.yml
3-
openapi_spec_hash: 7bc21f4c6d5fd39c1a3b22626846ca87
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-73562e26b663cf10185b9e98966accf5f151c6d3cf99b5e060ce5a847045e383.yml
3+
openapi_spec_hash: bf5994966b84f9dda998ad5059ff8318
44
config_hash: 6f10592c7d0c3bafefc1271472283217

lib/brand_dev/models/brand_ai_products_params.rb

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,21 @@ class BrandAIProductsParams < BrandDev::Internal::Type::BaseModel
77
extend BrandDev::Internal::Type::RequestParameters::Converter
88
include BrandDev::Internal::Type::RequestParameters
99

10+
# @!attribute direct_url
11+
# A specific URL to use directly as the starting point for extraction without
12+
# domain resolution. Useful when you want to extract products from a specific page
13+
# rather than discovering the site's product pages automatically. Either 'domain'
14+
# or 'directUrl' must be provided, but not both.
15+
#
16+
# @return [String, nil]
17+
optional :direct_url, String, api_name: :directUrl
18+
1019
# @!attribute domain
11-
# The domain name to analyze
20+
# The domain name to analyze. Either 'domain' or 'directUrl' must be provided, but
21+
# not both.
1222
#
13-
# @return [String]
14-
required :domain, String
23+
# @return [String, nil]
24+
optional :domain, String
1525

1626
# @!attribute max_products
1727
# Maximum number of products to extract.
@@ -27,11 +37,13 @@ class BrandAIProductsParams < BrandDev::Internal::Type::BaseModel
2737
# @return [Integer, nil]
2838
optional :timeout_ms, Integer, api_name: :timeoutMS
2939

30-
# @!method initialize(domain:, max_products: nil, timeout_ms: nil, request_options: {})
40+
# @!method initialize(direct_url: nil, domain: nil, max_products: nil, timeout_ms: nil, request_options: {})
3141
# Some parameter documentations has been truncated, see
3242
# {BrandDev::Models::BrandAIProductsParams} for more details.
3343
#
34-
# @param domain [String] The domain name to analyze
44+
# @param direct_url [String] A specific URL to use directly as the starting point for extraction without doma
45+
#
46+
# @param domain [String] The domain name to analyze. Either 'domain' or 'directUrl' must be provided, but
3547
#
3648
# @param max_products [Integer] Maximum number of products to extract.
3749
#

lib/brand_dev/resources/brand.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ def retrieve(params)
4242
# analyze the website and return a list of products with details such as name,
4343
# description, image, pricing, features, and more.
4444
#
45-
# @overload ai_products(domain:, max_products: nil, timeout_ms: nil, request_options: {})
45+
# @overload ai_products(direct_url: nil, domain: nil, max_products: nil, timeout_ms: nil, request_options: {})
4646
#
47-
# @param domain [String] The domain name to analyze
47+
# @param direct_url [String] A specific URL to use directly as the starting point for extraction without doma
48+
#
49+
# @param domain [String] The domain name to analyze. Either 'domain' or 'directUrl' must be provided, but
4850
#
4951
# @param max_products [Integer] Maximum number of products to extract.
5052
#
@@ -55,7 +57,7 @@ def retrieve(params)
5557
# @return [BrandDev::Models::BrandAIProductsResponse]
5658
#
5759
# @see BrandDev::Models::BrandAIProductsParams
58-
def ai_products(params)
60+
def ai_products(params = {})
5961
parsed, options = BrandDev::BrandAIProductsParams.dump_request(params)
6062
@client.request(
6163
method: :post,

rbi/brand_dev/models/brand_ai_products_params.rbi

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,23 @@ module BrandDev
1111
T.any(BrandDev::BrandAIProductsParams, BrandDev::Internal::AnyHash)
1212
end
1313

14-
# The domain name to analyze
15-
sig { returns(String) }
16-
attr_accessor :domain
14+
# A specific URL to use directly as the starting point for extraction without
15+
# domain resolution. Useful when you want to extract products from a specific page
16+
# rather than discovering the site's product pages automatically. Either 'domain'
17+
# or 'directUrl' must be provided, but not both.
18+
sig { returns(T.nilable(String)) }
19+
attr_reader :direct_url
20+
21+
sig { params(direct_url: String).void }
22+
attr_writer :direct_url
23+
24+
# The domain name to analyze. Either 'domain' or 'directUrl' must be provided, but
25+
# not both.
26+
sig { returns(T.nilable(String)) }
27+
attr_reader :domain
28+
29+
sig { params(domain: String).void }
30+
attr_writer :domain
1731

1832
# Maximum number of products to extract.
1933
sig { returns(T.nilable(Integer)) }
@@ -33,15 +47,22 @@ module BrandDev
3347

3448
sig do
3549
params(
50+
direct_url: String,
3651
domain: String,
3752
max_products: Integer,
3853
timeout_ms: Integer,
3954
request_options: BrandDev::RequestOptions::OrHash
4055
).returns(T.attached_class)
4156
end
4257
def self.new(
43-
# The domain name to analyze
44-
domain:,
58+
# A specific URL to use directly as the starting point for extraction without
59+
# domain resolution. Useful when you want to extract products from a specific page
60+
# rather than discovering the site's product pages automatically. Either 'domain'
61+
# or 'directUrl' must be provided, but not both.
62+
direct_url: nil,
63+
# The domain name to analyze. Either 'domain' or 'directUrl' must be provided, but
64+
# not both.
65+
domain: nil,
4566
# Maximum number of products to extract.
4667
max_products: nil,
4768
# Optional timeout in milliseconds for the request. If the request takes longer
@@ -55,6 +76,7 @@ module BrandDev
5576
sig do
5677
override.returns(
5778
{
79+
direct_url: String,
5880
domain: String,
5981
max_products: Integer,
6082
timeout_ms: Integer,

rbi/brand_dev/resources/brand.rbi

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,22 @@ module BrandDev
3939
# description, image, pricing, features, and more.
4040
sig do
4141
params(
42+
direct_url: String,
4243
domain: String,
4344
max_products: Integer,
4445
timeout_ms: Integer,
4546
request_options: BrandDev::RequestOptions::OrHash
4647
).returns(BrandDev::Models::BrandAIProductsResponse)
4748
end
4849
def ai_products(
49-
# The domain name to analyze
50-
domain:,
50+
# A specific URL to use directly as the starting point for extraction without
51+
# domain resolution. Useful when you want to extract products from a specific page
52+
# rather than discovering the site's product pages automatically. Either 'domain'
53+
# or 'directUrl' must be provided, but not both.
54+
direct_url: nil,
55+
# The domain name to analyze. Either 'domain' or 'directUrl' must be provided, but
56+
# not both.
57+
domain: nil,
5158
# Maximum number of products to extract.
5259
max_products: nil,
5360
# Optional timeout in milliseconds for the request. If the request takes longer

sig/brand_dev/models/brand_ai_products_params.rbs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
module BrandDev
22
module Models
33
type brand_ai_products_params =
4-
{ domain: String, max_products: Integer, timeout_ms: Integer }
4+
{
5+
direct_url: String,
6+
domain: String,
7+
max_products: Integer,
8+
timeout_ms: Integer
9+
}
510
& BrandDev::Internal::Type::request_parameters
611

712
class BrandAIProductsParams < BrandDev::Internal::Type::BaseModel
813
extend BrandDev::Internal::Type::RequestParameters::Converter
914
include BrandDev::Internal::Type::RequestParameters
1015

11-
attr_accessor domain: String
16+
attr_reader direct_url: String?
17+
18+
def direct_url=: (String) -> String
19+
20+
attr_reader domain: String?
21+
22+
def domain=: (String) -> String
1223

1324
attr_reader max_products: Integer?
1425

@@ -19,13 +30,15 @@ module BrandDev
1930
def timeout_ms=: (Integer) -> Integer
2031

2132
def initialize: (
22-
domain: String,
33+
?direct_url: String,
34+
?domain: String,
2335
?max_products: Integer,
2436
?timeout_ms: Integer,
2537
?request_options: BrandDev::request_opts
2638
) -> void
2739

2840
def to_hash: -> {
41+
direct_url: String,
2942
domain: String,
3043
max_products: Integer,
3144
timeout_ms: Integer,

sig/brand_dev/resources/brand.rbs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ module BrandDev
1010
) -> BrandDev::Models::BrandRetrieveResponse
1111

1212
def ai_products: (
13-
domain: String,
13+
?direct_url: String,
14+
?domain: String,
1415
?max_products: Integer,
1516
?timeout_ms: Integer,
1617
?request_options: BrandDev::request_opts

test/brand_dev/resources/brand_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ def test_retrieve_required_params
2121
end
2222
end
2323

24-
def test_ai_products_required_params
24+
def test_ai_products
2525
skip("Prism tests are disabled")
2626

27-
response = @brand_dev.brand.ai_products(domain: "domain")
27+
response = @brand_dev.brand.ai_products
2828

2929
assert_pattern do
3030
response => BrandDev::Models::BrandAIProductsResponse

0 commit comments

Comments
 (0)