brand.dev 0.0.1.pre.alpha.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.
Files changed (102) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +229 -0
  3. data/SECURITY.md +23 -0
  4. data/lib/brand_dev/client.rb +74 -0
  5. data/lib/brand_dev/errors.rb +192 -0
  6. data/lib/brand_dev/file_part.rb +55 -0
  7. data/lib/brand_dev/internal/transport/base_client.rb +555 -0
  8. data/lib/brand_dev/internal/transport/pooled_net_requester.rb +209 -0
  9. data/lib/brand_dev/internal/type/array_of.rb +162 -0
  10. data/lib/brand_dev/internal/type/base_model.rb +484 -0
  11. data/lib/brand_dev/internal/type/base_page.rb +55 -0
  12. data/lib/brand_dev/internal/type/boolean.rb +71 -0
  13. data/lib/brand_dev/internal/type/converter.rb +292 -0
  14. data/lib/brand_dev/internal/type/enum.rb +120 -0
  15. data/lib/brand_dev/internal/type/file_input.rb +103 -0
  16. data/lib/brand_dev/internal/type/hash_of.rb +182 -0
  17. data/lib/brand_dev/internal/type/request_parameters.rb +42 -0
  18. data/lib/brand_dev/internal/type/union.rb +227 -0
  19. data/lib/brand_dev/internal/type/unknown.rb +75 -0
  20. data/lib/brand_dev/internal/util.rb +915 -0
  21. data/lib/brand_dev/internal.rb +20 -0
  22. data/lib/brand_dev/models/brand_identify_from_transaction_params.rb +22 -0
  23. data/lib/brand_dev/models/brand_identify_from_transaction_response.rb +435 -0
  24. data/lib/brand_dev/models/brand_retrieve_by_ticker_params.rb +22 -0
  25. data/lib/brand_dev/models/brand_retrieve_by_ticker_response.rb +432 -0
  26. data/lib/brand_dev/models/brand_retrieve_naics_params.rb +27 -0
  27. data/lib/brand_dev/models/brand_retrieve_naics_response.rb +61 -0
  28. data/lib/brand_dev/models/brand_retrieve_params.rb +91 -0
  29. data/lib/brand_dev/models/brand_retrieve_response.rb +432 -0
  30. data/lib/brand_dev/models/brand_search_params.rb +22 -0
  31. data/lib/brand_dev/models/brand_search_response.rb +35 -0
  32. data/lib/brand_dev/models.rb +51 -0
  33. data/lib/brand_dev/request_options.rb +77 -0
  34. data/lib/brand_dev/resources/brand.rb +130 -0
  35. data/lib/brand_dev/version.rb +5 -0
  36. data/lib/brand_dev.rb +64 -0
  37. data/manifest.yaml +15 -0
  38. data/rbi/brand_dev/client.rbi +49 -0
  39. data/rbi/brand_dev/errors.rbi +162 -0
  40. data/rbi/brand_dev/file_part.rbi +37 -0
  41. data/rbi/brand_dev/internal/transport/base_client.rbi +293 -0
  42. data/rbi/brand_dev/internal/transport/pooled_net_requester.rbi +79 -0
  43. data/rbi/brand_dev/internal/type/array_of.rbi +104 -0
  44. data/rbi/brand_dev/internal/type/base_model.rbi +302 -0
  45. data/rbi/brand_dev/internal/type/base_page.rbi +42 -0
  46. data/rbi/brand_dev/internal/type/boolean.rbi +56 -0
  47. data/rbi/brand_dev/internal/type/converter.rbi +162 -0
  48. data/rbi/brand_dev/internal/type/enum.rbi +82 -0
  49. data/rbi/brand_dev/internal/type/file_input.rbi +59 -0
  50. data/rbi/brand_dev/internal/type/hash_of.rbi +104 -0
  51. data/rbi/brand_dev/internal/type/request_parameters.rbi +29 -0
  52. data/rbi/brand_dev/internal/type/union.rbi +116 -0
  53. data/rbi/brand_dev/internal/type/unknown.rbi +56 -0
  54. data/rbi/brand_dev/internal/util.rbi +485 -0
  55. data/rbi/brand_dev/internal.rbi +16 -0
  56. data/rbi/brand_dev/models/brand_identify_from_transaction_params.rbi +46 -0
  57. data/rbi/brand_dev/models/brand_identify_from_transaction_response.rbi +981 -0
  58. data/rbi/brand_dev/models/brand_retrieve_by_ticker_params.rbi +43 -0
  59. data/rbi/brand_dev/models/brand_retrieve_by_ticker_response.rbi +976 -0
  60. data/rbi/brand_dev/models/brand_retrieve_naics_params.rbi +44 -0
  61. data/rbi/brand_dev/models/brand_retrieve_naics_response.rbi +127 -0
  62. data/rbi/brand_dev/models/brand_retrieve_params.rbi +344 -0
  63. data/rbi/brand_dev/models/brand_retrieve_response.rbi +949 -0
  64. data/rbi/brand_dev/models/brand_search_params.rbi +40 -0
  65. data/rbi/brand_dev/models/brand_search_response.rbi +63 -0
  66. data/rbi/brand_dev/models.rbi +14 -0
  67. data/rbi/brand_dev/request_options.rbi +59 -0
  68. data/rbi/brand_dev/resources/brand.rbi +89 -0
  69. data/rbi/brand_dev/version.rbi +5 -0
  70. data/sig/brand_dev/client.rbs +26 -0
  71. data/sig/brand_dev/errors.rbs +101 -0
  72. data/sig/brand_dev/file_part.rbs +21 -0
  73. data/sig/brand_dev/internal/transport/base_client.rbs +131 -0
  74. data/sig/brand_dev/internal/transport/pooled_net_requester.rbs +45 -0
  75. data/sig/brand_dev/internal/type/array_of.rbs +48 -0
  76. data/sig/brand_dev/internal/type/base_model.rbs +102 -0
  77. data/sig/brand_dev/internal/type/base_page.rbs +24 -0
  78. data/sig/brand_dev/internal/type/boolean.rbs +26 -0
  79. data/sig/brand_dev/internal/type/converter.rbs +56 -0
  80. data/sig/brand_dev/internal/type/enum.rbs +32 -0
  81. data/sig/brand_dev/internal/type/file_input.rbs +25 -0
  82. data/sig/brand_dev/internal/type/hash_of.rbs +48 -0
  83. data/sig/brand_dev/internal/type/request_parameters.rbs +17 -0
  84. data/sig/brand_dev/internal/type/union.rbs +52 -0
  85. data/sig/brand_dev/internal/type/unknown.rbs +26 -0
  86. data/sig/brand_dev/internal/util.rbs +185 -0
  87. data/sig/brand_dev/internal.rbs +9 -0
  88. data/sig/brand_dev/models/brand_identify_from_transaction_params.rbs +24 -0
  89. data/sig/brand_dev/models/brand_identify_from_transaction_response.rbs +418 -0
  90. data/sig/brand_dev/models/brand_retrieve_by_ticker_params.rbs +23 -0
  91. data/sig/brand_dev/models/brand_retrieve_by_ticker_response.rbs +418 -0
  92. data/sig/brand_dev/models/brand_retrieve_naics_params.rbs +23 -0
  93. data/sig/brand_dev/models/brand_retrieve_naics_response.rbs +61 -0
  94. data/sig/brand_dev/models/brand_retrieve_params.rbs +148 -0
  95. data/sig/brand_dev/models/brand_retrieve_response.rbs +418 -0
  96. data/sig/brand_dev/models/brand_search_params.rbs +23 -0
  97. data/sig/brand_dev/models/brand_search_response.rbs +29 -0
  98. data/sig/brand_dev/models.rbs +11 -0
  99. data/sig/brand_dev/request_options.rbs +34 -0
  100. data/sig/brand_dev/resources/brand.rbs +33 -0
  101. data/sig/brand_dev/version.rbs +3 -0
  102. metadata +160 -0
@@ -0,0 +1,40 @@
1
+ # typed: strong
2
+
3
+ module BrandDev
4
+ module Models
5
+ class BrandSearchParams < 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::BrandSearchParams, BrandDev::Internal::AnyHash)
12
+ end
13
+
14
+ # Query string to search brands
15
+ sig { returns(String) }
16
+ attr_accessor :query
17
+
18
+ sig do
19
+ params(
20
+ query: String,
21
+ request_options: BrandDev::RequestOptions::OrHash
22
+ ).returns(T.attached_class)
23
+ end
24
+ def self.new(
25
+ # Query string to search brands
26
+ query:,
27
+ request_options: {}
28
+ )
29
+ end
30
+
31
+ sig do
32
+ override.returns(
33
+ { query: String, request_options: BrandDev::RequestOptions }
34
+ )
35
+ end
36
+ def to_hash
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,63 @@
1
+ # typed: strong
2
+
3
+ module BrandDev
4
+ module Models
5
+ class BrandSearchResponseItem < BrandDev::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ BrandDev::Models::BrandSearchResponseItem,
10
+ BrandDev::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # Domain name of the brand
15
+ sig { returns(T.nilable(String)) }
16
+ attr_reader :domain
17
+
18
+ sig { params(domain: String).void }
19
+ attr_writer :domain
20
+
21
+ # URL of the brand's logo
22
+ sig { returns(T.nilable(String)) }
23
+ attr_reader :logo
24
+
25
+ sig { params(logo: String).void }
26
+ attr_writer :logo
27
+
28
+ # Title or name of the brand
29
+ sig { returns(T.nilable(String)) }
30
+ attr_reader :title
31
+
32
+ sig { params(title: String).void }
33
+ attr_writer :title
34
+
35
+ sig do
36
+ params(domain: String, logo: String, title: String).returns(
37
+ T.attached_class
38
+ )
39
+ end
40
+ def self.new(
41
+ # Domain name of the brand
42
+ domain: nil,
43
+ # URL of the brand's logo
44
+ logo: nil,
45
+ # Title or name of the brand
46
+ title: nil
47
+ )
48
+ end
49
+
50
+ sig { override.returns({ domain: String, logo: String, title: String }) }
51
+ def to_hash
52
+ end
53
+ end
54
+
55
+ BrandSearchResponse =
56
+ T.let(
57
+ BrandDev::Internal::Type::ArrayOf[
58
+ BrandDev::Models::BrandSearchResponseItem
59
+ ],
60
+ BrandDev::Internal::Type::Converter
61
+ )
62
+ end
63
+ end
@@ -0,0 +1,14 @@
1
+ # typed: strong
2
+
3
+ module BrandDev
4
+ BrandIdentifyFromTransactionParams =
5
+ BrandDev::Models::BrandIdentifyFromTransactionParams
6
+
7
+ BrandRetrieveByTickerParams = BrandDev::Models::BrandRetrieveByTickerParams
8
+
9
+ BrandRetrieveNaicsParams = BrandDev::Models::BrandRetrieveNaicsParams
10
+
11
+ BrandRetrieveParams = BrandDev::Models::BrandRetrieveParams
12
+
13
+ BrandSearchParams = BrandDev::Models::BrandSearchParams
14
+ end
@@ -0,0 +1,59 @@
1
+ # typed: strong
2
+
3
+ module BrandDev
4
+ # Specify HTTP behaviour to use for a specific request. These options supplement
5
+ # or override those provided at the client level.
6
+ #
7
+ # When making a request, you can pass an actual {RequestOptions} instance, or
8
+ # simply pass a Hash with symbol keys matching the attributes on this class.
9
+ class RequestOptions < BrandDev::Internal::Type::BaseModel
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(BrandDev::RequestOptions, BrandDev::Internal::AnyHash)
13
+ end
14
+
15
+ # @api private
16
+ sig { params(opts: BrandDev::RequestOptions::OrHash).void }
17
+ def self.validate!(opts)
18
+ end
19
+
20
+ # Idempotency key to send with request and all associated retries. Will only be
21
+ # sent for write requests.
22
+ sig { returns(T.nilable(String)) }
23
+ attr_accessor :idempotency_key
24
+
25
+ # Extra query params to send with the request. These are `.merge`’d into any
26
+ # `query` given at the client level.
27
+ sig do
28
+ returns(
29
+ T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))])
30
+ )
31
+ end
32
+ attr_accessor :extra_query
33
+
34
+ # Extra headers to send with the request. These are `.merged`’d into any
35
+ # `extra_headers` given at the client level.
36
+ sig { returns(T.nilable(T::Hash[String, T.nilable(String)])) }
37
+ attr_accessor :extra_headers
38
+
39
+ # Extra data to send with the request. These are deep merged into any data
40
+ # generated as part of the normal request.
41
+ sig { returns(T.nilable(T.anything)) }
42
+ attr_accessor :extra_body
43
+
44
+ # Maximum number of retries to attempt after a failed initial request.
45
+ sig { returns(T.nilable(Integer)) }
46
+ attr_accessor :max_retries
47
+
48
+ # Request timeout in seconds.
49
+ sig { returns(T.nilable(Float)) }
50
+ attr_accessor :timeout
51
+
52
+ # Returns a new instance of RequestOptions.
53
+ sig do
54
+ params(values: BrandDev::Internal::AnyHash).returns(T.attached_class)
55
+ end
56
+ def self.new(values = {})
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,89 @@
1
+ # typed: strong
2
+
3
+ module BrandDev
4
+ module Resources
5
+ class Brand
6
+ # Retrieve brand data by domain
7
+ sig do
8
+ params(
9
+ domain: String,
10
+ force_language:
11
+ BrandDev::BrandRetrieveParams::ForceLanguage::OrSymbol,
12
+ request_options: BrandDev::RequestOptions::OrHash
13
+ ).returns(BrandDev::Models::BrandRetrieveResponse)
14
+ end
15
+ def retrieve(
16
+ # Domain name to retrieve brand data for
17
+ domain:,
18
+ # Optional parameter to force the language of the retrieved brand data
19
+ force_language: nil,
20
+ request_options: {}
21
+ )
22
+ end
23
+
24
+ # Endpoint specially designed for platforms that want to identify transaction data
25
+ # by the transaction title.
26
+ sig do
27
+ params(
28
+ transaction_info: String,
29
+ request_options: BrandDev::RequestOptions::OrHash
30
+ ).returns(BrandDev::Models::BrandIdentifyFromTransactionResponse)
31
+ end
32
+ def identify_from_transaction(
33
+ # Transaction information to identify the brand
34
+ transaction_info:,
35
+ request_options: {}
36
+ )
37
+ end
38
+
39
+ # Retrieve brand data by stock ticker (e.g. AAPL, TSLA, etc.)
40
+ sig do
41
+ params(
42
+ ticker: String,
43
+ request_options: BrandDev::RequestOptions::OrHash
44
+ ).returns(BrandDev::Models::BrandRetrieveByTickerResponse)
45
+ end
46
+ def retrieve_by_ticker(
47
+ # Stock ticker symbol to retrieve brand data for (e.g. AAPL, TSLA, etc.)
48
+ ticker:,
49
+ request_options: {}
50
+ )
51
+ end
52
+
53
+ # Endpoint to classify any brand into a 2022 NAICS code.
54
+ sig do
55
+ params(
56
+ input: String,
57
+ request_options: BrandDev::RequestOptions::OrHash
58
+ ).returns(BrandDev::Models::BrandRetrieveNaicsResponse)
59
+ end
60
+ def retrieve_naics(
61
+ # Brand domain or title to retrieve NAICS code for. If a valid domain is provided
62
+ # in `input`, it will be used for classification, otherwise, we will search for
63
+ # the brand using the provided title.
64
+ input:,
65
+ request_options: {}
66
+ )
67
+ end
68
+
69
+ # Search brands by query
70
+ sig do
71
+ params(
72
+ query: String,
73
+ request_options: BrandDev::RequestOptions::OrHash
74
+ ).returns(T::Array[BrandDev::Models::BrandSearchResponseItem])
75
+ end
76
+ def search(
77
+ # Query string to search brands
78
+ query:,
79
+ request_options: {}
80
+ )
81
+ end
82
+
83
+ # @api private
84
+ sig { params(client: BrandDev::Client).returns(T.attached_class) }
85
+ def self.new(client:)
86
+ end
87
+ end
88
+ end
89
+ end
@@ -0,0 +1,5 @@
1
+ # typed: strong
2
+
3
+ module BrandDev
4
+ VERSION = T.let(T.unsafe(nil), String)
5
+ end
@@ -0,0 +1,26 @@
1
+ module BrandDev
2
+ class Client < BrandDev::Internal::Transport::BaseClient
3
+ DEFAULT_MAX_RETRIES: 2
4
+
5
+ DEFAULT_TIMEOUT_IN_SECONDS: Float
6
+
7
+ DEFAULT_INITIAL_RETRY_DELAY: Float
8
+
9
+ DEFAULT_MAX_RETRY_DELAY: Float
10
+
11
+ attr_reader api_key: String
12
+
13
+ attr_reader brand: BrandDev::Resources::Brand
14
+
15
+ private def auth_headers: -> ::Hash[String, String]
16
+
17
+ def initialize: (
18
+ ?api_key: String?,
19
+ ?base_url: String?,
20
+ ?max_retries: Integer,
21
+ ?timeout: Float,
22
+ ?initial_retry_delay: Float,
23
+ ?max_retry_delay: Float
24
+ ) -> void
25
+ end
26
+ end
@@ -0,0 +1,101 @@
1
+ module BrandDev
2
+ module Errors
3
+ class Error < StandardError
4
+ attr_accessor cause: StandardError?
5
+ end
6
+
7
+ class ConversionError < BrandDev::Errors::Error
8
+ end
9
+
10
+ class APIError < BrandDev::Errors::Error
11
+ attr_accessor url: URI::Generic
12
+
13
+ attr_accessor status: Integer?
14
+
15
+ attr_accessor body: top?
16
+
17
+ def initialize: (
18
+ url: URI::Generic,
19
+ ?status: Integer?,
20
+ ?body: Object?,
21
+ ?request: nil,
22
+ ?response: nil,
23
+ ?message: String?
24
+ ) -> void
25
+ end
26
+
27
+ class APIConnectionError < BrandDev::Errors::APIError
28
+ def initialize: (
29
+ url: URI::Generic,
30
+ ?status: nil,
31
+ ?body: nil,
32
+ ?request: nil,
33
+ ?response: nil,
34
+ ?message: String?
35
+ ) -> void
36
+ end
37
+
38
+ class APITimeoutError < BrandDev::Errors::APIConnectionError
39
+ def initialize: (
40
+ url: URI::Generic,
41
+ ?status: nil,
42
+ ?body: nil,
43
+ ?request: nil,
44
+ ?response: nil,
45
+ ?message: String?
46
+ ) -> void
47
+ end
48
+
49
+ class APIStatusError < BrandDev::Errors::APIError
50
+ def self.for: (
51
+ url: URI::Generic,
52
+ status: Integer,
53
+ body: Object?,
54
+ request: nil,
55
+ response: nil,
56
+ ?message: String?
57
+ ) -> instance
58
+
59
+ def initialize: (
60
+ url: URI::Generic,
61
+ status: Integer,
62
+ body: Object?,
63
+ request: nil,
64
+ response: nil,
65
+ ?message: String?
66
+ ) -> void
67
+ end
68
+
69
+ class BadRequestError < BrandDev::Errors::APIStatusError
70
+ HTTP_STATUS: 400
71
+ end
72
+
73
+ class AuthenticationError < BrandDev::Errors::APIStatusError
74
+ HTTP_STATUS: 401
75
+ end
76
+
77
+ class PermissionDeniedError < BrandDev::Errors::APIStatusError
78
+ HTTP_STATUS: 403
79
+ end
80
+
81
+ class NotFoundError < BrandDev::Errors::APIStatusError
82
+ HTTP_STATUS: 404
83
+ end
84
+
85
+ class ConflictError < BrandDev::Errors::APIStatusError
86
+ HTTP_STATUS: 409
87
+ end
88
+
89
+ class UnprocessableEntityError < BrandDev::Errors::APIStatusError
90
+ HTTP_STATUS: 422
91
+ end
92
+
93
+ class RateLimitError < BrandDev::Errors::APIStatusError
94
+ HTTP_STATUS: 429
95
+ end
96
+
97
+ class InternalServerError < BrandDev::Errors::APIStatusError
98
+ HTTP_STATUS: Range[Integer]
99
+ end
100
+ end
101
+ end
@@ -0,0 +1,21 @@
1
+ module BrandDev
2
+ class FilePart
3
+ attr_reader content: Pathname | StringIO | IO | String
4
+
5
+ attr_reader content_type: String?
6
+
7
+ attr_reader filename: String?
8
+
9
+ private def read: -> String
10
+
11
+ def to_json: (*top a) -> String
12
+
13
+ def to_yaml: (*top a) -> String
14
+
15
+ def initialize: (
16
+ Pathname | StringIO | IO | String content,
17
+ ?filename: String?,
18
+ ?content_type: String?
19
+ ) -> void
20
+ end
21
+ end
@@ -0,0 +1,131 @@
1
+ module BrandDev
2
+ module Internal
3
+ module Transport
4
+ class BaseClient
5
+ extend BrandDev::Internal::Util::SorbetRuntimeSupport
6
+
7
+ type request_components =
8
+ {
9
+ method: Symbol,
10
+ path: String | ::Array[String],
11
+ query: ::Hash[String, (::Array[String] | String)?]?,
12
+ headers: ::Hash[String, (String
13
+ | Integer
14
+ | ::Array[(String | Integer)?])?]?,
15
+ body: top?,
16
+ unwrap: (Symbol
17
+ | Integer
18
+ | ::Array[(Symbol | Integer)]
19
+ | (^(top arg0) -> top))?,
20
+ page: Class?,
21
+ stream: Class?,
22
+ model: BrandDev::Internal::Type::Converter::input?,
23
+ options: BrandDev::request_opts?
24
+ }
25
+ type request_input =
26
+ {
27
+ method: Symbol,
28
+ url: URI::Generic,
29
+ headers: ::Hash[String, String],
30
+ body: top,
31
+ max_retries: Integer,
32
+ timeout: Float
33
+ }
34
+
35
+ MAX_REDIRECTS: 20
36
+
37
+ PLATFORM_HEADERS: ::Hash[String, String]
38
+
39
+ def self.validate!: (
40
+ BrandDev::Internal::Transport::BaseClient::request_components req
41
+ ) -> void
42
+
43
+ def self.should_retry?: (
44
+ Integer status,
45
+ headers: ::Hash[String, String]
46
+ ) -> bool
47
+
48
+ def self.follow_redirect: (
49
+ BrandDev::Internal::Transport::BaseClient::request_input request,
50
+ status: Integer,
51
+ response_headers: ::Hash[String, String]
52
+ ) -> BrandDev::Internal::Transport::BaseClient::request_input
53
+
54
+ def self.reap_connection!: (
55
+ Integer | BrandDev::Errors::APIConnectionError status,
56
+ stream: Enumerable[String]?
57
+ ) -> void
58
+
59
+ attr_reader base_url: URI::Generic
60
+
61
+ attr_reader timeout: Float
62
+
63
+ attr_reader max_retries: Integer
64
+
65
+ attr_reader initial_retry_delay: Float
66
+
67
+ attr_reader max_retry_delay: Float
68
+
69
+ attr_reader headers: ::Hash[String, String]
70
+
71
+ attr_reader idempotency_header: String?
72
+
73
+ # @api private
74
+ attr_reader requester: BrandDev::Internal::Transport::PooledNetRequester
75
+
76
+ def initialize: (
77
+ base_url: String,
78
+ ?timeout: Float,
79
+ ?max_retries: Integer,
80
+ ?initial_retry_delay: Float,
81
+ ?max_retry_delay: Float,
82
+ ?headers: ::Hash[String, (String
83
+ | Integer
84
+ | ::Array[(String | Integer)?])?],
85
+ ?idempotency_header: String?
86
+ ) -> void
87
+
88
+ private def auth_headers: -> ::Hash[String, String]
89
+
90
+ private def generate_idempotency_key: -> String
91
+
92
+ private def build_request: (
93
+ BrandDev::Internal::Transport::BaseClient::request_components req,
94
+ BrandDev::request_options opts
95
+ ) -> BrandDev::Internal::Transport::BaseClient::request_input
96
+
97
+ private def retry_delay: (
98
+ ::Hash[String, String] headers,
99
+ retry_count: Integer
100
+ ) -> Float
101
+
102
+ private def send_request: (
103
+ BrandDev::Internal::Transport::BaseClient::request_input request,
104
+ redirect_count: Integer,
105
+ retry_count: Integer,
106
+ send_retry_header: bool
107
+ ) -> [Integer, top, Enumerable[String]]
108
+
109
+ def request: (
110
+ Symbol method,
111
+ String | ::Array[String] path,
112
+ ?query: ::Hash[String, (::Array[String] | String)?]?,
113
+ ?headers: ::Hash[String, (String
114
+ | Integer
115
+ | ::Array[(String | Integer)?])?]?,
116
+ ?body: top?,
117
+ ?unwrap: (Symbol
118
+ | Integer
119
+ | ::Array[(Symbol | Integer)]
120
+ | (^(top arg0) -> top))?,
121
+ ?page: Class?,
122
+ ?stream: Class?,
123
+ ?model: BrandDev::Internal::Type::Converter::input?,
124
+ ?options: BrandDev::request_opts?
125
+ ) -> top
126
+
127
+ def inspect: -> String
128
+ end
129
+ end
130
+ end
131
+ end
@@ -0,0 +1,45 @@
1
+ module BrandDev
2
+ module Internal
3
+ module Transport
4
+ class PooledNetRequester
5
+ extend BrandDev::Internal::Util::SorbetRuntimeSupport
6
+
7
+ type request =
8
+ {
9
+ method: Symbol,
10
+ url: URI::Generic,
11
+ headers: ::Hash[String, String],
12
+ body: top,
13
+ deadline: Float
14
+ }
15
+
16
+ KEEP_ALIVE_TIMEOUT: 30
17
+
18
+ DEFAULT_MAX_CONNECTIONS: Integer
19
+
20
+ def self.connect: (URI::Generic url) -> top
21
+
22
+ def self.calibrate_socket_timeout: (top conn, Float deadline) -> void
23
+
24
+ def self.build_request: (
25
+ BrandDev::Internal::Transport::PooledNetRequester::request request
26
+ ) {
27
+ (String arg0) -> void
28
+ } -> [top, (^-> void)]
29
+
30
+ private def with_pool: (
31
+ URI::Generic url,
32
+ deadline: Float
33
+ ) {
34
+ (top arg0) -> void
35
+ } -> void
36
+
37
+ def execute: (
38
+ BrandDev::Internal::Transport::PooledNetRequester::request request
39
+ ) -> [Integer, top, Enumerable[String]]
40
+
41
+ def initialize: (?size: Integer) -> void
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,48 @@
1
+ module BrandDev
2
+ module Internal
3
+ module Type
4
+ class ArrayOf[Elem]
5
+ include BrandDev::Internal::Type::Converter
6
+ include BrandDev::Internal::Util::SorbetRuntimeSupport
7
+
8
+ def self.[]: (
9
+ ::Hash[Symbol, top]
10
+ | ^-> BrandDev::Internal::Type::Converter::input
11
+ | BrandDev::Internal::Type::Converter::input type_info,
12
+ ?::Hash[Symbol, top] spec
13
+ ) -> instance
14
+
15
+ def ===: (top other) -> bool
16
+
17
+ def ==: (top other) -> bool
18
+
19
+ def hash: -> Integer
20
+
21
+ def coerce: (
22
+ ::Array[top] | top value,
23
+ state: BrandDev::Internal::Type::Converter::coerce_state
24
+ ) -> (::Array[top] | top)
25
+
26
+ def dump: (
27
+ ::Array[top] | top value,
28
+ state: BrandDev::Internal::Type::Converter::dump_state
29
+ ) -> (::Array[top] | top)
30
+
31
+ def to_sorbet_type: -> top
32
+
33
+ def item_type: -> Elem
34
+
35
+ def nilable?: -> bool
36
+
37
+ def initialize: (
38
+ ::Hash[Symbol, top]
39
+ | ^-> BrandDev::Internal::Type::Converter::input
40
+ | BrandDev::Internal::Type::Converter::input type_info,
41
+ ?::Hash[Symbol, top] spec
42
+ ) -> void
43
+
44
+ def inspect: (?depth: Integer) -> String
45
+ end
46
+ end
47
+ end
48
+ end