Skip to content

Commit 7410667

Browse files
feat(api): manual updates
1 parent 1dd8c2e commit 7410667

File tree

15 files changed

+278
-2
lines changed

15 files changed

+278
-2
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 6
1+
configured_endpoints: 7
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-1f1bc5d70a89b56425a3bafbc06a80c233300b5d5d64438aa633597085a45974.yml
33
openapi_spec_hash: e87e758c5f59476e0ec486fa59455d60
4-
config_hash: 372b187172495fc2f76f05ba016b4a45
4+
config_hash: bb3f3ba0dca413263e40968648f9a1a6

lib/brand_dev.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
require_relative "brand_dev/models/brand_ai_query_response"
5555
require_relative "brand_dev/models/brand_identify_from_transaction_params"
5656
require_relative "brand_dev/models/brand_identify_from_transaction_response"
57+
require_relative "brand_dev/models/brand_prefetch_params"
58+
require_relative "brand_dev/models/brand_prefetch_response"
5759
require_relative "brand_dev/models/brand_retrieve_by_ticker_params"
5860
require_relative "brand_dev/models/brand_retrieve_by_ticker_response"
5961
require_relative "brand_dev/models/brand_retrieve_naics_params"

lib/brand_dev/models.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ module BrandDev
4343

4444
BrandIdentifyFromTransactionParams = BrandDev::Models::BrandIdentifyFromTransactionParams
4545

46+
BrandPrefetchParams = BrandDev::Models::BrandPrefetchParams
47+
4648
BrandRetrieveByTickerParams = BrandDev::Models::BrandRetrieveByTickerParams
4749

4850
BrandRetrieveNaicsParams = BrandDev::Models::BrandRetrieveNaicsParams
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# frozen_string_literal: true
2+
3+
module BrandDev
4+
module Models
5+
# @see BrandDev::Resources::Brand#prefetch
6+
class BrandPrefetchParams < BrandDev::Internal::Type::BaseModel
7+
extend BrandDev::Internal::Type::RequestParameters::Converter
8+
include BrandDev::Internal::Type::RequestParameters
9+
10+
# @!attribute domain
11+
# Domain name to prefetch brand data for
12+
#
13+
# @return [String]
14+
required :domain, String
15+
16+
# @!method initialize(domain:, request_options: {})
17+
# @param domain [String] Domain name to prefetch brand data for
18+
#
19+
# @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}]
20+
end
21+
end
22+
end
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# frozen_string_literal: true
2+
3+
module BrandDev
4+
module Models
5+
# @see BrandDev::Resources::Brand#prefetch
6+
class BrandPrefetchResponse < 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

lib/brand_dev/resources/brand.rb

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,31 @@ def identify_from_transaction(params)
7878
)
7979
end
8080

81+
# Signal that you may fetch brand data for a particular domain soon to improve
82+
# latency. This endpoint does not charge credits and is available for paid
83+
# customers to optimize future requests. [You must be on a paid plan to use this
84+
# endpoint]
85+
#
86+
# @overload prefetch(domain:, request_options: {})
87+
#
88+
# @param domain [String] Domain name to prefetch brand data for
89+
#
90+
# @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}, nil]
91+
#
92+
# @return [BrandDev::Models::BrandPrefetchResponse]
93+
#
94+
# @see BrandDev::Models::BrandPrefetchParams
95+
def prefetch(params)
96+
parsed, options = BrandDev::BrandPrefetchParams.dump_request(params)
97+
@client.request(
98+
method: :post,
99+
path: "brand/prefetch",
100+
body: parsed,
101+
model: BrandDev::Models::BrandPrefetchResponse,
102+
options: options
103+
)
104+
end
105+
81106
# Retrieve brand data by stock ticker (e.g. AAPL, TSLA, etc.)
82107
#
83108
# @overload retrieve_by_ticker(ticker:, request_options: {})

rbi/brand_dev/models.rbi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ module BrandDev
66
BrandIdentifyFromTransactionParams =
77
BrandDev::Models::BrandIdentifyFromTransactionParams
88

9+
BrandPrefetchParams = BrandDev::Models::BrandPrefetchParams
10+
911
BrandRetrieveByTickerParams = BrandDev::Models::BrandRetrieveByTickerParams
1012

1113
BrandRetrieveNaicsParams = BrandDev::Models::BrandRetrieveNaicsParams
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# typed: strong
2+
3+
module BrandDev
4+
module Models
5+
class BrandPrefetchParams < 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(BrandDev::BrandPrefetchParams, BrandDev::Internal::AnyHash)
12+
end
13+
14+
# Domain name to prefetch brand data for
15+
sig { returns(String) }
16+
attr_accessor :domain
17+
18+
sig do
19+
params(
20+
domain: String,
21+
request_options: BrandDev::RequestOptions::OrHash
22+
).returns(T.attached_class)
23+
end
24+
def self.new(
25+
# Domain name to prefetch brand data for
26+
domain:,
27+
request_options: {}
28+
)
29+
end
30+
31+
sig do
32+
override.returns(
33+
{ domain: String, request_options: BrandDev::RequestOptions }
34+
)
35+
end
36+
def to_hash
37+
end
38+
end
39+
end
40+
end
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# typed: strong
2+
3+
module BrandDev
4+
module Models
5+
class BrandPrefetchResponse < BrandDev::Internal::Type::BaseModel
6+
OrHash =
7+
T.type_alias do
8+
T.any(
9+
BrandDev::Models::BrandPrefetchResponse,
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

rbi/brand_dev/resources/brand.rbi

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,23 @@ module BrandDev
5959
)
6060
end
6161

62+
# Signal that you may fetch brand data for a particular domain soon to improve
63+
# latency. This endpoint does not charge credits and is available for paid
64+
# customers to optimize future requests. [You must be on a paid plan to use this
65+
# endpoint]
66+
sig do
67+
params(
68+
domain: String,
69+
request_options: BrandDev::RequestOptions::OrHash
70+
).returns(BrandDev::Models::BrandPrefetchResponse)
71+
end
72+
def prefetch(
73+
# Domain name to prefetch brand data for
74+
domain:,
75+
request_options: {}
76+
)
77+
end
78+
6279
# Retrieve brand data by stock ticker (e.g. AAPL, TSLA, etc.)
6380
sig do
6481
params(

0 commit comments

Comments
 (0)