brand.dev 0.28.0 → 0.28.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b08a446d47e44525b19b98dc2de388bdf629936ee50d29b07744acab598cd8e6
4
- data.tar.gz: 16fdf55175d7e06c83536fd5646d925a5c2cc5440d1f5802a2c41506b9dbfe4e
3
+ metadata.gz: 627fe92d0bc7ddf8f90668f8fea94981c87b86f44e07050a3bb502f3e8448a28
4
+ data.tar.gz: 5438f2a94d3e45e69ce0705e3014f57a81d3d8be04b691b7fbbee2df654aa650
5
5
  SHA512:
6
- metadata.gz: e6aa9372e2f6b43828750f4313eae61bd4429a7412dac53a4f5002bfbad900419b7ec91397b275148d4d6d2e56b1ee74e92334ed40178c51ffd80f5429c124a4
7
- data.tar.gz: adf3ff257d6656ddc5d3232678a1d807b3a4c5fe386e5f28ad71ec388c65bc5868d315c93400a597b5794fa731f10cf23cb0fbcb6c7d5e8787516a0b941b1cc0
6
+ metadata.gz: 3a0f9f9a79e2bc86585a334051744d31f9c28b2ecd13e99829aee645721a73e3d01a722d0d6254962c817e89ad9a30a85c5e18bc0908491805e0649928df9205
7
+ data.tar.gz: 2e4605272ec70e7a65eb6b6be89b3337bbb1b6fc10daac89d730f23e544177b9352f49f187b3dbc7f3d3d7f1bd440f14ddf96f14cdbe31b4aab144a21b13395a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.28.1 (2026-03-06)
4
+
5
+ Full Changelog: [v0.28.0...v0.28.1](https://github.com/brand-dot-dev/ruby-sdk/compare/v0.28.0...v0.28.1)
6
+
7
+ ### Chores
8
+
9
+ * **ci:** add build step ([b2d8fd1](https://github.com/brand-dot-dev/ruby-sdk/commit/b2d8fd1f17caeda7ab95d69ba33f7ad2a4848f55))
10
+ * **internal:** codegen related update ([f199738](https://github.com/brand-dot-dev/ruby-sdk/commit/f199738e587d42fef1acb3891f4ef9e71f365f6b))
11
+ * **internal:** codegen related update ([e55e75e](https://github.com/brand-dot-dev/ruby-sdk/commit/e55e75ed640d0deacbc1503eca4e12eb4e6c4131))
12
+
3
13
  ## 0.28.0 (2026-03-01)
4
14
 
5
15
  Full Changelog: [v0.27.0...v0.28.0](https://github.com/brand-dot-dev/ruby-sdk/compare/v0.27.0...v0.28.0)
data/README.md CHANGED
@@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application
26
26
  <!-- x-release-please-start-version -->
27
27
 
28
28
  ```ruby
29
- gem "brand.dev", "~> 0.28.0"
29
+ gem "brand.dev", "~> 0.28.1"
30
30
  ```
31
31
 
32
32
  <!-- x-release-please-end -->
@@ -490,6 +490,37 @@ module BrandDev
490
490
  JSONL_CONTENT = %r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}
491
491
 
492
492
  class << self
493
+ # @api private
494
+ #
495
+ # @param query [Hash{Symbol=>Object}]
496
+ #
497
+ # @return [Hash{Symbol=>Object}]
498
+ def encode_query_params(query)
499
+ out = {}
500
+ query.each { write_query_param_element!(out, _1, _2) }
501
+ out
502
+ end
503
+
504
+ # @api private
505
+ #
506
+ # @param collection [Hash{Symbol=>Object}]
507
+ # @param key [String]
508
+ # @param element [Object]
509
+ #
510
+ # @return [nil]
511
+ private def write_query_param_element!(collection, key, element)
512
+ case element
513
+ in Hash
514
+ element.each do |name, value|
515
+ write_query_param_element!(collection, "#{key}[#{name}]", value)
516
+ end
517
+ in Array
518
+ collection[key] = element.map(&:to_s).join(",")
519
+ else
520
+ collection[key] = element.to_s
521
+ end
522
+ end
523
+
493
524
  # @api private
494
525
  #
495
526
  # @param y [Enumerator::Yielder]
@@ -7,45 +7,88 @@ module BrandDev
7
7
  extend BrandDev::Internal::Type::RequestParameters::Converter
8
8
  include BrandDev::Internal::Type::RequestParameters
9
9
 
10
- # @!attribute domain
11
- # The domain name to analyze.
10
+ # @!attribute body
12
11
  #
13
- # @return [String]
14
- required :domain, String
12
+ # @return [BrandDev::Models::BrandAIProductsParams::Body::ByDomain, BrandDev::Models::BrandAIProductsParams::Body::ByDirectURL]
13
+ required :body, union: -> { BrandDev::BrandAIProductsParams::Body }
15
14
 
16
- # @!attribute max_products
17
- # Maximum number of products to extract.
18
- #
19
- # @return [Integer, nil]
20
- optional :max_products, Integer, api_name: :maxProducts
15
+ # @!method initialize(body:, request_options: {})
16
+ # @param body [BrandDev::Models::BrandAIProductsParams::Body::ByDomain, BrandDev::Models::BrandAIProductsParams::Body::ByDirectURL]
17
+ # @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}]
21
18
 
22
- # @!attribute timeout_ms
23
- # Optional timeout in milliseconds for the request. Maximum allowed value is
24
- # 300000ms (5 minutes).
25
- #
26
- # @return [Integer, nil]
27
- optional :timeout_ms, Integer, api_name: :timeoutMS
19
+ module Body
20
+ extend BrandDev::Internal::Type::Union
28
21
 
29
- # @!attribute direct_url
30
- # A specific URL to use directly as the starting point for extraction without
31
- # domain resolution.
32
- #
33
- # @return [String]
34
- required :direct_url, String, api_name: :directUrl
22
+ variant -> { BrandDev::BrandAIProductsParams::Body::ByDomain }
35
23
 
36
- # @!method initialize(domain:, direct_url:, max_products: nil, timeout_ms: nil, request_options: {})
37
- # Some parameter documentations has been truncated, see
38
- # {BrandDev::Models::BrandAIProductsParams} for more details.
39
- #
40
- # @param domain [String] The domain name to analyze.
41
- #
42
- # @param direct_url [String] A specific URL to use directly as the starting point for extraction without doma
43
- #
44
- # @param max_products [Integer] Maximum number of products to extract.
45
- #
46
- # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. Maximum allowed value is 30000
47
- #
48
- # @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}]
24
+ variant -> { BrandDev::BrandAIProductsParams::Body::ByDirectURL }
25
+
26
+ class ByDomain < BrandDev::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
+ # {BrandDev::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 < BrandDev::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
+ # {BrandDev::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(BrandDev::Models::BrandAIProductsParams::Body::ByDomain, BrandDev::Models::BrandAIProductsParams::Body::ByDirectURL)]
91
+ end
49
92
  end
50
93
  end
51
94
  end
@@ -26,10 +26,11 @@ module BrandDev
26
26
  # @see BrandDev::Models::BrandRetrieveParams
27
27
  def retrieve(params)
28
28
  parsed, options = BrandDev::BrandRetrieveParams.dump_request(params)
29
+ query = BrandDev::Internal::Util.encode_query_params(parsed)
29
30
  @client.request(
30
31
  method: :get,
31
32
  path: "brand/retrieve",
32
- query: parsed.transform_keys(max_speed: "maxSpeed", timeout_ms: "timeoutMS"),
33
+ query: query.transform_keys(max_speed: "maxSpeed", timeout_ms: "timeoutMS"),
33
34
  model: BrandDev::Models::BrandRetrieveResponse,
34
35
  options: options
35
36
  )
@@ -64,23 +65,13 @@ module BrandDev
64
65
  )
65
66
  end
66
67
 
67
- # Some parameter documentations has been truncated, see
68
- # {BrandDev::Models::BrandAIProductsParams} for more details.
69
- #
70
68
  # Beta feature: Extract product information from a brand's website. Brand.dev will
71
69
  # analyze the website and return a list of products with details such as name,
72
70
  # description, image, pricing, features, and more.
73
71
  #
74
- # @overload ai_products(domain:, direct_url:, max_products: nil, timeout_ms: nil, request_options: {})
75
- #
76
- # @param domain [String] The domain name to analyze.
77
- #
78
- # @param direct_url [String] A specific URL to use directly as the starting point for extraction without doma
79
- #
80
- # @param max_products [Integer] Maximum number of products to extract.
81
- #
82
- # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. Maximum allowed value is 30000
72
+ # @overload ai_products(body:, request_options: {})
83
73
  #
74
+ # @param body [BrandDev::Models::BrandAIProductsParams::Body::ByDomain, BrandDev::Models::BrandAIProductsParams::Body::ByDirectURL]
84
75
  # @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}, nil]
85
76
  #
86
77
  # @return [BrandDev::Models::BrandAIProductsResponse]
@@ -91,7 +82,7 @@ module BrandDev
91
82
  @client.request(
92
83
  method: :post,
93
84
  path: "brand/ai/products",
94
- body: parsed,
85
+ body: parsed[:body],
95
86
  model: BrandDev::Models::BrandAIProductsResponse,
96
87
  options: options
97
88
  )
@@ -149,10 +140,11 @@ module BrandDev
149
140
  # @see BrandDev::Models::BrandFontsParams
150
141
  def fonts(params)
151
142
  parsed, options = BrandDev::BrandFontsParams.dump_request(params)
143
+ query = BrandDev::Internal::Util.encode_query_params(parsed)
152
144
  @client.request(
153
145
  method: :get,
154
146
  path: "brand/fonts",
155
- query: parsed.transform_keys(timeout_ms: "timeoutMS"),
147
+ query: query.transform_keys(timeout_ms: "timeoutMS"),
156
148
  model: BrandDev::Models::BrandFontsResponse,
157
149
  options: options
158
150
  )
@@ -191,10 +183,11 @@ module BrandDev
191
183
  # @see BrandDev::Models::BrandIdentifyFromTransactionParams
192
184
  def identify_from_transaction(params)
193
185
  parsed, options = BrandDev::BrandIdentifyFromTransactionParams.dump_request(params)
186
+ query = BrandDev::Internal::Util.encode_query_params(parsed)
194
187
  @client.request(
195
188
  method: :get,
196
189
  path: "brand/transaction_identifier",
197
- query: parsed.transform_keys(max_speed: "maxSpeed", timeout_ms: "timeoutMS"),
190
+ query: query.transform_keys(max_speed: "maxSpeed", timeout_ms: "timeoutMS"),
198
191
  model: BrandDev::Models::BrandIdentifyFromTransactionResponse,
199
192
  options: options
200
193
  )
@@ -287,10 +280,11 @@ module BrandDev
287
280
  # @see BrandDev::Models::BrandRetrieveByEmailParams
288
281
  def retrieve_by_email(params)
289
282
  parsed, options = BrandDev::BrandRetrieveByEmailParams.dump_request(params)
283
+ query = BrandDev::Internal::Util.encode_query_params(parsed)
290
284
  @client.request(
291
285
  method: :get,
292
286
  path: "brand/retrieve-by-email",
293
- query: parsed.transform_keys(max_speed: "maxSpeed", timeout_ms: "timeoutMS"),
287
+ query: query.transform_keys(max_speed: "maxSpeed", timeout_ms: "timeoutMS"),
294
288
  model: BrandDev::Models::BrandRetrieveByEmailResponse,
295
289
  options: options
296
290
  )
@@ -320,10 +314,11 @@ module BrandDev
320
314
  # @see BrandDev::Models::BrandRetrieveByIsinParams
321
315
  def retrieve_by_isin(params)
322
316
  parsed, options = BrandDev::BrandRetrieveByIsinParams.dump_request(params)
317
+ query = BrandDev::Internal::Util.encode_query_params(parsed)
323
318
  @client.request(
324
319
  method: :get,
325
320
  path: "brand/retrieve-by-isin",
326
- query: parsed.transform_keys(max_speed: "maxSpeed", timeout_ms: "timeoutMS"),
321
+ query: query.transform_keys(max_speed: "maxSpeed", timeout_ms: "timeoutMS"),
327
322
  model: BrandDev::Models::BrandRetrieveByIsinResponse,
328
323
  options: options
329
324
  )
@@ -352,10 +347,11 @@ module BrandDev
352
347
  # @see BrandDev::Models::BrandRetrieveByNameParams
353
348
  def retrieve_by_name(params)
354
349
  parsed, options = BrandDev::BrandRetrieveByNameParams.dump_request(params)
350
+ query = BrandDev::Internal::Util.encode_query_params(parsed)
355
351
  @client.request(
356
352
  method: :get,
357
353
  path: "brand/retrieve-by-name",
358
- query: parsed.transform_keys(max_speed: "maxSpeed", timeout_ms: "timeoutMS"),
354
+ query: query.transform_keys(max_speed: "maxSpeed", timeout_ms: "timeoutMS"),
359
355
  model: BrandDev::Models::BrandRetrieveByNameResponse,
360
356
  options: options
361
357
  )
@@ -386,10 +382,11 @@ module BrandDev
386
382
  # @see BrandDev::Models::BrandRetrieveByTickerParams
387
383
  def retrieve_by_ticker(params)
388
384
  parsed, options = BrandDev::BrandRetrieveByTickerParams.dump_request(params)
385
+ query = BrandDev::Internal::Util.encode_query_params(parsed)
389
386
  @client.request(
390
387
  method: :get,
391
388
  path: "brand/retrieve-by-ticker",
392
- query: parsed.transform_keys(max_speed: "maxSpeed", timeout_ms: "timeoutMS"),
389
+ query: query.transform_keys(max_speed: "maxSpeed", timeout_ms: "timeoutMS"),
393
390
  model: BrandDev::Models::BrandRetrieveByTickerResponse,
394
391
  options: options
395
392
  )
@@ -417,10 +414,11 @@ module BrandDev
417
414
  # @see BrandDev::Models::BrandRetrieveNaicsParams
418
415
  def retrieve_naics(params)
419
416
  parsed, options = BrandDev::BrandRetrieveNaicsParams.dump_request(params)
417
+ query = BrandDev::Internal::Util.encode_query_params(parsed)
420
418
  @client.request(
421
419
  method: :get,
422
420
  path: "brand/naics",
423
- query: parsed.transform_keys(
421
+ query: query.transform_keys(
424
422
  max_results: "maxResults",
425
423
  min_results: "minResults",
426
424
  timeout_ms: "timeoutMS"
@@ -450,10 +448,11 @@ module BrandDev
450
448
  # @see BrandDev::Models::BrandRetrieveSimplifiedParams
451
449
  def retrieve_simplified(params)
452
450
  parsed, options = BrandDev::BrandRetrieveSimplifiedParams.dump_request(params)
451
+ query = BrandDev::Internal::Util.encode_query_params(parsed)
453
452
  @client.request(
454
453
  method: :get,
455
454
  path: "brand/retrieve-simplified",
456
- query: parsed.transform_keys(timeout_ms: "timeoutMS"),
455
+ query: query.transform_keys(timeout_ms: "timeoutMS"),
457
456
  model: BrandDev::Models::BrandRetrieveSimplifiedResponse,
458
457
  options: options
459
458
  )
@@ -484,10 +483,11 @@ module BrandDev
484
483
  # @see BrandDev::Models::BrandScreenshotParams
485
484
  def screenshot(params)
486
485
  parsed, options = BrandDev::BrandScreenshotParams.dump_request(params)
486
+ query = BrandDev::Internal::Util.encode_query_params(parsed)
487
487
  @client.request(
488
488
  method: :get,
489
489
  path: "brand/screenshot",
490
- query: parsed.transform_keys(full_screenshot: "fullScreenshot"),
490
+ query: query.transform_keys(full_screenshot: "fullScreenshot"),
491
491
  model: BrandDev::Models::BrandScreenshotResponse,
492
492
  options: options
493
493
  )
@@ -518,10 +518,11 @@ module BrandDev
518
518
  # @see BrandDev::Models::BrandStyleguideParams
519
519
  def styleguide(params = {})
520
520
  parsed, options = BrandDev::BrandStyleguideParams.dump_request(params)
521
+ query = BrandDev::Internal::Util.encode_query_params(parsed)
521
522
  @client.request(
522
523
  method: :get,
523
524
  path: "brand/styleguide",
524
- query: parsed.transform_keys(direct_url: "directUrl", timeout_ms: "timeoutMS"),
525
+ query: query.transform_keys(direct_url: "directUrl", timeout_ms: "timeoutMS"),
525
526
  model: BrandDev::Models::BrandStyleguideResponse,
526
527
  options: options
527
528
  )
@@ -541,10 +542,11 @@ module BrandDev
541
542
  # @see BrandDev::Models::BrandWebScrapeHTMLParams
542
543
  def web_scrape_html(params)
543
544
  parsed, options = BrandDev::BrandWebScrapeHTMLParams.dump_request(params)
545
+ query = BrandDev::Internal::Util.encode_query_params(parsed)
544
546
  @client.request(
545
547
  method: :get,
546
548
  path: "web/scrape/html",
547
- query: parsed,
549
+ query: query,
548
550
  model: BrandDev::Models::BrandWebScrapeHTMLResponse,
549
551
  options: options
550
552
  )
@@ -565,10 +567,11 @@ module BrandDev
565
567
  # @see BrandDev::Models::BrandWebScrapeImagesParams
566
568
  def web_scrape_images(params)
567
569
  parsed, options = BrandDev::BrandWebScrapeImagesParams.dump_request(params)
570
+ query = BrandDev::Internal::Util.encode_query_params(parsed)
568
571
  @client.request(
569
572
  method: :get,
570
573
  path: "web/scrape/images",
571
- query: parsed,
574
+ query: query,
572
575
  model: BrandDev::Models::BrandWebScrapeImagesResponse,
573
576
  options: options
574
577
  )
@@ -598,10 +601,11 @@ module BrandDev
598
601
  # @see BrandDev::Models::BrandWebScrapeMdParams
599
602
  def web_scrape_md(params)
600
603
  parsed, options = BrandDev::BrandWebScrapeMdParams.dump_request(params)
604
+ query = BrandDev::Internal::Util.encode_query_params(parsed)
601
605
  @client.request(
602
606
  method: :get,
603
607
  path: "web/scrape/markdown",
604
- query: parsed.transform_keys(
608
+ query: query.transform_keys(
605
609
  include_images: "includeImages",
606
610
  include_links: "includeLinks",
607
611
  shorten_base64_images: "shortenBase64Images"
@@ -629,10 +633,11 @@ module BrandDev
629
633
  # @see BrandDev::Models::BrandWebScrapeSitemapParams
630
634
  def web_scrape_sitemap(params)
631
635
  parsed, options = BrandDev::BrandWebScrapeSitemapParams.dump_request(params)
636
+ query = BrandDev::Internal::Util.encode_query_params(parsed)
632
637
  @client.request(
633
638
  method: :get,
634
639
  path: "web/scrape/sitemap",
635
- query: parsed,
640
+ query: query,
636
641
  model: BrandDev::Models::BrandWebScrapeSitemapResponse,
637
642
  options: options
638
643
  )
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BrandDev
4
- VERSION = "0.28.0"
4
+ VERSION = "0.28.1"
5
5
  end
@@ -301,6 +301,26 @@ module BrandDev
301
301
  T.let(%r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}, Regexp)
302
302
 
303
303
  class << self
304
+ # @api private
305
+ sig do
306
+ params(query: BrandDev::Internal::AnyHash).returns(
307
+ BrandDev::Internal::AnyHash
308
+ )
309
+ end
310
+ def encode_query_params(query)
311
+ end
312
+
313
+ # @api private
314
+ sig do
315
+ params(
316
+ collection: BrandDev::Internal::AnyHash,
317
+ key: String,
318
+ element: T.anything
319
+ ).void
320
+ end
321
+ private def write_query_param_element!(collection, key, element)
322
+ end
323
+
304
324
  # @api private
305
325
  sig do
306
326
  params(
@@ -11,67 +11,175 @@ module BrandDev
11
11
  T.any(BrandDev::BrandAIProductsParams, BrandDev::Internal::AnyHash)
12
12
  end
13
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. Maximum allowed value is
26
- # 300000ms (5 minutes).
27
- sig { returns(T.nilable(Integer)) }
28
- attr_reader :timeout_ms
29
-
30
- sig { params(timeout_ms: Integer).void }
31
- attr_writer :timeout_ms
32
-
33
- # A specific URL to use directly as the starting point for extraction without
34
- # domain resolution.
35
- sig { returns(String) }
36
- attr_accessor :direct_url
14
+ sig do
15
+ returns(
16
+ T.any(
17
+ BrandDev::BrandAIProductsParams::Body::ByDomain,
18
+ BrandDev::BrandAIProductsParams::Body::ByDirectURL
19
+ )
20
+ )
21
+ end
22
+ attr_accessor :body
37
23
 
38
24
  sig do
39
25
  params(
40
- domain: String,
41
- direct_url: String,
42
- max_products: Integer,
43
- timeout_ms: Integer,
26
+ body:
27
+ T.any(
28
+ BrandDev::BrandAIProductsParams::Body::ByDomain::OrHash,
29
+ BrandDev::BrandAIProductsParams::Body::ByDirectURL::OrHash
30
+ ),
44
31
  request_options: BrandDev::RequestOptions::OrHash
45
32
  ).returns(T.attached_class)
46
33
  end
47
- def self.new(
48
- # The domain name to analyze.
49
- domain:,
50
- # A specific URL to use directly as the starting point for extraction without
51
- # domain resolution.
52
- direct_url:,
53
- # Maximum number of products to extract.
54
- max_products: nil,
55
- # Optional timeout in milliseconds for the request. Maximum allowed value is
56
- # 300000ms (5 minutes).
57
- timeout_ms: nil,
58
- request_options: {}
59
- )
34
+ def self.new(body:, request_options: {})
60
35
  end
61
36
 
62
37
  sig do
63
38
  override.returns(
64
39
  {
65
- domain: String,
66
- max_products: Integer,
67
- timeout_ms: Integer,
68
- direct_url: String,
40
+ body:
41
+ T.any(
42
+ BrandDev::BrandAIProductsParams::Body::ByDomain,
43
+ BrandDev::BrandAIProductsParams::Body::ByDirectURL
44
+ ),
69
45
  request_options: BrandDev::RequestOptions
70
46
  }
71
47
  )
72
48
  end
73
49
  def to_hash
74
50
  end
51
+
52
+ module Body
53
+ extend BrandDev::Internal::Type::Union
54
+
55
+ Variants =
56
+ T.type_alias do
57
+ T.any(
58
+ BrandDev::BrandAIProductsParams::Body::ByDomain,
59
+ BrandDev::BrandAIProductsParams::Body::ByDirectURL
60
+ )
61
+ end
62
+
63
+ class ByDomain < BrandDev::Internal::Type::BaseModel
64
+ OrHash =
65
+ T.type_alias do
66
+ T.any(
67
+ BrandDev::BrandAIProductsParams::Body::ByDomain,
68
+ BrandDev::Internal::AnyHash
69
+ )
70
+ end
71
+
72
+ # The domain name to analyze.
73
+ sig { returns(String) }
74
+ attr_accessor :domain
75
+
76
+ # Maximum number of products to extract.
77
+ sig { returns(T.nilable(Integer)) }
78
+ attr_reader :max_products
79
+
80
+ sig { params(max_products: Integer).void }
81
+ attr_writer :max_products
82
+
83
+ # Optional timeout in milliseconds for the request. Maximum allowed value is
84
+ # 300000ms (5 minutes).
85
+ sig { returns(T.nilable(Integer)) }
86
+ attr_reader :timeout_ms
87
+
88
+ sig { params(timeout_ms: Integer).void }
89
+ attr_writer :timeout_ms
90
+
91
+ sig do
92
+ params(
93
+ domain: String,
94
+ max_products: Integer,
95
+ timeout_ms: Integer
96
+ ).returns(T.attached_class)
97
+ end
98
+ def self.new(
99
+ # The domain name to analyze.
100
+ domain:,
101
+ # Maximum number of products to extract.
102
+ max_products: nil,
103
+ # Optional timeout in milliseconds for the request. Maximum allowed value is
104
+ # 300000ms (5 minutes).
105
+ timeout_ms: nil
106
+ )
107
+ end
108
+
109
+ sig do
110
+ override.returns(
111
+ { domain: String, max_products: Integer, timeout_ms: Integer }
112
+ )
113
+ end
114
+ def to_hash
115
+ end
116
+ end
117
+
118
+ class ByDirectURL < BrandDev::Internal::Type::BaseModel
119
+ OrHash =
120
+ T.type_alias do
121
+ T.any(
122
+ BrandDev::BrandAIProductsParams::Body::ByDirectURL,
123
+ BrandDev::Internal::AnyHash
124
+ )
125
+ end
126
+
127
+ # A specific URL to use directly as the starting point for extraction without
128
+ # domain resolution.
129
+ sig { returns(String) }
130
+ attr_accessor :direct_url
131
+
132
+ # Maximum number of products to extract.
133
+ sig { returns(T.nilable(Integer)) }
134
+ attr_reader :max_products
135
+
136
+ sig { params(max_products: Integer).void }
137
+ attr_writer :max_products
138
+
139
+ # Optional timeout in milliseconds for the request. Maximum allowed value is
140
+ # 300000ms (5 minutes).
141
+ sig { returns(T.nilable(Integer)) }
142
+ attr_reader :timeout_ms
143
+
144
+ sig { params(timeout_ms: Integer).void }
145
+ attr_writer :timeout_ms
146
+
147
+ sig do
148
+ params(
149
+ direct_url: String,
150
+ max_products: Integer,
151
+ timeout_ms: Integer
152
+ ).returns(T.attached_class)
153
+ end
154
+ def self.new(
155
+ # A specific URL to use directly as the starting point for extraction without
156
+ # domain resolution.
157
+ direct_url:,
158
+ # Maximum number of products to extract.
159
+ max_products: nil,
160
+ # Optional timeout in milliseconds for the request. Maximum allowed value is
161
+ # 300000ms (5 minutes).
162
+ timeout_ms: nil
163
+ )
164
+ end
165
+
166
+ sig do
167
+ override.returns(
168
+ { direct_url: String, max_products: Integer, timeout_ms: Integer }
169
+ )
170
+ end
171
+ def to_hash
172
+ end
173
+ end
174
+
175
+ sig do
176
+ override.returns(
177
+ T::Array[BrandDev::BrandAIProductsParams::Body::Variants]
178
+ )
179
+ end
180
+ def self.variants
181
+ end
182
+ end
75
183
  end
76
184
  end
77
185
  end
@@ -59,26 +59,15 @@ module BrandDev
59
59
  # description, image, pricing, features, and more.
60
60
  sig do
61
61
  params(
62
- domain: String,
63
- direct_url: String,
64
- max_products: Integer,
65
- timeout_ms: Integer,
62
+ body:
63
+ T.any(
64
+ BrandDev::BrandAIProductsParams::Body::ByDomain::OrHash,
65
+ BrandDev::BrandAIProductsParams::Body::ByDirectURL::OrHash
66
+ ),
66
67
  request_options: BrandDev::RequestOptions::OrHash
67
68
  ).returns(BrandDev::Models::BrandAIProductsResponse)
68
69
  end
69
- def ai_products(
70
- # The domain name to analyze.
71
- domain:,
72
- # A specific URL to use directly as the starting point for extraction without
73
- # domain resolution.
74
- direct_url:,
75
- # Maximum number of products to extract.
76
- max_products: nil,
77
- # Optional timeout in milliseconds for the request. Maximum allowed value is
78
- # 300000ms (5 minutes).
79
- timeout_ms: nil,
80
- request_options: {}
81
- )
70
+ def ai_products(body:, request_options: {})
82
71
  end
83
72
 
84
73
  # Use AI to extract specific data points from a brand's website. The AI will crawl
@@ -106,6 +106,16 @@ module BrandDev
106
106
  JSON_CONTENT: Regexp
107
107
  JSONL_CONTENT: Regexp
108
108
 
109
+ def encode_query_params: (
110
+ ::Hash[Symbol, top] query
111
+ ) -> ::Hash[Symbol, top]
112
+
113
+ private def write_query_param_element!: (
114
+ ::Hash[Symbol, top] collection,
115
+ String key,
116
+ top element
117
+ ) -> nil
118
+
109
119
  def self?.write_multipart_content: (
110
120
  Enumerator::Yielder y,
111
121
  val: top,
@@ -1,45 +1,88 @@
1
1
  module BrandDev
2
2
  module Models
3
3
  type brand_ai_products_params =
4
- {
5
- domain: String,
6
- max_products: Integer,
7
- timeout_ms: Integer,
8
- direct_url: String
9
- }
4
+ { body: BrandDev::Models::BrandAIProductsParams::body }
10
5
  & BrandDev::Internal::Type::request_parameters
11
6
 
12
7
  class BrandAIProductsParams < BrandDev::Internal::Type::BaseModel
13
8
  extend BrandDev::Internal::Type::RequestParameters::Converter
14
9
  include BrandDev::Internal::Type::RequestParameters
15
10
 
16
- attr_accessor domain: String
17
-
18
- attr_reader max_products: Integer?
19
-
20
- def max_products=: (Integer) -> Integer
21
-
22
- attr_reader timeout_ms: Integer?
23
-
24
- def timeout_ms=: (Integer) -> Integer
25
-
26
- attr_accessor direct_url: String
11
+ attr_accessor body: BrandDev::Models::BrandAIProductsParams::body
27
12
 
28
13
  def initialize: (
29
- domain: String,
30
- direct_url: String,
31
- ?max_products: Integer,
32
- ?timeout_ms: Integer,
14
+ body: BrandDev::Models::BrandAIProductsParams::body,
33
15
  ?request_options: BrandDev::request_opts
34
16
  ) -> void
35
17
 
36
18
  def to_hash: -> {
37
- domain: String,
38
- max_products: Integer,
39
- timeout_ms: Integer,
40
- direct_url: String,
19
+ body: BrandDev::Models::BrandAIProductsParams::body,
41
20
  request_options: BrandDev::RequestOptions
42
21
  }
22
+
23
+ type body =
24
+ BrandDev::BrandAIProductsParams::Body::ByDomain
25
+ | BrandDev::BrandAIProductsParams::Body::ByDirectURL
26
+
27
+ module Body
28
+ extend BrandDev::Internal::Type::Union
29
+
30
+ type by_domain =
31
+ { domain: String, max_products: Integer, timeout_ms: Integer }
32
+
33
+ class ByDomain < BrandDev::Internal::Type::BaseModel
34
+ attr_accessor domain: String
35
+
36
+ attr_reader max_products: Integer?
37
+
38
+ def max_products=: (Integer) -> Integer
39
+
40
+ attr_reader timeout_ms: Integer?
41
+
42
+ def timeout_ms=: (Integer) -> Integer
43
+
44
+ def initialize: (
45
+ domain: String,
46
+ ?max_products: Integer,
47
+ ?timeout_ms: Integer
48
+ ) -> void
49
+
50
+ def to_hash: -> {
51
+ domain: String,
52
+ max_products: Integer,
53
+ timeout_ms: Integer
54
+ }
55
+ end
56
+
57
+ type by_direct_url =
58
+ { direct_url: String, max_products: Integer, timeout_ms: Integer }
59
+
60
+ class ByDirectURL < BrandDev::Internal::Type::BaseModel
61
+ attr_accessor direct_url: String
62
+
63
+ attr_reader max_products: Integer?
64
+
65
+ def max_products=: (Integer) -> Integer
66
+
67
+ attr_reader timeout_ms: Integer?
68
+
69
+ def timeout_ms=: (Integer) -> Integer
70
+
71
+ def initialize: (
72
+ direct_url: String,
73
+ ?max_products: Integer,
74
+ ?timeout_ms: Integer
75
+ ) -> void
76
+
77
+ def to_hash: -> {
78
+ direct_url: String,
79
+ max_products: Integer,
80
+ timeout_ms: Integer
81
+ }
82
+ end
83
+
84
+ def self?.variants: -> ::Array[BrandDev::Models::BrandAIProductsParams::body]
85
+ end
43
86
  end
44
87
  end
45
88
  end
@@ -16,10 +16,7 @@ module BrandDev
16
16
  ) -> BrandDev::Models::BrandAIProductResponse
17
17
 
18
18
  def ai_products: (
19
- domain: String,
20
- direct_url: String,
21
- ?max_products: Integer,
22
- ?timeout_ms: Integer,
19
+ body: BrandDev::Models::BrandAIProductsParams::body,
23
20
  ?request_options: BrandDev::request_opts
24
21
  ) -> BrandDev::Models::BrandAIProductsResponse
25
22
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brand.dev
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.28.0
4
+ version: 0.28.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brand Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-03-02 00:00:00.000000000 Z
11
+ date: 2026-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cgi