Skip to content

Commit 25b73b8

Browse files
feat(api): api update
1 parent 46e4939 commit 25b73b8

10 files changed

Lines changed: 214 additions & 34 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 13
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-143086f8200f34e6ace805070e2a3ddccf15e30ed7ac3a7193f6a984f2413fa2.yml
3-
openapi_spec_hash: f15bf2b836aee764c02a4fc185f13586
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-849e1b7b4e2aeff45d6762768c497da63f605cb80fdbfc0207f7e7555b994b5a.yml
3+
openapi_spec_hash: 9d2ef7a402cb9eaa80cbae645aa8d2f0
44
config_hash: 6aaf0fe6f8877c9c5d9af95597123cb4

lib/brand_dev/models/brand_retrieve_naics_params.rb

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,19 @@ class BrandRetrieveNaicsParams < BrandDev::Internal::Type::BaseModel
1515
# @return [String]
1616
required :input, String
1717

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+
1831
# @!attribute timeout_ms
1932
# Optional timeout in milliseconds for the request. If the request takes longer
2033
# than this value, it will be aborted with a 408 status code. Maximum allowed
@@ -23,12 +36,16 @@ class BrandRetrieveNaicsParams < BrandDev::Internal::Type::BaseModel
2336
# @return [Integer, nil]
2437
optional :timeout_ms, Integer
2538

26-
# @!method initialize(input:, timeout_ms: nil, request_options: {})
39+
# @!method initialize(input:, max_results: nil, min_results: nil, timeout_ms: nil, request_options: {})
2740
# Some parameter documentations has been truncated, see
2841
# {BrandDev::Models::BrandRetrieveNaicsParams} for more details.
2942
#
3043
# @param input [String] Brand domain or title to retrieve NAICS code for. If a valid domain is provided
3144
#
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+
#
3249
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
3350
#
3451
# @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}]

lib/brand_dev/models/brand_retrieve_naics_response.rb

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,41 @@ class Code < BrandDev::Internal::Type::BaseModel
4242
# @!attribute code
4343
# NAICS code
4444
#
45-
# @return [String, nil]
46-
optional :code, String
45+
# @return [String]
46+
required :code, String
4747

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
4955
# NAICS title
5056
#
51-
# @return [String, nil]
52-
optional :title, String
57+
# @return [String]
58+
required :name, String
5359

54-
# @!method initialize(code: nil, title: nil)
60+
# @!method initialize(code:, confidence:, name:)
5561
# @param code [String] NAICS code
5662
#
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
5880
end
5981
end
6082
end

lib/brand_dev/resources/brand.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,14 @@ def retrieve_by_ticker(params)
304304
#
305305
# Endpoint to classify any brand into a 2022 NAICS code.
306306
#
307-
# @overload retrieve_naics(input:, timeout_ms: nil, request_options: {})
307+
# @overload retrieve_naics(input:, max_results: nil, min_results: nil, timeout_ms: nil, request_options: {})
308308
#
309309
# @param input [String] Brand domain or title to retrieve NAICS code for. If a valid domain is provided
310310
#
311+
# @param max_results [Integer] Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults to 5
312+
#
313+
# @param min_results [Integer] Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1.
314+
#
311315
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
312316
#
313317
# @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}, nil]
@@ -320,7 +324,11 @@ def retrieve_naics(params)
320324
@client.request(
321325
method: :get,
322326
path: "brand/naics",
323-
query: parsed.transform_keys(timeout_ms: "timeoutMS"),
327+
query: parsed.transform_keys(
328+
max_results: "maxResults",
329+
min_results: "minResults",
330+
timeout_ms: "timeoutMS"
331+
),
324332
model: BrandDev::Models::BrandRetrieveNaicsResponse,
325333
options: options
326334
)

rbi/brand_dev/models/brand_retrieve_naics_params.rbi

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,21 @@ module BrandDev
1717
sig { returns(String) }
1818
attr_accessor :input
1919

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+
2035
# Optional timeout in milliseconds for the request. If the request takes longer
2136
# than this value, it will be aborted with a 408 status code. Maximum allowed
2237
# value is 300000ms (5 minutes).
@@ -29,6 +44,8 @@ module BrandDev
2944
sig do
3045
params(
3146
input: String,
47+
max_results: Integer,
48+
min_results: Integer,
3249
timeout_ms: Integer,
3350
request_options: BrandDev::RequestOptions::OrHash
3451
).returns(T.attached_class)
@@ -38,6 +55,11 @@ module BrandDev
3855
# in `input`, it will be used for classification, otherwise, we will search for
3956
# the brand using the provided title.
4057
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,
4163
# Optional timeout in milliseconds for the request. If the request takes longer
4264
# than this value, it will be aborted with a 408 status code. Maximum allowed
4365
# value is 300000ms (5 minutes).
@@ -50,6 +72,8 @@ module BrandDev
5072
override.returns(
5173
{
5274
input: String,
75+
max_results: Integer,
76+
min_results: Integer,
5377
timeout_ms: Integer,
5478
request_options: BrandDev::RequestOptions
5579
}

rbi/brand_dev/models/brand_retrieve_naics_response.rbi

Lines changed: 74 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -96,31 +96,91 @@ module BrandDev
9696
end
9797

9898
# NAICS code
99-
sig { returns(T.nilable(String)) }
100-
attr_reader :code
99+
sig { returns(String) }
100+
attr_accessor :code
101101

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
104109

105110
# 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
113122
def self.new(
114123
# NAICS code
115-
code: nil,
124+
code:,
125+
# Confidence level for how well this NAICS code matches the company description
126+
confidence:,
116127
# NAICS title
117-
title: nil
128+
name:
118129
)
119130
end
120131

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
122142
def to_hash
123143
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
124184
end
125185
end
126186
end

rbi/brand_dev/resources/brand.rbi

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,8 @@ module BrandDev
282282
sig do
283283
params(
284284
input: String,
285+
max_results: Integer,
286+
min_results: Integer,
285287
timeout_ms: Integer,
286288
request_options: BrandDev::RequestOptions::OrHash
287289
).returns(BrandDev::Models::BrandRetrieveNaicsResponse)
@@ -291,6 +293,11 @@ module BrandDev
291293
# in `input`, it will be used for classification, otherwise, we will search for
292294
# the brand using the provided title.
293295
input:,
296+
# Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults
297+
# to 5.
298+
max_results: nil,
299+
# Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1.
300+
min_results: nil,
294301
# Optional timeout in milliseconds for the request. If the request takes longer
295302
# than this value, it will be aborted with a 408 status code. Maximum allowed
296303
# value is 300000ms (5 minutes).

sig/brand_dev/models/brand_retrieve_naics_params.rbs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
module BrandDev
22
module Models
33
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+
}
510
& BrandDev::Internal::Type::request_parameters
611

712
class BrandRetrieveNaicsParams < BrandDev::Internal::Type::BaseModel
@@ -10,18 +15,30 @@ module BrandDev
1015

1116
attr_accessor input: String
1217

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+
1326
attr_reader timeout_ms: Integer?
1427

1528
def timeout_ms=: (Integer) -> Integer
1629

1730
def initialize: (
1831
input: String,
32+
?max_results: Integer,
33+
?min_results: Integer,
1934
?timeout_ms: Integer,
2035
?request_options: BrandDev::request_opts
2136
) -> void
2237

2338
def to_hash: -> {
2439
input: String,
40+
max_results: Integer,
41+
min_results: Integer,
2542
timeout_ms: Integer,
2643
request_options: BrandDev::RequestOptions
2744
}

sig/brand_dev/models/brand_retrieve_naics_response.rbs

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,43 @@ module BrandDev
4141
type: String
4242
}
4343

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+
}
4550

4651
class Code < BrandDev::Internal::Type::BaseModel
47-
attr_reader code: String?
52+
attr_accessor code: String
4853

49-
def code=: (String) -> String
54+
attr_accessor confidence: BrandDev::Models::BrandRetrieveNaicsResponse::Code::confidence
5055

51-
attr_reader title: String?
56+
attr_accessor name: String
5257

53-
def title=: (String) -> String
58+
def initialize: (
59+
code: String,
60+
confidence: BrandDev::Models::BrandRetrieveNaicsResponse::Code::confidence,
61+
name: String
62+
) -> void
5463

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+
}
5669

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
5881
end
5982
end
6083
end

0 commit comments

Comments
 (0)