brand.dev 0.6.0 → 0.8.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 +4 -4
- data/CHANGELOG.md +42 -0
- data/README.md +1 -1
- data/lib/brand_dev/errors.rb +25 -11
- data/lib/brand_dev/file_part.rb +10 -7
- data/lib/brand_dev/internal/transport/base_client.rb +11 -7
- data/lib/brand_dev/internal/transport/pooled_net_requester.rb +7 -10
- data/lib/brand_dev/internal/type/base_page.rb +1 -1
- data/lib/brand_dev/internal/type/file_input.rb +7 -4
- data/lib/brand_dev/internal/util.rb +3 -2
- data/lib/brand_dev/models/brand_retrieve_params.rb +94 -3
- data/lib/brand_dev/models/brand_styleguide_params.rb +4 -4
- data/lib/brand_dev/resources/brand.rb +3 -1
- data/lib/brand_dev/version.rb +1 -1
- data/rbi/brand_dev/errors.rbi +29 -2
- data/rbi/brand_dev/file_part.rbi +1 -1
- data/rbi/brand_dev/internal/transport/base_client.rbi +4 -5
- data/rbi/brand_dev/internal/type/base_page.rbi +1 -1
- data/rbi/brand_dev/internal/util.rbi +1 -1
- data/rbi/brand_dev/models/brand_retrieve_params.rbi +411 -4
- data/rbi/brand_dev/models/brand_styleguide_params.rbi +6 -6
- data/rbi/brand_dev/resources/brand.rbi +9 -4
- data/sig/brand_dev/errors.rbs +7 -0
- data/sig/brand_dev/file_part.rbs +1 -1
- data/sig/brand_dev/models/brand_retrieve_params.rbs +162 -0
- data/sig/brand_dev/resources/brand.rbs +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b2a777226800e59bc4e2049b62764ebe941bb521595593edb0b046969fd37d82
|
|
4
|
+
data.tar.gz: 3491f48a0bf45538ad64d0eeb21897a181c60c64d4eaa78987c1f86802b2ea59
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e019fe296386830d0bd10ac02f2720a27a568b6553f9dab0f94e11a52f75b29d8ab9dded416615a1236b32daa00df4d862393dc18c146836449f54594417130e
|
|
7
|
+
data.tar.gz: 247ba3c2617791ee32a412d1547bf7b54723d04ccc979c9fe28ee74d6d2d989f238280763c299e0e410b06c6d280e9c2f3f296d5c41b10ba050a6df56707e469
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.8.0 (2025-10-08)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.7.0...v0.8.0](https://github.com/brand-dot-dev/ruby-sdk/compare/v0.7.0...v0.8.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([fa5a65e](https://github.com/brand-dot-dev/ruby-sdk/commit/fa5a65e269ef946b97bf9fe7f0e9f8dd1239b4e3))
|
|
10
|
+
* **api:** api update ([3c4ec01](https://github.com/brand-dot-dev/ruby-sdk/commit/3c4ec013b262955a26bc2a86100a07b0a28c8e9e))
|
|
11
|
+
* **api:** api update ([e4977c6](https://github.com/brand-dot-dev/ruby-sdk/commit/e4977c64436d23aee0fee29e2a72d912c09e626f))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* always send `filename=...` for multipart requests where a file is expected ([7135624](https://github.com/brand-dot-dev/ruby-sdk/commit/713562474e8ec92fde52cde5329f45c88ba0c594))
|
|
17
|
+
* coroutine leaks from connection pool ([a6e3480](https://github.com/brand-dot-dev/ruby-sdk/commit/a6e348070e779b39f9b80b0ec2fbc9f05910b4b4))
|
|
18
|
+
|
|
19
|
+
## 0.7.0 (2025-09-27)
|
|
20
|
+
|
|
21
|
+
Full Changelog: [v0.6.0...v0.7.0](https://github.com/brand-dot-dev/ruby-sdk/compare/v0.6.0...v0.7.0)
|
|
22
|
+
|
|
23
|
+
### Features
|
|
24
|
+
|
|
25
|
+
* **api:** api update ([1e777a7](https://github.com/brand-dot-dev/ruby-sdk/commit/1e777a71af3ff2e5f0cad6223d05bfcc183fc2fd))
|
|
26
|
+
* expose response headers for both streams and errors ([569c645](https://github.com/brand-dot-dev/ruby-sdk/commit/569c645d77a1432570f2d47ac33c4b30197be2ef))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Bug Fixes
|
|
30
|
+
|
|
31
|
+
* shorten multipart boundary sep to less than RFC specificed max length ([a2e1171](https://github.com/brand-dot-dev/ruby-sdk/commit/a2e11713038013930d3b5b44d4665326e7bafece))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Performance Improvements
|
|
35
|
+
|
|
36
|
+
* faster code formatting ([d65a43b](https://github.com/brand-dot-dev/ruby-sdk/commit/d65a43b02c1ebe517f7119c984a540e435fc2a03))
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Chores
|
|
40
|
+
|
|
41
|
+
* allow fast-format to use bsd sed as well ([88e0856](https://github.com/brand-dot-dev/ruby-sdk/commit/88e0856c917a0bb60e062fafe6a04753c8fb8059))
|
|
42
|
+
* do not install brew dependencies in ./scripts/bootstrap by default ([d067d3a](https://github.com/brand-dot-dev/ruby-sdk/commit/d067d3a622289a081516f2565b3bbd420586e8ac))
|
|
43
|
+
* **internal:** codegen related update ([2629fa5](https://github.com/brand-dot-dev/ruby-sdk/commit/2629fa5004386cd943bbba2da8635b10593fcdca))
|
|
44
|
+
|
|
3
45
|
## 0.6.0 (2025-09-14)
|
|
4
46
|
|
|
5
47
|
Full Changelog: [v0.5.0...v0.6.0](https://github.com/brand-dot-dev/ruby-sdk/compare/v0.5.0...v0.6.0)
|
data/README.md
CHANGED
data/lib/brand_dev/errors.rb
CHANGED
|
@@ -40,6 +40,9 @@ module BrandDev
|
|
|
40
40
|
# @return [Integer, nil]
|
|
41
41
|
attr_accessor :status
|
|
42
42
|
|
|
43
|
+
# @return [Hash{String=>String}, nil]
|
|
44
|
+
attr_accessor :headers
|
|
45
|
+
|
|
43
46
|
# @return [Object, nil]
|
|
44
47
|
attr_accessor :body
|
|
45
48
|
|
|
@@ -47,13 +50,15 @@ module BrandDev
|
|
|
47
50
|
#
|
|
48
51
|
# @param url [URI::Generic]
|
|
49
52
|
# @param status [Integer, nil]
|
|
53
|
+
# @param headers [Hash{String=>String}, nil]
|
|
50
54
|
# @param body [Object, nil]
|
|
51
55
|
# @param request [nil]
|
|
52
56
|
# @param response [nil]
|
|
53
57
|
# @param message [String, nil]
|
|
54
|
-
def initialize(url:, status: nil, body: nil, request: nil, response: nil, message: nil)
|
|
58
|
+
def initialize(url:, status: nil, headers: nil, body: nil, request: nil, response: nil, message: nil)
|
|
55
59
|
@url = url
|
|
56
60
|
@status = status
|
|
61
|
+
@headers = headers
|
|
57
62
|
@body = body
|
|
58
63
|
@request = request
|
|
59
64
|
@response = response
|
|
@@ -74,6 +79,7 @@ module BrandDev
|
|
|
74
79
|
#
|
|
75
80
|
# @param url [URI::Generic]
|
|
76
81
|
# @param status [nil]
|
|
82
|
+
# @param headers [Hash{String=>String}, nil]
|
|
77
83
|
# @param body [nil]
|
|
78
84
|
# @param request [nil]
|
|
79
85
|
# @param response [nil]
|
|
@@ -81,6 +87,7 @@ module BrandDev
|
|
|
81
87
|
def initialize(
|
|
82
88
|
url:,
|
|
83
89
|
status: nil,
|
|
90
|
+
headers: nil,
|
|
84
91
|
body: nil,
|
|
85
92
|
request: nil,
|
|
86
93
|
response: nil,
|
|
@@ -95,6 +102,7 @@ module BrandDev
|
|
|
95
102
|
#
|
|
96
103
|
# @param url [URI::Generic]
|
|
97
104
|
# @param status [nil]
|
|
105
|
+
# @param headers [Hash{String=>String}, nil]
|
|
98
106
|
# @param body [nil]
|
|
99
107
|
# @param request [nil]
|
|
100
108
|
# @param response [nil]
|
|
@@ -102,6 +110,7 @@ module BrandDev
|
|
|
102
110
|
def initialize(
|
|
103
111
|
url:,
|
|
104
112
|
status: nil,
|
|
113
|
+
headers: nil,
|
|
105
114
|
body: nil,
|
|
106
115
|
request: nil,
|
|
107
116
|
response: nil,
|
|
@@ -116,21 +125,24 @@ module BrandDev
|
|
|
116
125
|
#
|
|
117
126
|
# @param url [URI::Generic]
|
|
118
127
|
# @param status [Integer]
|
|
128
|
+
# @param headers [Hash{String=>String}, nil]
|
|
119
129
|
# @param body [Object, nil]
|
|
120
130
|
# @param request [nil]
|
|
121
131
|
# @param response [nil]
|
|
122
132
|
# @param message [String, nil]
|
|
123
133
|
#
|
|
124
134
|
# @return [self]
|
|
125
|
-
def self.for(url:, status:, body:, request:, response:, message: nil)
|
|
126
|
-
kwargs =
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
135
|
+
def self.for(url:, status:, headers:, body:, request:, response:, message: nil)
|
|
136
|
+
kwargs =
|
|
137
|
+
{
|
|
138
|
+
url: url,
|
|
139
|
+
status: status,
|
|
140
|
+
headers: headers,
|
|
141
|
+
body: body,
|
|
142
|
+
request: request,
|
|
143
|
+
response: response,
|
|
144
|
+
message: message
|
|
145
|
+
}
|
|
134
146
|
|
|
135
147
|
case status
|
|
136
148
|
in 400
|
|
@@ -162,15 +174,17 @@ module BrandDev
|
|
|
162
174
|
#
|
|
163
175
|
# @param url [URI::Generic]
|
|
164
176
|
# @param status [Integer]
|
|
177
|
+
# @param headers [Hash{String=>String}, nil]
|
|
165
178
|
# @param body [Object, nil]
|
|
166
179
|
# @param request [nil]
|
|
167
180
|
# @param response [nil]
|
|
168
181
|
# @param message [String, nil]
|
|
169
|
-
def initialize(url:, status:, body:, request:, response:, message: nil)
|
|
182
|
+
def initialize(url:, status:, headers:, body:, request:, response:, message: nil)
|
|
170
183
|
message ||= {url: url.to_s, status: status, body: body}
|
|
171
184
|
super(
|
|
172
185
|
url: url,
|
|
173
186
|
status: status,
|
|
187
|
+
headers: headers,
|
|
174
188
|
body: body,
|
|
175
189
|
request: request,
|
|
176
190
|
response: response,
|
data/lib/brand_dev/file_part.rb
CHANGED
|
@@ -38,18 +38,21 @@ module BrandDev
|
|
|
38
38
|
def to_yaml(*a) = read.to_yaml(*a)
|
|
39
39
|
|
|
40
40
|
# @param content [Pathname, StringIO, IO, String]
|
|
41
|
-
# @param filename [String, nil]
|
|
41
|
+
# @param filename [Pathname, String, nil]
|
|
42
42
|
# @param content_type [String, nil]
|
|
43
43
|
def initialize(content, filename: nil, content_type: nil)
|
|
44
|
-
@
|
|
44
|
+
@content_type = content_type
|
|
45
45
|
@filename =
|
|
46
|
-
case content
|
|
47
|
-
in Pathname
|
|
48
|
-
|
|
46
|
+
case [filename, (@content = content)]
|
|
47
|
+
in [String | Pathname, _]
|
|
48
|
+
::File.basename(filename)
|
|
49
|
+
in [nil, Pathname]
|
|
50
|
+
content.basename.to_path
|
|
51
|
+
in [nil, IO]
|
|
52
|
+
content.to_path
|
|
49
53
|
else
|
|
50
|
-
filename
|
|
54
|
+
filename
|
|
51
55
|
end
|
|
52
|
-
@content_type = content_type
|
|
53
56
|
end
|
|
54
57
|
end
|
|
55
58
|
end
|
|
@@ -47,7 +47,7 @@ module BrandDev
|
|
|
47
47
|
# @api private
|
|
48
48
|
#
|
|
49
49
|
# @param status [Integer]
|
|
50
|
-
# @param headers [Hash{String=>String}
|
|
50
|
+
# @param headers [Hash{String=>String}]
|
|
51
51
|
#
|
|
52
52
|
# @return [Boolean]
|
|
53
53
|
def should_retry?(status, headers:)
|
|
@@ -85,7 +85,7 @@ module BrandDev
|
|
|
85
85
|
#
|
|
86
86
|
# @param status [Integer]
|
|
87
87
|
#
|
|
88
|
-
# @param response_headers [Hash{String=>String}
|
|
88
|
+
# @param response_headers [Hash{String=>String}]
|
|
89
89
|
#
|
|
90
90
|
# @return [Hash{Symbol=>Object}]
|
|
91
91
|
def follow_redirect(request, status:, response_headers:)
|
|
@@ -378,6 +378,7 @@ module BrandDev
|
|
|
378
378
|
rescue BrandDev::Errors::APIConnectionError => e
|
|
379
379
|
status = e
|
|
380
380
|
end
|
|
381
|
+
headers = BrandDev::Internal::Util.normalized_headers(response&.each_header&.to_h)
|
|
381
382
|
|
|
382
383
|
case status
|
|
383
384
|
in ..299
|
|
@@ -390,7 +391,7 @@ module BrandDev
|
|
|
390
391
|
in 300..399
|
|
391
392
|
self.class.reap_connection!(status, stream: stream)
|
|
392
393
|
|
|
393
|
-
request = self.class.follow_redirect(request, status: status, response_headers:
|
|
394
|
+
request = self.class.follow_redirect(request, status: status, response_headers: headers)
|
|
394
395
|
send_request(
|
|
395
396
|
request,
|
|
396
397
|
redirect_count: redirect_count + 1,
|
|
@@ -399,9 +400,9 @@ module BrandDev
|
|
|
399
400
|
)
|
|
400
401
|
in BrandDev::Errors::APIConnectionError if retry_count >= max_retries
|
|
401
402
|
raise status
|
|
402
|
-
in (400..) if retry_count >= max_retries || !self.class.should_retry?(status, headers:
|
|
403
|
+
in (400..) if retry_count >= max_retries || !self.class.should_retry?(status, headers: headers)
|
|
403
404
|
decoded = Kernel.then do
|
|
404
|
-
BrandDev::Internal::Util.decode_content(
|
|
405
|
+
BrandDev::Internal::Util.decode_content(headers, stream: stream, suppress_error: true)
|
|
405
406
|
ensure
|
|
406
407
|
self.class.reap_connection!(status, stream: stream)
|
|
407
408
|
end
|
|
@@ -409,6 +410,7 @@ module BrandDev
|
|
|
409
410
|
raise BrandDev::Errors::APIStatusError.for(
|
|
410
411
|
url: url,
|
|
411
412
|
status: status,
|
|
413
|
+
headers: headers,
|
|
412
414
|
body: decoded,
|
|
413
415
|
request: nil,
|
|
414
416
|
response: response
|
|
@@ -485,19 +487,21 @@ module BrandDev
|
|
|
485
487
|
send_retry_header: send_retry_header
|
|
486
488
|
)
|
|
487
489
|
|
|
488
|
-
|
|
490
|
+
headers = BrandDev::Internal::Util.normalized_headers(response.each_header.to_h)
|
|
491
|
+
decoded = BrandDev::Internal::Util.decode_content(headers, stream: stream)
|
|
489
492
|
case req
|
|
490
493
|
in {stream: Class => st}
|
|
491
494
|
st.new(
|
|
492
495
|
model: model,
|
|
493
496
|
url: url,
|
|
494
497
|
status: status,
|
|
498
|
+
headers: headers,
|
|
495
499
|
response: response,
|
|
496
500
|
unwrap: unwrap,
|
|
497
501
|
stream: decoded
|
|
498
502
|
)
|
|
499
503
|
in {page: Class => page}
|
|
500
|
-
page.new(client: self, req: req, headers:
|
|
504
|
+
page.new(client: self, req: req, headers: headers, page_data: decoded)
|
|
501
505
|
else
|
|
502
506
|
unwrapped = BrandDev::Internal::Util.dig(decoded, unwrap)
|
|
503
507
|
BrandDev::Internal::Type::Converter.coerce(model, unwrapped)
|
|
@@ -134,9 +134,9 @@ module BrandDev
|
|
|
134
134
|
|
|
135
135
|
# rubocop:disable Metrics/BlockLength
|
|
136
136
|
enum = Enumerator.new do |y|
|
|
137
|
-
|
|
138
|
-
next if finished
|
|
137
|
+
next if finished
|
|
139
138
|
|
|
139
|
+
with_pool(url, deadline: deadline) do |conn|
|
|
140
140
|
req, closing = self.class.build_request(request) do
|
|
141
141
|
self.class.calibrate_socket_timeout(conn, deadline)
|
|
142
142
|
end
|
|
@@ -149,7 +149,7 @@ module BrandDev
|
|
|
149
149
|
|
|
150
150
|
self.class.calibrate_socket_timeout(conn, deadline)
|
|
151
151
|
conn.request(req) do |rsp|
|
|
152
|
-
y << [
|
|
152
|
+
y << [req, rsp]
|
|
153
153
|
break if finished
|
|
154
154
|
|
|
155
155
|
rsp.read_body do |bytes|
|
|
@@ -160,6 +160,8 @@ module BrandDev
|
|
|
160
160
|
end
|
|
161
161
|
eof = true
|
|
162
162
|
end
|
|
163
|
+
ensure
|
|
164
|
+
conn.finish if !eof && conn&.started?
|
|
163
165
|
end
|
|
164
166
|
rescue Timeout::Error
|
|
165
167
|
raise BrandDev::Errors::APITimeoutError.new(url: url, request: req)
|
|
@@ -168,16 +170,11 @@ module BrandDev
|
|
|
168
170
|
end
|
|
169
171
|
# rubocop:enable Metrics/BlockLength
|
|
170
172
|
|
|
171
|
-
|
|
173
|
+
_, response = enum.next
|
|
172
174
|
body = BrandDev::Internal::Util.fused_enum(enum, external: true) do
|
|
173
175
|
finished = true
|
|
174
|
-
|
|
175
|
-
enum.next
|
|
176
|
-
rescue StopIteration
|
|
177
|
-
nil
|
|
178
|
-
end
|
|
176
|
+
loop { enum.next }
|
|
179
177
|
ensure
|
|
180
|
-
conn.finish if !eof && conn&.started?
|
|
181
178
|
closing&.call
|
|
182
179
|
end
|
|
183
180
|
[Integer(response.code), response, body]
|
|
@@ -39,7 +39,7 @@ module BrandDev
|
|
|
39
39
|
#
|
|
40
40
|
# @param client [BrandDev::Internal::Transport::BaseClient]
|
|
41
41
|
# @param req [Hash{Symbol=>Object}]
|
|
42
|
-
# @param headers [Hash{String=>String}
|
|
42
|
+
# @param headers [Hash{String=>String}]
|
|
43
43
|
# @param page_data [Object]
|
|
44
44
|
def initialize(client:, req:, headers:, page_data:)
|
|
45
45
|
@client = client
|
|
@@ -82,17 +82,20 @@ module BrandDev
|
|
|
82
82
|
#
|
|
83
83
|
# @return [Pathname, StringIO, IO, String, Object]
|
|
84
84
|
def dump(value, state:)
|
|
85
|
-
# rubocop:disable Lint/DuplicateBranch
|
|
86
85
|
case value
|
|
86
|
+
in StringIO | String
|
|
87
|
+
# https://datatracker.ietf.org/doc/html/rfc7578#section-4.2
|
|
88
|
+
# while not required, a filename is recommended, and in practice many servers do expect this
|
|
89
|
+
BrandDev::FilePart.new(value, filename: "upload")
|
|
87
90
|
in IO
|
|
88
91
|
state[:can_retry] = false
|
|
92
|
+
value.to_path.nil? ? BrandDev::FilePart.new(value, filename: "upload") : value
|
|
89
93
|
in BrandDev::FilePart if value.content.is_a?(IO)
|
|
90
94
|
state[:can_retry] = false
|
|
95
|
+
value
|
|
91
96
|
else
|
|
97
|
+
value
|
|
92
98
|
end
|
|
93
|
-
# rubocop:enable Lint/DuplicateBranch
|
|
94
|
-
|
|
95
|
-
value
|
|
96
99
|
end
|
|
97
100
|
|
|
98
101
|
# @api private
|
|
@@ -566,7 +566,8 @@ module BrandDev
|
|
|
566
566
|
#
|
|
567
567
|
# @return [Array(String, Enumerable<String>)]
|
|
568
568
|
private def encode_multipart_streaming(body)
|
|
569
|
-
|
|
569
|
+
# RFC 1521 Section 7.2.1 says we should have 70 char maximum for boundary length
|
|
570
|
+
boundary = SecureRandom.urlsafe_base64(46)
|
|
570
571
|
|
|
571
572
|
closing = []
|
|
572
573
|
strio = writable_enum do |y|
|
|
@@ -647,7 +648,7 @@ module BrandDev
|
|
|
647
648
|
#
|
|
648
649
|
# Assumes each chunk in stream has `Encoding::BINARY`.
|
|
649
650
|
#
|
|
650
|
-
# @param headers [Hash{String=>String}
|
|
651
|
+
# @param headers [Hash{String=>String}]
|
|
651
652
|
# @param stream [Enumerable<String>]
|
|
652
653
|
# @param suppress_error [Boolean]
|
|
653
654
|
#
|
|
@@ -39,12 +39,19 @@ module BrandDev
|
|
|
39
39
|
|
|
40
40
|
# @!attribute ticker
|
|
41
41
|
# Stock ticker symbol to retrieve brand data for (e.g., 'AAPL', 'GOOGL', 'BRK.A').
|
|
42
|
-
# Must be 1-
|
|
43
|
-
# name parameters.
|
|
42
|
+
# Must be 1-15 characters, letters/numbers/dots only. Cannot be used with domain
|
|
43
|
+
# or name parameters.
|
|
44
44
|
#
|
|
45
45
|
# @return [String, nil]
|
|
46
46
|
optional :ticker, String
|
|
47
47
|
|
|
48
|
+
# @!attribute ticker_exchange
|
|
49
|
+
# Optional stock exchange for the ticker. Only used when ticker parameter is
|
|
50
|
+
# provided. Defaults to assume ticker is American if not specified.
|
|
51
|
+
#
|
|
52
|
+
# @return [Symbol, BrandDev::Models::BrandRetrieveParams::TickerExchange, nil]
|
|
53
|
+
optional :ticker_exchange, enum: -> { BrandDev::BrandRetrieveParams::TickerExchange }
|
|
54
|
+
|
|
48
55
|
# @!attribute timeout_ms
|
|
49
56
|
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
50
57
|
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
@@ -53,7 +60,7 @@ module BrandDev
|
|
|
53
60
|
# @return [Integer, nil]
|
|
54
61
|
optional :timeout_ms, Integer
|
|
55
62
|
|
|
56
|
-
# @!method initialize(domain: nil, force_language: nil, max_speed: nil, name: nil, ticker: nil, timeout_ms: nil, request_options: {})
|
|
63
|
+
# @!method initialize(domain: nil, force_language: nil, max_speed: nil, name: nil, ticker: nil, ticker_exchange: nil, timeout_ms: nil, request_options: {})
|
|
57
64
|
# Some parameter documentations has been truncated, see
|
|
58
65
|
# {BrandDev::Models::BrandRetrieveParams} for more details.
|
|
59
66
|
#
|
|
@@ -67,6 +74,8 @@ module BrandDev
|
|
|
67
74
|
#
|
|
68
75
|
# @param ticker [String] Stock ticker symbol to retrieve brand data for (e.g., 'AAPL', 'GOOGL', 'BRK.A').
|
|
69
76
|
#
|
|
77
|
+
# @param ticker_exchange [Symbol, BrandDev::Models::BrandRetrieveParams::TickerExchange] Optional stock exchange for the ticker. Only used when ticker parameter is provi
|
|
78
|
+
#
|
|
70
79
|
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
|
|
71
80
|
#
|
|
72
81
|
# @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}]
|
|
@@ -132,6 +141,88 @@ module BrandDev
|
|
|
132
141
|
# @!method self.values
|
|
133
142
|
# @return [Array<Symbol>]
|
|
134
143
|
end
|
|
144
|
+
|
|
145
|
+
# Optional stock exchange for the ticker. Only used when ticker parameter is
|
|
146
|
+
# provided. Defaults to assume ticker is American if not specified.
|
|
147
|
+
module TickerExchange
|
|
148
|
+
extend BrandDev::Internal::Type::Enum
|
|
149
|
+
|
|
150
|
+
AMEX = :AMEX
|
|
151
|
+
AMS = :AMS
|
|
152
|
+
AQS = :AQS
|
|
153
|
+
ASX = :ASX
|
|
154
|
+
ATH = :ATH
|
|
155
|
+
BER = :BER
|
|
156
|
+
BME = :BME
|
|
157
|
+
BRU = :BRU
|
|
158
|
+
BSE = :BSE
|
|
159
|
+
BUD = :BUD
|
|
160
|
+
BUE = :BUE
|
|
161
|
+
BVC = :BVC
|
|
162
|
+
CBOE = :CBOE
|
|
163
|
+
CNQ = :CNQ
|
|
164
|
+
CPH = :CPH
|
|
165
|
+
DFM = :DFM
|
|
166
|
+
DOH = :DOH
|
|
167
|
+
DUB = :DUB
|
|
168
|
+
DUS = :DUS
|
|
169
|
+
DXE = :DXE
|
|
170
|
+
EGX = :EGX
|
|
171
|
+
FSX = :FSX
|
|
172
|
+
HAM = :HAM
|
|
173
|
+
HEL = :HEL
|
|
174
|
+
HKSE = :HKSE
|
|
175
|
+
HOSE = :HOSE
|
|
176
|
+
ICE = :ICE
|
|
177
|
+
IOB = :IOB
|
|
178
|
+
IST = :IST
|
|
179
|
+
JKT = :JKT
|
|
180
|
+
JNB = :JNB
|
|
181
|
+
JPX = :JPX
|
|
182
|
+
KLS = :KLS
|
|
183
|
+
KOE = :KOE
|
|
184
|
+
KSC = :KSC
|
|
185
|
+
KUW = :KUW
|
|
186
|
+
LIS = :LIS
|
|
187
|
+
LSE = :LSE
|
|
188
|
+
MCX = :MCX
|
|
189
|
+
MEX = :MEX
|
|
190
|
+
MIL = :MIL
|
|
191
|
+
MUN = :MUN
|
|
192
|
+
NASDAQ = :NASDAQ
|
|
193
|
+
NEO = :NEO
|
|
194
|
+
NSE = :NSE
|
|
195
|
+
NYSE = :NYSE
|
|
196
|
+
NZE = :NZE
|
|
197
|
+
OSL = :OSL
|
|
198
|
+
OTC = :OTC
|
|
199
|
+
PAR = :PAR
|
|
200
|
+
PNK = :PNK
|
|
201
|
+
PRA = :PRA
|
|
202
|
+
RIS = :RIS
|
|
203
|
+
SAO = :SAO
|
|
204
|
+
SAU = :SAU
|
|
205
|
+
SES = :SES
|
|
206
|
+
SET = :SET
|
|
207
|
+
SGO = :SGO
|
|
208
|
+
SHH = :SHH
|
|
209
|
+
SHZ = :SHZ
|
|
210
|
+
SIX = :SIX
|
|
211
|
+
STO = :STO
|
|
212
|
+
STU = :STU
|
|
213
|
+
TAI = :TAI
|
|
214
|
+
TAL = :TAL
|
|
215
|
+
TLV = :TLV
|
|
216
|
+
TSX = :TSX
|
|
217
|
+
TSXV = :TSXV
|
|
218
|
+
TWO = :TWO
|
|
219
|
+
VIE = :VIE
|
|
220
|
+
WSE = :WSE
|
|
221
|
+
XETRA = :XETRA
|
|
222
|
+
|
|
223
|
+
# @!method self.values
|
|
224
|
+
# @return [Array<Symbol>]
|
|
225
|
+
end
|
|
135
226
|
end
|
|
136
227
|
end
|
|
137
228
|
end
|
|
@@ -17,8 +17,8 @@ module BrandDev
|
|
|
17
17
|
# @!attribute prioritize
|
|
18
18
|
# Optional parameter to prioritize screenshot capture for styleguide extraction.
|
|
19
19
|
# If 'speed', optimizes for faster capture with basic quality. If 'quality',
|
|
20
|
-
# optimizes for higher quality with longer wait times. Defaults to '
|
|
21
|
-
# provided.
|
|
20
|
+
# optimizes for higher quality with longer wait times. Defaults to 'quality' if
|
|
21
|
+
# not provided.
|
|
22
22
|
#
|
|
23
23
|
# @return [Symbol, BrandDev::Models::BrandStyleguideParams::Prioritize, nil]
|
|
24
24
|
optional :prioritize, enum: -> { BrandDev::BrandStyleguideParams::Prioritize }
|
|
@@ -45,8 +45,8 @@ module BrandDev
|
|
|
45
45
|
|
|
46
46
|
# Optional parameter to prioritize screenshot capture for styleguide extraction.
|
|
47
47
|
# If 'speed', optimizes for faster capture with basic quality. If 'quality',
|
|
48
|
-
# optimizes for higher quality with longer wait times. Defaults to '
|
|
49
|
-
# provided.
|
|
48
|
+
# optimizes for higher quality with longer wait times. Defaults to 'quality' if
|
|
49
|
+
# not provided.
|
|
50
50
|
module Prioritize
|
|
51
51
|
extend BrandDev::Internal::Type::Enum
|
|
52
52
|
|
|
@@ -9,7 +9,7 @@ module BrandDev
|
|
|
9
9
|
# Retrieve brand information using one of three methods: domain name, company
|
|
10
10
|
# name, or stock ticker symbol. Exactly one of these parameters must be provided.
|
|
11
11
|
#
|
|
12
|
-
# @overload retrieve(domain: nil, force_language: nil, max_speed: nil, name: nil, ticker: nil, timeout_ms: nil, request_options: {})
|
|
12
|
+
# @overload retrieve(domain: nil, force_language: nil, max_speed: nil, name: nil, ticker: nil, ticker_exchange: nil, timeout_ms: nil, request_options: {})
|
|
13
13
|
#
|
|
14
14
|
# @param domain [String] Domain name to retrieve brand data for (e.g., 'example.com', 'google.com'). Cann
|
|
15
15
|
#
|
|
@@ -21,6 +21,8 @@ module BrandDev
|
|
|
21
21
|
#
|
|
22
22
|
# @param ticker [String] Stock ticker symbol to retrieve brand data for (e.g., 'AAPL', 'GOOGL', 'BRK.A').
|
|
23
23
|
#
|
|
24
|
+
# @param ticker_exchange [Symbol, BrandDev::Models::BrandRetrieveParams::TickerExchange] Optional stock exchange for the ticker. Only used when ticker parameter is provi
|
|
25
|
+
#
|
|
24
26
|
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
|
|
25
27
|
#
|
|
26
28
|
# @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
data/lib/brand_dev/version.rb
CHANGED
data/rbi/brand_dev/errors.rbi
CHANGED
|
@@ -33,6 +33,9 @@ module BrandDev
|
|
|
33
33
|
sig { returns(T.nilable(Integer)) }
|
|
34
34
|
attr_accessor :status
|
|
35
35
|
|
|
36
|
+
sig { returns(T.nilable(T::Hash[String, String])) }
|
|
37
|
+
attr_accessor :headers
|
|
38
|
+
|
|
36
39
|
sig { returns(T.nilable(T.anything)) }
|
|
37
40
|
attr_accessor :body
|
|
38
41
|
|
|
@@ -41,6 +44,7 @@ module BrandDev
|
|
|
41
44
|
params(
|
|
42
45
|
url: URI::Generic,
|
|
43
46
|
status: T.nilable(Integer),
|
|
47
|
+
headers: T.nilable(T::Hash[String, String]),
|
|
44
48
|
body: T.nilable(Object),
|
|
45
49
|
request: NilClass,
|
|
46
50
|
response: NilClass,
|
|
@@ -50,6 +54,7 @@ module BrandDev
|
|
|
50
54
|
def self.new(
|
|
51
55
|
url:,
|
|
52
56
|
status: nil,
|
|
57
|
+
headers: nil,
|
|
53
58
|
body: nil,
|
|
54
59
|
request: nil,
|
|
55
60
|
response: nil,
|
|
@@ -70,6 +75,7 @@ module BrandDev
|
|
|
70
75
|
params(
|
|
71
76
|
url: URI::Generic,
|
|
72
77
|
status: NilClass,
|
|
78
|
+
headers: T.nilable(T::Hash[String, String]),
|
|
73
79
|
body: NilClass,
|
|
74
80
|
request: NilClass,
|
|
75
81
|
response: NilClass,
|
|
@@ -79,6 +85,7 @@ module BrandDev
|
|
|
79
85
|
def self.new(
|
|
80
86
|
url:,
|
|
81
87
|
status: nil,
|
|
88
|
+
headers: nil,
|
|
82
89
|
body: nil,
|
|
83
90
|
request: nil,
|
|
84
91
|
response: nil,
|
|
@@ -93,6 +100,7 @@ module BrandDev
|
|
|
93
100
|
params(
|
|
94
101
|
url: URI::Generic,
|
|
95
102
|
status: NilClass,
|
|
103
|
+
headers: T.nilable(T::Hash[String, String]),
|
|
96
104
|
body: NilClass,
|
|
97
105
|
request: NilClass,
|
|
98
106
|
response: NilClass,
|
|
@@ -102,6 +110,7 @@ module BrandDev
|
|
|
102
110
|
def self.new(
|
|
103
111
|
url:,
|
|
104
112
|
status: nil,
|
|
113
|
+
headers: nil,
|
|
105
114
|
body: nil,
|
|
106
115
|
request: nil,
|
|
107
116
|
response: nil,
|
|
@@ -116,13 +125,22 @@ module BrandDev
|
|
|
116
125
|
params(
|
|
117
126
|
url: URI::Generic,
|
|
118
127
|
status: Integer,
|
|
128
|
+
headers: T.nilable(T::Hash[String, String]),
|
|
119
129
|
body: T.nilable(Object),
|
|
120
130
|
request: NilClass,
|
|
121
131
|
response: NilClass,
|
|
122
132
|
message: T.nilable(String)
|
|
123
133
|
).returns(T.attached_class)
|
|
124
134
|
end
|
|
125
|
-
def self.for(
|
|
135
|
+
def self.for(
|
|
136
|
+
url:,
|
|
137
|
+
status:,
|
|
138
|
+
headers:,
|
|
139
|
+
body:,
|
|
140
|
+
request:,
|
|
141
|
+
response:,
|
|
142
|
+
message: nil
|
|
143
|
+
)
|
|
126
144
|
end
|
|
127
145
|
|
|
128
146
|
sig { returns(Integer) }
|
|
@@ -133,13 +151,22 @@ module BrandDev
|
|
|
133
151
|
params(
|
|
134
152
|
url: URI::Generic,
|
|
135
153
|
status: Integer,
|
|
154
|
+
headers: T.nilable(T::Hash[String, String]),
|
|
136
155
|
body: T.nilable(Object),
|
|
137
156
|
request: NilClass,
|
|
138
157
|
response: NilClass,
|
|
139
158
|
message: T.nilable(String)
|
|
140
159
|
).returns(T.attached_class)
|
|
141
160
|
end
|
|
142
|
-
def self.new(
|
|
161
|
+
def self.new(
|
|
162
|
+
url:,
|
|
163
|
+
status:,
|
|
164
|
+
headers:,
|
|
165
|
+
body:,
|
|
166
|
+
request:,
|
|
167
|
+
response:,
|
|
168
|
+
message: nil
|
|
169
|
+
)
|
|
143
170
|
end
|
|
144
171
|
end
|
|
145
172
|
|
data/rbi/brand_dev/file_part.rbi
CHANGED