brand.dev 0.17.0 → 0.19.0

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: a38e5450f3f8c92da4c4e057bf22ec7c6ec9710eead156874795337c310e8587
4
- data.tar.gz: 1bf79e20cc59c58c2894211d677b1a8d575f13d8ceb33f2a4deb01cb35307219
3
+ metadata.gz: 5236e2be3cfd4c0d76d750b1cf8763549794d34ce485d269b65f28e86c264e1a
4
+ data.tar.gz: 2eca5ea736c10ded4bf560f2312c89122f2755e879fc9b4f3dabe68c45da8b5f
5
5
  SHA512:
6
- metadata.gz: 445911c7f8627497f5483988b6bbdef4dabddc4b568064469fc50cbc5696e110027994545bc7b1efc0c705789ddc9a0f46d12b6ac429bf9e9d21e5bfb621d2ba
7
- data.tar.gz: 61ae52cd48a35461a8153a5465e84d11587143c8843e3fb44d2a41582080da42847dd2196743a1c7528ec6f4b1a8efb84523f38b1c8fa97daaadc0b2abd14443
6
+ metadata.gz: 483f164eedf7a9ff9fa29cd607998493be1f611f400c4332f6b6d744788bc0b0b597a65f347fe0b51885117b202c6b546dfd5e7c415ba8a8059166302f259618
7
+ data.tar.gz: ec67429f2dc1d6c6807daef902ae95ae214e959b7e80d326b762946f506f61e132d3d8f59084d8819be03ea38a5b0b78e2d929c0665b4a49aef611e9e8af0aac
data/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.19.0 (2025-12-22)
4
+
5
+ Full Changelog: [v0.18.0...v0.19.0](https://github.com/brand-dot-dev/ruby-sdk/compare/v0.18.0...v0.19.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** manual updates ([eb518d4](https://github.com/brand-dot-dev/ruby-sdk/commit/eb518d4ef48fa91039cf54e2ccdc0b9261770268))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * calling `break` out of streams should be instantaneous ([df6f134](https://github.com/brand-dot-dev/ruby-sdk/commit/df6f1348f710b76e3fe4d0b604bb1e98472143d6))
15
+ * issue where json.parse errors when receiving HTTP 204 with nobody ([f041e46](https://github.com/brand-dot-dev/ruby-sdk/commit/f041e461d2fd1b711b63cd11a909a1b44e50247c))
16
+
17
+ ## 0.18.0 (2025-12-14)
18
+
19
+ Full Changelog: [v0.17.0...v0.18.0](https://github.com/brand-dot-dev/ruby-sdk/compare/v0.17.0...v0.18.0)
20
+
21
+ ### Features
22
+
23
+ * **api:** api update ([25b73b8](https://github.com/brand-dot-dev/ruby-sdk/commit/25b73b89b739804f3dbb1d189fbde0351184dcaa))
24
+
3
25
  ## 0.17.0 (2025-12-11)
4
26
 
5
27
  Full Changelog: [v0.16.0...v0.17.0](https://github.com/brand-dot-dev/ruby-sdk/compare/v0.16.0...v0.17.0)
data/README.md CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "brand.dev", "~> 0.17.0"
20
+ gem "brand.dev", "~> 0.19.0"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -153,17 +153,19 @@ module BrandDev
153
153
  end
154
154
 
155
155
  self.class.calibrate_socket_timeout(conn, deadline)
156
- conn.request(req) do |rsp|
157
- y << [req, rsp]
158
- break if finished
159
-
160
- rsp.read_body do |bytes|
161
- y << bytes.force_encoding(Encoding::BINARY)
162
- break if finished
163
-
164
- self.class.calibrate_socket_timeout(conn, deadline)
156
+ ::Kernel.catch(:jump) do
157
+ conn.request(req) do |rsp|
158
+ y << [req, rsp]
159
+ ::Kernel.throw(:jump) if finished
160
+
161
+ rsp.read_body do |bytes|
162
+ y << bytes.force_encoding(Encoding::BINARY)
163
+ ::Kernel.throw(:jump) if finished
164
+
165
+ self.class.calibrate_socket_timeout(conn, deadline)
166
+ end
167
+ eof = true
165
168
  end
166
- eof = true
167
169
  end
168
170
  end
169
171
  ensure
@@ -657,7 +657,8 @@ module BrandDev
657
657
  def decode_content(headers, stream:, suppress_error: false)
658
658
  case (content_type = headers["content-type"])
659
659
  in BrandDev::Internal::Util::JSON_CONTENT
660
- json = stream.to_a.join
660
+ return nil if (json = stream.to_a.join).empty?
661
+
661
662
  begin
662
663
  JSON.parse(json, symbolize_names: true)
663
664
  rescue JSON::ParserError => e
@@ -667,7 +668,11 @@ module BrandDev
667
668
  in BrandDev::Internal::Util::JSONL_CONTENT
668
669
  lines = decode_lines(stream)
669
670
  chain_fused(lines) do |y|
670
- lines.each { y << JSON.parse(_1, symbolize_names: true) }
671
+ lines.each do
672
+ next if _1.empty?
673
+
674
+ y << JSON.parse(_1, symbolize_names: true)
675
+ end
671
676
  end
672
677
  in %r{^text/event-stream}
673
678
  lines = decode_lines(stream)
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BrandDev
4
+ module Models
5
+ # @see BrandDev::Resources::Brand#prefetch_by_email
6
+ class BrandPrefetchByEmailParams < BrandDev::Internal::Type::BaseModel
7
+ extend BrandDev::Internal::Type::RequestParameters::Converter
8
+ include BrandDev::Internal::Type::RequestParameters
9
+
10
+ # @!attribute email
11
+ # Email address to prefetch brand data for. The domain will be extracted from the
12
+ # email. Free email providers (gmail.com, yahoo.com, etc.) and disposable email
13
+ # addresses are not allowed.
14
+ #
15
+ # @return [String]
16
+ required :email, String
17
+
18
+ # @!attribute timeout_ms
19
+ # Optional timeout in milliseconds for the request. If the request takes longer
20
+ # than this value, it will be aborted with a 408 status code. Maximum allowed
21
+ # value is 300000ms (5 minutes).
22
+ #
23
+ # @return [Integer, nil]
24
+ optional :timeout_ms, Integer, api_name: :timeoutMS
25
+
26
+ # @!method initialize(email:, timeout_ms: nil, request_options: {})
27
+ # Some parameter documentations has been truncated, see
28
+ # {BrandDev::Models::BrandPrefetchByEmailParams} for more details.
29
+ #
30
+ # @param email [String] Email address to prefetch brand data for. The domain will be extracted from the
31
+ #
32
+ # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
33
+ #
34
+ # @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}]
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BrandDev
4
+ module Models
5
+ # @see BrandDev::Resources::Brand#prefetch_by_email
6
+ class BrandPrefetchByEmailResponse < BrandDev::Internal::Type::BaseModel
7
+ # @!attribute domain
8
+ # The domain that was queued for prefetching
9
+ #
10
+ # @return [String, nil]
11
+ optional :domain, String
12
+
13
+ # @!attribute message
14
+ # Success message
15
+ #
16
+ # @return [String, nil]
17
+ optional :message, String
18
+
19
+ # @!attribute status
20
+ # Status of the response, e.g., 'ok'
21
+ #
22
+ # @return [String, nil]
23
+ optional :status, String
24
+
25
+ # @!method initialize(domain: nil, message: nil, status: nil)
26
+ # @param domain [String] The domain that was queued for prefetching
27
+ #
28
+ # @param message [String] Success message
29
+ #
30
+ # @param status [String] Status of the response, e.g., 'ok'
31
+ end
32
+ end
33
+ end
@@ -15,6 +15,19 @@ module BrandDev
15
15
  # @return [String]
16
16
  required :input, String
17
17
 
18
+ # @!attribute max_results
19
+ # Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults
20
+ # to 5.
21
+ #
22
+ # @return [Integer, nil]
23
+ optional :max_results, Integer
24
+
25
+ # @!attribute min_results
26
+ # Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1.
27
+ #
28
+ # @return [Integer, nil]
29
+ optional :min_results, Integer
30
+
18
31
  # @!attribute timeout_ms
19
32
  # Optional timeout in milliseconds for the request. If the request takes longer
20
33
  # than this value, it will be aborted with a 408 status code. Maximum allowed
@@ -23,12 +36,16 @@ module BrandDev
23
36
  # @return [Integer, nil]
24
37
  optional :timeout_ms, Integer
25
38
 
26
- # @!method initialize(input:, timeout_ms: nil, request_options: {})
39
+ # @!method initialize(input:, max_results: nil, min_results: nil, timeout_ms: nil, request_options: {})
27
40
  # Some parameter documentations has been truncated, see
28
41
  # {BrandDev::Models::BrandRetrieveNaicsParams} for more details.
29
42
  #
30
43
  # @param input [String] Brand domain or title to retrieve NAICS code for. If a valid domain is provided
31
44
  #
45
+ # @param max_results [Integer] Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults to 5
46
+ #
47
+ # @param min_results [Integer] Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1.
48
+ #
32
49
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
33
50
  #
34
51
  # @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}]
@@ -42,19 +42,41 @@ module BrandDev
42
42
  # @!attribute code
43
43
  # NAICS code
44
44
  #
45
- # @return [String, nil]
46
- optional :code, String
45
+ # @return [String]
46
+ required :code, String
47
47
 
48
- # @!attribute title
48
+ # @!attribute confidence
49
+ # Confidence level for how well this NAICS code matches the company description
50
+ #
51
+ # @return [Symbol, BrandDev::Models::BrandRetrieveNaicsResponse::Code::Confidence]
52
+ required :confidence, enum: -> { BrandDev::Models::BrandRetrieveNaicsResponse::Code::Confidence }
53
+
54
+ # @!attribute name
49
55
  # NAICS title
50
56
  #
51
- # @return [String, nil]
52
- optional :title, String
57
+ # @return [String]
58
+ required :name, String
53
59
 
54
- # @!method initialize(code: nil, title: nil)
60
+ # @!method initialize(code:, confidence:, name:)
55
61
  # @param code [String] NAICS code
56
62
  #
57
- # @param title [String] NAICS title
63
+ # @param confidence [Symbol, BrandDev::Models::BrandRetrieveNaicsResponse::Code::Confidence] Confidence level for how well this NAICS code matches the company description
64
+ #
65
+ # @param name [String] NAICS title
66
+
67
+ # Confidence level for how well this NAICS code matches the company description
68
+ #
69
+ # @see BrandDev::Models::BrandRetrieveNaicsResponse::Code#confidence
70
+ module Confidence
71
+ extend BrandDev::Internal::Type::Enum
72
+
73
+ HIGH = :high
74
+ MEDIUM = :medium
75
+ LOW = :low
76
+
77
+ # @!method self.values
78
+ # @return [Array<Symbol>]
79
+ end
58
80
  end
59
81
  end
60
82
  end
@@ -45,6 +45,8 @@ module BrandDev
45
45
 
46
46
  BrandIdentifyFromTransactionParams = BrandDev::Models::BrandIdentifyFromTransactionParams
47
47
 
48
+ BrandPrefetchByEmailParams = BrandDev::Models::BrandPrefetchByEmailParams
49
+
48
50
  BrandPrefetchParams = BrandDev::Models::BrandPrefetchParams
49
51
 
50
52
  BrandRetrieveByEmailParams = BrandDev::Models::BrandRetrieveByEmailParams
@@ -166,6 +166,38 @@ module BrandDev
166
166
  )
167
167
  end
168
168
 
169
+ # Some parameter documentations has been truncated, see
170
+ # {BrandDev::Models::BrandPrefetchByEmailParams} for more details.
171
+ #
172
+ # Signal that you may fetch brand data for a particular domain soon to improve
173
+ # latency. This endpoint accepts an email address, extracts the domain from it,
174
+ # validates that it's not a disposable or free email provider, and queues the
175
+ # domain for prefetching. This endpoint does not charge credits and is available
176
+ # for paid customers to optimize future requests. [You must be on a paid plan to
177
+ # use this endpoint]
178
+ #
179
+ # @overload prefetch_by_email(email:, timeout_ms: nil, request_options: {})
180
+ #
181
+ # @param email [String] Email address to prefetch brand data for. The domain will be extracted from the
182
+ #
183
+ # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
184
+ #
185
+ # @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}, nil]
186
+ #
187
+ # @return [BrandDev::Models::BrandPrefetchByEmailResponse]
188
+ #
189
+ # @see BrandDev::Models::BrandPrefetchByEmailParams
190
+ def prefetch_by_email(params)
191
+ parsed, options = BrandDev::BrandPrefetchByEmailParams.dump_request(params)
192
+ @client.request(
193
+ method: :post,
194
+ path: "brand/prefetch-by-email",
195
+ body: parsed,
196
+ model: BrandDev::Models::BrandPrefetchByEmailResponse,
197
+ options: options
198
+ )
199
+ end
200
+
169
201
  # Some parameter documentations has been truncated, see
170
202
  # {BrandDev::Models::BrandRetrieveByEmailParams} for more details.
171
203
  #
@@ -304,10 +336,14 @@ module BrandDev
304
336
  #
305
337
  # Endpoint to classify any brand into a 2022 NAICS code.
306
338
  #
307
- # @overload retrieve_naics(input:, timeout_ms: nil, request_options: {})
339
+ # @overload retrieve_naics(input:, max_results: nil, min_results: nil, timeout_ms: nil, request_options: {})
308
340
  #
309
341
  # @param input [String] Brand domain or title to retrieve NAICS code for. If a valid domain is provided
310
342
  #
343
+ # @param max_results [Integer] Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults to 5
344
+ #
345
+ # @param min_results [Integer] Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1.
346
+ #
311
347
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
312
348
  #
313
349
  # @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}, nil]
@@ -320,7 +356,11 @@ module BrandDev
320
356
  @client.request(
321
357
  method: :get,
322
358
  path: "brand/naics",
323
- query: parsed.transform_keys(timeout_ms: "timeoutMS"),
359
+ query: parsed.transform_keys(
360
+ max_results: "maxResults",
361
+ min_results: "minResults",
362
+ timeout_ms: "timeoutMS"
363
+ ),
324
364
  model: BrandDev::Models::BrandRetrieveNaicsResponse,
325
365
  options: options
326
366
  )
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BrandDev
4
- VERSION = "0.17.0"
4
+ VERSION = "0.19.0"
5
5
  end
data/lib/brand_dev.rb CHANGED
@@ -58,6 +58,8 @@ require_relative "brand_dev/models/brand_fonts_params"
58
58
  require_relative "brand_dev/models/brand_fonts_response"
59
59
  require_relative "brand_dev/models/brand_identify_from_transaction_params"
60
60
  require_relative "brand_dev/models/brand_identify_from_transaction_response"
61
+ require_relative "brand_dev/models/brand_prefetch_by_email_params"
62
+ require_relative "brand_dev/models/brand_prefetch_by_email_response"
61
63
  require_relative "brand_dev/models/brand_prefetch_params"
62
64
  require_relative "brand_dev/models/brand_prefetch_response"
63
65
  require_relative "brand_dev/models/brand_retrieve_by_email_params"
@@ -0,0 +1,65 @@
1
+ # typed: strong
2
+
3
+ module BrandDev
4
+ module Models
5
+ class BrandPrefetchByEmailParams < 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(
12
+ BrandDev::BrandPrefetchByEmailParams,
13
+ BrandDev::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ # Email address to prefetch brand data for. The domain will be extracted from the
18
+ # email. Free email providers (gmail.com, yahoo.com, etc.) and disposable email
19
+ # addresses are not allowed.
20
+ sig { returns(String) }
21
+ attr_accessor :email
22
+
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
+ sig { returns(T.nilable(Integer)) }
27
+ attr_reader :timeout_ms
28
+
29
+ sig { params(timeout_ms: Integer).void }
30
+ attr_writer :timeout_ms
31
+
32
+ sig do
33
+ params(
34
+ email: String,
35
+ timeout_ms: Integer,
36
+ request_options: BrandDev::RequestOptions::OrHash
37
+ ).returns(T.attached_class)
38
+ end
39
+ def self.new(
40
+ # Email address to prefetch brand data for. The domain will be extracted from the
41
+ # email. Free email providers (gmail.com, yahoo.com, etc.) and disposable email
42
+ # addresses are not allowed.
43
+ email:,
44
+ # Optional timeout in milliseconds for the request. If the request takes longer
45
+ # than this value, it will be aborted with a 408 status code. Maximum allowed
46
+ # value is 300000ms (5 minutes).
47
+ timeout_ms: nil,
48
+ request_options: {}
49
+ )
50
+ end
51
+
52
+ sig do
53
+ override.returns(
54
+ {
55
+ email: String,
56
+ timeout_ms: Integer,
57
+ request_options: BrandDev::RequestOptions
58
+ }
59
+ )
60
+ end
61
+ def to_hash
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,57 @@
1
+ # typed: strong
2
+
3
+ module BrandDev
4
+ module Models
5
+ class BrandPrefetchByEmailResponse < BrandDev::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ BrandDev::Models::BrandPrefetchByEmailResponse,
10
+ BrandDev::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # The domain that was queued for prefetching
15
+ sig { returns(T.nilable(String)) }
16
+ attr_reader :domain
17
+
18
+ sig { params(domain: String).void }
19
+ attr_writer :domain
20
+
21
+ # Success message
22
+ sig { returns(T.nilable(String)) }
23
+ attr_reader :message
24
+
25
+ sig { params(message: String).void }
26
+ attr_writer :message
27
+
28
+ # Status of the response, e.g., 'ok'
29
+ sig { returns(T.nilable(String)) }
30
+ attr_reader :status
31
+
32
+ sig { params(status: String).void }
33
+ attr_writer :status
34
+
35
+ sig do
36
+ params(domain: String, message: String, status: String).returns(
37
+ T.attached_class
38
+ )
39
+ end
40
+ def self.new(
41
+ # The domain that was queued for prefetching
42
+ domain: nil,
43
+ # Success message
44
+ message: nil,
45
+ # Status of the response, e.g., 'ok'
46
+ status: nil
47
+ )
48
+ end
49
+
50
+ sig do
51
+ override.returns({ domain: String, message: String, status: String })
52
+ end
53
+ def to_hash
54
+ end
55
+ end
56
+ end
57
+ end
@@ -17,6 +17,21 @@ module BrandDev
17
17
  sig { returns(String) }
18
18
  attr_accessor :input
19
19
 
20
+ # Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults
21
+ # to 5.
22
+ sig { returns(T.nilable(Integer)) }
23
+ attr_reader :max_results
24
+
25
+ sig { params(max_results: Integer).void }
26
+ attr_writer :max_results
27
+
28
+ # Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1.
29
+ sig { returns(T.nilable(Integer)) }
30
+ attr_reader :min_results
31
+
32
+ sig { params(min_results: Integer).void }
33
+ attr_writer :min_results
34
+
20
35
  # Optional timeout in milliseconds for the request. If the request takes longer
21
36
  # than this value, it will be aborted with a 408 status code. Maximum allowed
22
37
  # value is 300000ms (5 minutes).
@@ -29,6 +44,8 @@ module BrandDev
29
44
  sig do
30
45
  params(
31
46
  input: String,
47
+ max_results: Integer,
48
+ min_results: Integer,
32
49
  timeout_ms: Integer,
33
50
  request_options: BrandDev::RequestOptions::OrHash
34
51
  ).returns(T.attached_class)
@@ -38,6 +55,11 @@ module BrandDev
38
55
  # in `input`, it will be used for classification, otherwise, we will search for
39
56
  # the brand using the provided title.
40
57
  input:,
58
+ # Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults
59
+ # to 5.
60
+ max_results: nil,
61
+ # Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1.
62
+ min_results: nil,
41
63
  # Optional timeout in milliseconds for the request. If the request takes longer
42
64
  # than this value, it will be aborted with a 408 status code. Maximum allowed
43
65
  # value is 300000ms (5 minutes).
@@ -50,6 +72,8 @@ module BrandDev
50
72
  override.returns(
51
73
  {
52
74
  input: String,
75
+ max_results: Integer,
76
+ min_results: Integer,
53
77
  timeout_ms: Integer,
54
78
  request_options: BrandDev::RequestOptions
55
79
  }
@@ -96,31 +96,91 @@ module BrandDev
96
96
  end
97
97
 
98
98
  # NAICS code
99
- sig { returns(T.nilable(String)) }
100
- attr_reader :code
99
+ sig { returns(String) }
100
+ attr_accessor :code
101
101
 
102
- sig { params(code: String).void }
103
- attr_writer :code
102
+ # Confidence level for how well this NAICS code matches the company description
103
+ sig do
104
+ returns(
105
+ BrandDev::Models::BrandRetrieveNaicsResponse::Code::Confidence::TaggedSymbol
106
+ )
107
+ end
108
+ attr_accessor :confidence
104
109
 
105
110
  # NAICS title
106
- sig { returns(T.nilable(String)) }
107
- attr_reader :title
108
-
109
- sig { params(title: String).void }
110
- attr_writer :title
111
-
112
- sig { params(code: String, title: String).returns(T.attached_class) }
111
+ sig { returns(String) }
112
+ attr_accessor :name
113
+
114
+ sig do
115
+ params(
116
+ code: String,
117
+ confidence:
118
+ BrandDev::Models::BrandRetrieveNaicsResponse::Code::Confidence::OrSymbol,
119
+ name: String
120
+ ).returns(T.attached_class)
121
+ end
113
122
  def self.new(
114
123
  # NAICS code
115
- code: nil,
124
+ code:,
125
+ # Confidence level for how well this NAICS code matches the company description
126
+ confidence:,
116
127
  # NAICS title
117
- title: nil
128
+ name:
118
129
  )
119
130
  end
120
131
 
121
- sig { override.returns({ code: String, title: String }) }
132
+ sig do
133
+ override.returns(
134
+ {
135
+ code: String,
136
+ confidence:
137
+ BrandDev::Models::BrandRetrieveNaicsResponse::Code::Confidence::TaggedSymbol,
138
+ name: String
139
+ }
140
+ )
141
+ end
122
142
  def to_hash
123
143
  end
144
+
145
+ # Confidence level for how well this NAICS code matches the company description
146
+ module Confidence
147
+ extend BrandDev::Internal::Type::Enum
148
+
149
+ TaggedSymbol =
150
+ T.type_alias do
151
+ T.all(
152
+ Symbol,
153
+ BrandDev::Models::BrandRetrieveNaicsResponse::Code::Confidence
154
+ )
155
+ end
156
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
157
+
158
+ HIGH =
159
+ T.let(
160
+ :high,
161
+ BrandDev::Models::BrandRetrieveNaicsResponse::Code::Confidence::TaggedSymbol
162
+ )
163
+ MEDIUM =
164
+ T.let(
165
+ :medium,
166
+ BrandDev::Models::BrandRetrieveNaicsResponse::Code::Confidence::TaggedSymbol
167
+ )
168
+ LOW =
169
+ T.let(
170
+ :low,
171
+ BrandDev::Models::BrandRetrieveNaicsResponse::Code::Confidence::TaggedSymbol
172
+ )
173
+
174
+ sig do
175
+ override.returns(
176
+ T::Array[
177
+ BrandDev::Models::BrandRetrieveNaicsResponse::Code::Confidence::TaggedSymbol
178
+ ]
179
+ )
180
+ end
181
+ def self.values
182
+ end
183
+ end
124
184
  end
125
185
  end
126
186
  end
@@ -8,6 +8,8 @@ module BrandDev
8
8
  BrandIdentifyFromTransactionParams =
9
9
  BrandDev::Models::BrandIdentifyFromTransactionParams
10
10
 
11
+ BrandPrefetchByEmailParams = BrandDev::Models::BrandPrefetchByEmailParams
12
+
11
13
  BrandPrefetchParams = BrandDev::Models::BrandPrefetchParams
12
14
 
13
15
  BrandRetrieveByEmailParams = BrandDev::Models::BrandRetrieveByEmailParams
@@ -149,6 +149,32 @@ module BrandDev
149
149
  )
150
150
  end
151
151
 
152
+ # Signal that you may fetch brand data for a particular domain soon to improve
153
+ # latency. This endpoint accepts an email address, extracts the domain from it,
154
+ # validates that it's not a disposable or free email provider, and queues the
155
+ # domain for prefetching. This endpoint does not charge credits and is available
156
+ # for paid customers to optimize future requests. [You must be on a paid plan to
157
+ # use this endpoint]
158
+ sig do
159
+ params(
160
+ email: String,
161
+ timeout_ms: Integer,
162
+ request_options: BrandDev::RequestOptions::OrHash
163
+ ).returns(BrandDev::Models::BrandPrefetchByEmailResponse)
164
+ end
165
+ def prefetch_by_email(
166
+ # Email address to prefetch brand data for. The domain will be extracted from the
167
+ # email. Free email providers (gmail.com, yahoo.com, etc.) and disposable email
168
+ # addresses are not allowed.
169
+ email:,
170
+ # Optional timeout in milliseconds for the request. If the request takes longer
171
+ # than this value, it will be aborted with a 408 status code. Maximum allowed
172
+ # value is 300000ms (5 minutes).
173
+ timeout_ms: nil,
174
+ request_options: {}
175
+ )
176
+ end
177
+
152
178
  # Retrieve brand information using an email address while detecting disposable and
153
179
  # free email addresses. This endpoint extracts the domain from the email address
154
180
  # and returns brand data for that domain. Disposable and free email addresses
@@ -282,6 +308,8 @@ module BrandDev
282
308
  sig do
283
309
  params(
284
310
  input: String,
311
+ max_results: Integer,
312
+ min_results: Integer,
285
313
  timeout_ms: Integer,
286
314
  request_options: BrandDev::RequestOptions::OrHash
287
315
  ).returns(BrandDev::Models::BrandRetrieveNaicsResponse)
@@ -291,6 +319,11 @@ module BrandDev
291
319
  # in `input`, it will be used for classification, otherwise, we will search for
292
320
  # the brand using the provided title.
293
321
  input:,
322
+ # Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults
323
+ # to 5.
324
+ max_results: nil,
325
+ # Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1.
326
+ min_results: nil,
294
327
  # Optional timeout in milliseconds for the request. If the request takes longer
295
328
  # than this value, it will be aborted with a 408 status code. Maximum allowed
296
329
  # value is 300000ms (5 minutes).
@@ -0,0 +1,30 @@
1
+ module BrandDev
2
+ module Models
3
+ type brand_prefetch_by_email_params =
4
+ { email: String, timeout_ms: Integer }
5
+ & BrandDev::Internal::Type::request_parameters
6
+
7
+ class BrandPrefetchByEmailParams < BrandDev::Internal::Type::BaseModel
8
+ extend BrandDev::Internal::Type::RequestParameters::Converter
9
+ include BrandDev::Internal::Type::RequestParameters
10
+
11
+ attr_accessor email: String
12
+
13
+ attr_reader timeout_ms: Integer?
14
+
15
+ def timeout_ms=: (Integer) -> Integer
16
+
17
+ def initialize: (
18
+ email: String,
19
+ ?timeout_ms: Integer,
20
+ ?request_options: BrandDev::request_opts
21
+ ) -> void
22
+
23
+ def to_hash: -> {
24
+ email: String,
25
+ timeout_ms: Integer,
26
+ request_options: BrandDev::RequestOptions
27
+ }
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,28 @@
1
+ module BrandDev
2
+ module Models
3
+ type brand_prefetch_by_email_response =
4
+ { domain: String, message: String, status: String }
5
+
6
+ class BrandPrefetchByEmailResponse < BrandDev::Internal::Type::BaseModel
7
+ attr_reader domain: String?
8
+
9
+ def domain=: (String) -> String
10
+
11
+ attr_reader message: String?
12
+
13
+ def message=: (String) -> String
14
+
15
+ attr_reader status: String?
16
+
17
+ def status=: (String) -> String
18
+
19
+ def initialize: (
20
+ ?domain: String,
21
+ ?message: String,
22
+ ?status: String
23
+ ) -> void
24
+
25
+ def to_hash: -> { domain: String, message: String, status: String }
26
+ end
27
+ end
28
+ end
@@ -1,7 +1,12 @@
1
1
  module BrandDev
2
2
  module Models
3
3
  type brand_retrieve_naics_params =
4
- { input: String, timeout_ms: Integer }
4
+ {
5
+ input: String,
6
+ max_results: Integer,
7
+ min_results: Integer,
8
+ timeout_ms: Integer
9
+ }
5
10
  & BrandDev::Internal::Type::request_parameters
6
11
 
7
12
  class BrandRetrieveNaicsParams < BrandDev::Internal::Type::BaseModel
@@ -10,18 +15,30 @@ module BrandDev
10
15
 
11
16
  attr_accessor input: String
12
17
 
18
+ attr_reader max_results: Integer?
19
+
20
+ def max_results=: (Integer) -> Integer
21
+
22
+ attr_reader min_results: Integer?
23
+
24
+ def min_results=: (Integer) -> Integer
25
+
13
26
  attr_reader timeout_ms: Integer?
14
27
 
15
28
  def timeout_ms=: (Integer) -> Integer
16
29
 
17
30
  def initialize: (
18
31
  input: String,
32
+ ?max_results: Integer,
33
+ ?min_results: Integer,
19
34
  ?timeout_ms: Integer,
20
35
  ?request_options: BrandDev::request_opts
21
36
  ) -> void
22
37
 
23
38
  def to_hash: -> {
24
39
  input: String,
40
+ max_results: Integer,
41
+ min_results: Integer,
25
42
  timeout_ms: Integer,
26
43
  request_options: BrandDev::RequestOptions
27
44
  }
@@ -41,20 +41,43 @@ module BrandDev
41
41
  type: String
42
42
  }
43
43
 
44
- type code = { code: String, title: String }
44
+ type code =
45
+ {
46
+ code: String,
47
+ confidence: BrandDev::Models::BrandRetrieveNaicsResponse::Code::confidence,
48
+ name: String
49
+ }
45
50
 
46
51
  class Code < BrandDev::Internal::Type::BaseModel
47
- attr_reader code: String?
52
+ attr_accessor code: String
48
53
 
49
- def code=: (String) -> String
54
+ attr_accessor confidence: BrandDev::Models::BrandRetrieveNaicsResponse::Code::confidence
50
55
 
51
- attr_reader title: String?
56
+ attr_accessor name: String
52
57
 
53
- def title=: (String) -> String
58
+ def initialize: (
59
+ code: String,
60
+ confidence: BrandDev::Models::BrandRetrieveNaicsResponse::Code::confidence,
61
+ name: String
62
+ ) -> void
54
63
 
55
- def initialize: (?code: String, ?title: String) -> void
64
+ def to_hash: -> {
65
+ code: String,
66
+ confidence: BrandDev::Models::BrandRetrieveNaicsResponse::Code::confidence,
67
+ name: String
68
+ }
56
69
 
57
- def to_hash: -> { code: String, title: String }
70
+ type confidence = :high | :medium | :low
71
+
72
+ module Confidence
73
+ extend BrandDev::Internal::Type::Enum
74
+
75
+ HIGH: :high
76
+ MEDIUM: :medium
77
+ LOW: :low
78
+
79
+ def self?.values: -> ::Array[BrandDev::Models::BrandRetrieveNaicsResponse::Code::confidence]
80
+ end
58
81
  end
59
82
  end
60
83
  end
@@ -5,6 +5,8 @@ module BrandDev
5
5
 
6
6
  class BrandIdentifyFromTransactionParams = BrandDev::Models::BrandIdentifyFromTransactionParams
7
7
 
8
+ class BrandPrefetchByEmailParams = BrandDev::Models::BrandPrefetchByEmailParams
9
+
8
10
  class BrandPrefetchParams = BrandDev::Models::BrandPrefetchParams
9
11
 
10
12
  class BrandRetrieveByEmailParams = BrandDev::Models::BrandRetrieveByEmailParams
@@ -41,6 +41,12 @@ module BrandDev
41
41
  ?request_options: BrandDev::request_opts
42
42
  ) -> BrandDev::Models::BrandPrefetchResponse
43
43
 
44
+ def prefetch_by_email: (
45
+ email: String,
46
+ ?timeout_ms: Integer,
47
+ ?request_options: BrandDev::request_opts
48
+ ) -> BrandDev::Models::BrandPrefetchByEmailResponse
49
+
44
50
  def retrieve_by_email: (
45
51
  email: String,
46
52
  ?force_language: BrandDev::Models::BrandRetrieveByEmailParams::force_language,
@@ -76,6 +82,8 @@ module BrandDev
76
82
 
77
83
  def retrieve_naics: (
78
84
  input: String,
85
+ ?max_results: Integer,
86
+ ?min_results: Integer,
79
87
  ?timeout_ms: Integer,
80
88
  ?request_options: BrandDev::request_opts
81
89
  ) -> BrandDev::Models::BrandRetrieveNaicsResponse
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.17.0
4
+ version: 0.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brand Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-12-11 00:00:00.000000000 Z
11
+ date: 2025-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool
@@ -60,6 +60,8 @@ files:
60
60
  - lib/brand_dev/models/brand_fonts_response.rb
61
61
  - lib/brand_dev/models/brand_identify_from_transaction_params.rb
62
62
  - lib/brand_dev/models/brand_identify_from_transaction_response.rb
63
+ - lib/brand_dev/models/brand_prefetch_by_email_params.rb
64
+ - lib/brand_dev/models/brand_prefetch_by_email_response.rb
63
65
  - lib/brand_dev/models/brand_prefetch_params.rb
64
66
  - lib/brand_dev/models/brand_prefetch_response.rb
65
67
  - lib/brand_dev/models/brand_retrieve_by_email_params.rb
@@ -109,6 +111,8 @@ files:
109
111
  - rbi/brand_dev/models/brand_fonts_response.rbi
110
112
  - rbi/brand_dev/models/brand_identify_from_transaction_params.rbi
111
113
  - rbi/brand_dev/models/brand_identify_from_transaction_response.rbi
114
+ - rbi/brand_dev/models/brand_prefetch_by_email_params.rbi
115
+ - rbi/brand_dev/models/brand_prefetch_by_email_response.rbi
112
116
  - rbi/brand_dev/models/brand_prefetch_params.rbi
113
117
  - rbi/brand_dev/models/brand_prefetch_response.rbi
114
118
  - rbi/brand_dev/models/brand_retrieve_by_email_params.rbi
@@ -157,6 +161,8 @@ files:
157
161
  - sig/brand_dev/models/brand_fonts_response.rbs
158
162
  - sig/brand_dev/models/brand_identify_from_transaction_params.rbs
159
163
  - sig/brand_dev/models/brand_identify_from_transaction_response.rbs
164
+ - sig/brand_dev/models/brand_prefetch_by_email_params.rbs
165
+ - sig/brand_dev/models/brand_prefetch_by_email_response.rbs
160
166
  - sig/brand_dev/models/brand_prefetch_params.rbs
161
167
  - sig/brand_dev/models/brand_prefetch_response.rbs
162
168
  - sig/brand_dev/models/brand_retrieve_by_email_params.rbs