kintsugi_sdk 5.7.0 → 5.7.1
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/lib/kintsugi_sdk/addressvalidation.rb +21 -21
- data/lib/kintsugi_sdk/customers.rb +55 -55
- data/lib/kintsugi_sdk/exemptions.rb +44 -44
- data/lib/kintsugi_sdk/models/errors/apierror.rb +1 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_address_validation_responses_validationerrorresponse.rb +1 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_customers_responses_validationerrorresponse.rb +1 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_exemptions_responses_validationerrorresponse.rb +1 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_products_schemas_responses_validationerrorresponse.rb +1 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_tax_estimation_responses_validationerrorresponse.rb +1 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_transactions_responses_validationerrorresponse.rb +1 -1
- data/lib/kintsugi_sdk/models/errors/errorresponse.rb +1 -1
- data/lib/kintsugi_sdk/models/errors/httpvalidationerror.rb +1 -1
- data/lib/kintsugi_sdk/models/ops/get_exemptions_v1_exemptions_get_request.rb +2 -2
- data/lib/kintsugi_sdk/models/shared/backend_src_address_validation_responses_validationerroritem.rb +2 -2
- data/lib/kintsugi_sdk/models/shared/backend_src_customers_responses_validationerroritem.rb +2 -2
- data/lib/kintsugi_sdk/models/shared/backend_src_exemptions_responses_validationerroritem.rb +2 -2
- data/lib/kintsugi_sdk/models/shared/backend_src_exemptions_schemas_exemption_exemptionread.rb +6 -2
- data/lib/kintsugi_sdk/models/shared/backend_src_exemptions_schemas_exemption_exemptionread.rbi +2 -0
- data/lib/kintsugi_sdk/models/shared/backend_src_exemptions_serializers_exemptionread.rb +6 -2
- data/lib/kintsugi_sdk/models/shared/backend_src_exemptions_serializers_exemptionread.rbi +2 -0
- data/lib/kintsugi_sdk/models/shared/backend_src_products_schemas_responses_validationerroritem.rb +2 -2
- data/lib/kintsugi_sdk/models/shared/backend_src_tax_estimation_responses_validationerroritem.rb +2 -2
- data/lib/kintsugi_sdk/models/shared/backend_src_transactions_responses_validationerroritem.rb +2 -2
- data/lib/kintsugi_sdk/models/shared/currencyenum.rb +1 -1
- data/lib/kintsugi_sdk/models/shared/exemptioncreate.rb +6 -2
- data/lib/kintsugi_sdk/models/shared/exemptioncreate.rbi +2 -0
- data/lib/kintsugi_sdk/models/shared/exemptionsourceenum.rb +4 -0
- data/lib/kintsugi_sdk/models/shared/exemptiontype.rb +1 -0
- data/lib/kintsugi_sdk/models/shared/nexusresponse.rb +31 -21
- data/lib/kintsugi_sdk/models/shared/nexusresponse.rbi +6 -4
- data/lib/kintsugi_sdk/models/shared/productread.rb +4 -6
- data/lib/kintsugi_sdk/models/shared/relatedentitytype.rb +4 -0
- data/lib/kintsugi_sdk/models/shared/sourceenum.rb +8 -0
- data/lib/kintsugi_sdk/models/shared/taxexemptionenum.rb +1 -0
- data/lib/kintsugi_sdk/models/shared/taxitemreturnreasonenum.rb +2 -0
- data/lib/kintsugi_sdk/models/shared/taxtypeenum.rb +7 -3
- data/lib/kintsugi_sdk/models/shared/transactioncreate.rb +8 -4
- data/lib/kintsugi_sdk/models/shared/transactioncreate.rbi +2 -0
- data/lib/kintsugi_sdk/models/shared/{exemption.rb → transactionembeddedexemption.rb} +17 -4
- data/lib/kintsugi_sdk/models/shared/{exemption.rbi → transactionembeddedexemption.rbi} +4 -2
- data/lib/kintsugi_sdk/models/shared/transactionestimatepublicrequest.rb +1 -1
- data/lib/kintsugi_sdk/models/shared/transactionestimateresponse.rb +1 -1
- data/lib/kintsugi_sdk/models/shared/transactionitembuilder.rb +6 -2
- data/lib/kintsugi_sdk/models/shared/transactionitembuilder.rbi +2 -0
- data/lib/kintsugi_sdk/models/shared/transactionitemcreateupdate.rb +6 -2
- data/lib/kintsugi_sdk/models/shared/transactionitemcreateupdate.rbi +2 -0
- data/lib/kintsugi_sdk/models/shared/transactionitemestimatebase.rb +1 -3
- data/lib/kintsugi_sdk/models/shared/transactionitemestimateresponse.rb +1 -3
- data/lib/kintsugi_sdk/models/shared/transactionitemread.rb +15 -3
- data/lib/kintsugi_sdk/models/shared/transactionitemread.rbi +6 -0
- data/lib/kintsugi_sdk/models/shared/transactionpublicrequest.rb +8 -4
- data/lib/kintsugi_sdk/models/shared/transactionpublicrequest.rbi +2 -0
- data/lib/kintsugi_sdk/models/shared/transactionread.rb +21 -5
- data/lib/kintsugi_sdk/models/shared/transactionread.rbi +8 -0
- data/lib/kintsugi_sdk/models/shared/transactionupdate.rb +8 -4
- data/lib/kintsugi_sdk/models/shared/transactionupdate.rbi +2 -0
- data/lib/kintsugi_sdk/models/shared/usetaxregistrationpath.rb +24 -0
- data/lib/kintsugi_sdk/models/shared/usetaxregistrationpath.rbi +11 -0
- data/lib/kintsugi_sdk/models/shared.rb +2 -1
- data/lib/kintsugi_sdk/nexus.rb +7 -7
- data/lib/kintsugi_sdk/openapisdk.rb +5 -5
- data/lib/kintsugi_sdk/products.rb +19 -19
- data/lib/kintsugi_sdk/sdk_hooks/hooks.rb +1 -1
- data/lib/kintsugi_sdk/sdk_hooks/types.rb +14 -14
- data/lib/kintsugi_sdk/sdkconfiguration.rb +17 -17
- data/lib/kintsugi_sdk/taxestimation.rb +11 -11
- data/lib/kintsugi_sdk/transactions.rb +51 -51
- data/lib/kintsugi_sdk/utils/forms.rb +23 -23
- data/lib/kintsugi_sdk/utils/headers.rb +4 -4
- data/lib/kintsugi_sdk/utils/query_params.rb +14 -14
- data/lib/kintsugi_sdk/utils/request_bodies.rb +7 -7
- data/lib/kintsugi_sdk/utils/retries.rb +5 -5
- data/lib/kintsugi_sdk/utils/security.rb +16 -16
- data/lib/kintsugi_sdk/utils/url.rb +6 -6
- data/lib/kintsugi_sdk/utils/utils.rb +31 -31
- metadata +6 -4
|
@@ -23,7 +23,7 @@ module KintsugiSDK
|
|
|
23
23
|
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
sig { params(base_url: String, url_variables: T.nilable(T::Hash[Symbol, T.any(String, T::Enum)])).returns(String) }
|
|
26
|
+
sig { params(base_url: ::String, url_variables: T.nilable(T::Hash[::Symbol, T.any(::String, T::Enum)])).returns(::String) }
|
|
27
27
|
def get_url(base_url:, url_variables: nil)
|
|
28
28
|
sd_base_url, sd_options = @sdk_configuration.get_server_details
|
|
29
29
|
|
|
@@ -41,7 +41,7 @@ module KintsugiSDK
|
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
sig { params(request: Models::Ops::GetProductByIdV1ProductsProductIdGetRequest, timeout_ms: T.nilable(Integer), http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])).returns(Models::Shared::ProductRead) }
|
|
44
|
+
sig { params(request: Models::Ops::GetProductByIdV1ProductsProductIdGetRequest, timeout_ms: T.nilable(::Integer), http_headers: T.nilable(T::Hash[T.any(::String, ::Symbol), ::String])).returns(Models::Shared::ProductRead) }
|
|
45
45
|
def get(request:, timeout_ms: nil, http_headers: nil)
|
|
46
46
|
# get - Get product by id
|
|
47
47
|
# The Get Product By ID API retrieves detailed information about
|
|
@@ -56,7 +56,7 @@ module KintsugiSDK
|
|
|
56
56
|
request
|
|
57
57
|
)
|
|
58
58
|
headers = Utils.get_headers(request)
|
|
59
|
-
headers = T.cast(headers, T::Hash[String, String])
|
|
59
|
+
headers = T.cast(headers, T::Hash[::String, ::String])
|
|
60
60
|
headers['Accept'] = 'application/json'
|
|
61
61
|
headers['user-agent'] = @sdk_configuration.user_agent
|
|
62
62
|
|
|
@@ -76,7 +76,7 @@ module KintsugiSDK
|
|
|
76
76
|
security_source: @sdk_configuration.security_source
|
|
77
77
|
)
|
|
78
78
|
|
|
79
|
-
error = T.let(nil, T.nilable(StandardError))
|
|
79
|
+
error = T.let(nil, T.nilable(::StandardError))
|
|
80
80
|
http_response = T.let(nil, T.nilable(Faraday::Response))
|
|
81
81
|
|
|
82
82
|
|
|
@@ -96,7 +96,7 @@ module KintsugiSDK
|
|
|
96
96
|
request: req
|
|
97
97
|
)
|
|
98
98
|
end
|
|
99
|
-
rescue StandardError => e
|
|
99
|
+
rescue ::StandardError => e
|
|
100
100
|
error = e
|
|
101
101
|
ensure
|
|
102
102
|
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
@@ -132,7 +132,7 @@ module KintsugiSDK
|
|
|
132
132
|
response: http_response
|
|
133
133
|
)
|
|
134
134
|
response_data = http_response.env.response_body
|
|
135
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Shared::ProductRead)
|
|
135
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Shared::ProductRead)
|
|
136
136
|
|
|
137
137
|
return obj
|
|
138
138
|
else
|
|
@@ -147,7 +147,7 @@ module KintsugiSDK
|
|
|
147
147
|
response: http_response
|
|
148
148
|
)
|
|
149
149
|
response_data = http_response.env.response_body
|
|
150
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ErrorResponse)
|
|
150
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Errors::ErrorResponse)
|
|
151
151
|
raise obj
|
|
152
152
|
else
|
|
153
153
|
raise ::KintsugiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
|
@@ -161,7 +161,7 @@ module KintsugiSDK
|
|
|
161
161
|
response: http_response
|
|
162
162
|
)
|
|
163
163
|
response_data = http_response.env.response_body
|
|
164
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BackendSrcProductsSchemasResponsesValidationErrorResponse)
|
|
164
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Errors::BackendSrcProductsSchemasResponsesValidationErrorResponse)
|
|
165
165
|
raise obj
|
|
166
166
|
else
|
|
167
167
|
raise ::KintsugiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
|
@@ -175,7 +175,7 @@ module KintsugiSDK
|
|
|
175
175
|
response: http_response
|
|
176
176
|
)
|
|
177
177
|
response_data = http_response.env.response_body
|
|
178
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ErrorResponse)
|
|
178
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Errors::ErrorResponse)
|
|
179
179
|
raise obj
|
|
180
180
|
else
|
|
181
181
|
raise ::KintsugiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
|
@@ -191,7 +191,7 @@ module KintsugiSDK
|
|
|
191
191
|
end
|
|
192
192
|
|
|
193
193
|
|
|
194
|
-
sig { params(request: Models::Ops::UpdateProductV1ProductsProductIdPutRequest, timeout_ms: T.nilable(Integer), http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])).returns(Models::Shared::ProductRead) }
|
|
194
|
+
sig { params(request: Models::Ops::UpdateProductV1ProductsProductIdPutRequest, timeout_ms: T.nilable(::Integer), http_headers: T.nilable(T::Hash[T.any(::String, ::Symbol), ::String])).returns(Models::Shared::ProductRead) }
|
|
195
195
|
def update(request:, timeout_ms: nil, http_headers: nil)
|
|
196
196
|
# update - Update product
|
|
197
197
|
# The Update Product API allows users to modify the details of
|
|
@@ -209,15 +209,15 @@ module KintsugiSDK
|
|
|
209
209
|
request
|
|
210
210
|
)
|
|
211
211
|
headers = Utils.get_headers(request)
|
|
212
|
-
headers = T.cast(headers, T::Hash[String, String])
|
|
212
|
+
headers = T.cast(headers, T::Hash[::String, ::String])
|
|
213
213
|
req_content_type, data, form = Utils.serialize_request_body(request, false, false, :request_body, :json)
|
|
214
214
|
headers['content-type'] = req_content_type
|
|
215
|
-
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
|
215
|
+
raise ::StandardError, 'request body is required' if data.nil? && form.nil?
|
|
216
216
|
|
|
217
217
|
if form && !form.empty?
|
|
218
218
|
body = Utils.encode_form(form)
|
|
219
219
|
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
|
220
|
-
body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object]))
|
|
220
|
+
body = ::URI.encode_www_form(T.cast(data, T::Hash[::Symbol, ::Object]))
|
|
221
221
|
else
|
|
222
222
|
body = data
|
|
223
223
|
end
|
|
@@ -240,7 +240,7 @@ module KintsugiSDK
|
|
|
240
240
|
security_source: @sdk_configuration.security_source
|
|
241
241
|
)
|
|
242
242
|
|
|
243
|
-
error = T.let(nil, T.nilable(StandardError))
|
|
243
|
+
error = T.let(nil, T.nilable(::StandardError))
|
|
244
244
|
http_response = T.let(nil, T.nilable(Faraday::Response))
|
|
245
245
|
|
|
246
246
|
|
|
@@ -261,7 +261,7 @@ module KintsugiSDK
|
|
|
261
261
|
request: req
|
|
262
262
|
)
|
|
263
263
|
end
|
|
264
|
-
rescue StandardError => e
|
|
264
|
+
rescue ::StandardError => e
|
|
265
265
|
error = e
|
|
266
266
|
ensure
|
|
267
267
|
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
@@ -297,7 +297,7 @@ module KintsugiSDK
|
|
|
297
297
|
response: http_response
|
|
298
298
|
)
|
|
299
299
|
response_data = http_response.env.response_body
|
|
300
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Shared::ProductRead)
|
|
300
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Shared::ProductRead)
|
|
301
301
|
|
|
302
302
|
return obj
|
|
303
303
|
else
|
|
@@ -312,7 +312,7 @@ module KintsugiSDK
|
|
|
312
312
|
response: http_response
|
|
313
313
|
)
|
|
314
314
|
response_data = http_response.env.response_body
|
|
315
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ErrorResponse)
|
|
315
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Errors::ErrorResponse)
|
|
316
316
|
raise obj
|
|
317
317
|
else
|
|
318
318
|
raise ::KintsugiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
|
@@ -326,7 +326,7 @@ module KintsugiSDK
|
|
|
326
326
|
response: http_response
|
|
327
327
|
)
|
|
328
328
|
response_data = http_response.env.response_body
|
|
329
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BackendSrcProductsSchemasResponsesValidationErrorResponse)
|
|
329
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Errors::BackendSrcProductsSchemasResponsesValidationErrorResponse)
|
|
330
330
|
raise obj
|
|
331
331
|
else
|
|
332
332
|
raise ::KintsugiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
|
@@ -340,7 +340,7 @@ module KintsugiSDK
|
|
|
340
340
|
response: http_response
|
|
341
341
|
)
|
|
342
342
|
response_data = http_response.env.response_body
|
|
343
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ErrorResponse)
|
|
343
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Errors::ErrorResponse)
|
|
344
344
|
raise obj
|
|
345
345
|
else
|
|
346
346
|
raise ::KintsugiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
|
@@ -13,13 +13,13 @@ module KintsugiSDK
|
|
|
13
13
|
sig { returns(SDKConfiguration) }
|
|
14
14
|
attr_accessor :config
|
|
15
15
|
|
|
16
|
-
sig { returns(String) }
|
|
16
|
+
sig { returns(::String) }
|
|
17
17
|
attr_accessor :base_url
|
|
18
18
|
|
|
19
|
-
sig { returns(T.nilable(T::Array[String])) }
|
|
19
|
+
sig { returns(T.nilable(T::Array[::String])) }
|
|
20
20
|
attr_accessor :oauth2_scopes
|
|
21
21
|
|
|
22
|
-
sig { returns(String) }
|
|
22
|
+
sig { returns(::String) }
|
|
23
23
|
attr_accessor :operation_id
|
|
24
24
|
|
|
25
25
|
sig { returns(T.nilable(T.proc.returns(T.untyped))) }
|
|
@@ -28,17 +28,17 @@ module KintsugiSDK
|
|
|
28
28
|
sig do
|
|
29
29
|
params(
|
|
30
30
|
config: SDKConfiguration,
|
|
31
|
-
base_url: String,
|
|
32
|
-
oauth2_scopes: T.nilable(T::Array[String]),
|
|
33
|
-
operation_id: String,
|
|
31
|
+
base_url: ::String,
|
|
32
|
+
oauth2_scopes: T.nilable(T::Array[::String]),
|
|
33
|
+
operation_id: ::String,
|
|
34
34
|
security_source: T.nilable(T.proc.returns(T.untyped))
|
|
35
35
|
).void
|
|
36
36
|
end
|
|
37
37
|
def initialize(config:, base_url:, oauth2_scopes:, operation_id:, security_source:)
|
|
38
38
|
@config = T.let(config, SDKConfiguration)
|
|
39
|
-
@base_url = T.let(base_url, String)
|
|
40
|
-
@oauth2_scopes = T.let(oauth2_scopes, T.nilable(T::Array[String]))
|
|
41
|
-
@operation_id = T.let(operation_id, String)
|
|
39
|
+
@base_url = T.let(base_url, ::String)
|
|
40
|
+
@oauth2_scopes = T.let(oauth2_scopes, T.nilable(T::Array[::String]))
|
|
41
|
+
@operation_id = T.let(operation_id, ::String)
|
|
42
42
|
@security_source = T.let(security_source, T.nilable(T.proc.returns(T.untyped)))
|
|
43
43
|
end
|
|
44
44
|
end
|
|
@@ -107,7 +107,7 @@ module KintsugiSDK
|
|
|
107
107
|
|
|
108
108
|
sig { overridable.params(config: SDKConfiguration).returns(SDKConfiguration) }
|
|
109
109
|
def sdk_init(config:)
|
|
110
|
-
Kernel.raise NotImplementedError.new
|
|
110
|
+
::Kernel.raise ::NotImplementedError.new
|
|
111
111
|
end
|
|
112
112
|
end
|
|
113
113
|
|
|
@@ -123,7 +123,7 @@ module KintsugiSDK
|
|
|
123
123
|
).returns(Faraday::Request)
|
|
124
124
|
end
|
|
125
125
|
def before_request(hook_ctx:, request:)
|
|
126
|
-
Kernel.raise NotImplementedError.new
|
|
126
|
+
::Kernel.raise ::NotImplementedError.new
|
|
127
127
|
end
|
|
128
128
|
end
|
|
129
129
|
|
|
@@ -139,7 +139,7 @@ module KintsugiSDK
|
|
|
139
139
|
).returns(Faraday::Response)
|
|
140
140
|
end
|
|
141
141
|
def after_success(hook_ctx:, response:)
|
|
142
|
-
Kernel.raise NotImplementedError.new
|
|
142
|
+
::Kernel.raise ::NotImplementedError.new
|
|
143
143
|
end
|
|
144
144
|
end
|
|
145
145
|
|
|
@@ -150,13 +150,13 @@ module KintsugiSDK
|
|
|
150
150
|
|
|
151
151
|
sig do
|
|
152
152
|
overridable.params(
|
|
153
|
-
error: T.nilable(StandardError),
|
|
153
|
+
error: T.nilable(::StandardError),
|
|
154
154
|
hook_ctx: AfterErrorHookContext,
|
|
155
155
|
response: T.nilable(Faraday::Response)
|
|
156
156
|
).returns(T.nilable(Faraday::Response))
|
|
157
157
|
end
|
|
158
158
|
def after_error(error:, hook_ctx:, response:)
|
|
159
|
-
Kernel.raise NotImplementedError.new
|
|
159
|
+
::Kernel.raise ::NotImplementedError.new
|
|
160
160
|
end
|
|
161
161
|
end
|
|
162
162
|
|
|
@@ -15,7 +15,7 @@ module KintsugiSDK
|
|
|
15
15
|
|
|
16
16
|
SERVERS = T.let([
|
|
17
17
|
'https://api.trykintsugi.com', # 1 - Production
|
|
18
|
-
].freeze, T::Array[String])
|
|
18
|
+
].freeze, T::Array[::String])
|
|
19
19
|
# Contains the list of servers available to the SDK
|
|
20
20
|
|
|
21
21
|
class SDKConfiguration
|
|
@@ -30,7 +30,7 @@ module KintsugiSDK
|
|
|
30
30
|
sig { returns(T.nilable(::KintsugiSDK::Utils::RetryConfig)) }
|
|
31
31
|
attr_accessor :retry_config
|
|
32
32
|
|
|
33
|
-
sig { returns(T.nilable(Float)) }
|
|
33
|
+
sig { returns(T.nilable(::Float)) }
|
|
34
34
|
attr_accessor :timeout
|
|
35
35
|
|
|
36
36
|
|
|
@@ -38,27 +38,27 @@ module KintsugiSDK
|
|
|
38
38
|
attr_accessor :security_source
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
sig { returns(T.nilable(String)) }
|
|
41
|
+
sig { returns(T.nilable(::String)) }
|
|
42
42
|
attr_accessor :server_url
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
sig { returns(T.nilable(Integer)) }
|
|
45
|
+
sig { returns(T.nilable(::Integer)) }
|
|
46
46
|
attr_accessor :server_idx
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
sig { returns(String) }
|
|
49
|
+
sig { returns(::String) }
|
|
50
50
|
attr_accessor :language
|
|
51
51
|
|
|
52
|
-
sig { returns(String) }
|
|
52
|
+
sig { returns(::String) }
|
|
53
53
|
attr_accessor :openapi_doc_version
|
|
54
54
|
|
|
55
|
-
sig { returns(String) }
|
|
55
|
+
sig { returns(::String) }
|
|
56
56
|
attr_accessor :sdk_version
|
|
57
57
|
|
|
58
|
-
sig { returns(String) }
|
|
58
|
+
sig { returns(::String) }
|
|
59
59
|
attr_accessor :gen_version
|
|
60
60
|
|
|
61
|
-
sig { returns(String) }
|
|
61
|
+
sig { returns(::String) }
|
|
62
62
|
attr_accessor :user_agent
|
|
63
63
|
|
|
64
64
|
sig do
|
|
@@ -66,11 +66,11 @@ module KintsugiSDK
|
|
|
66
66
|
client: T.nilable(Faraday::Connection),
|
|
67
67
|
hooks: ::KintsugiSDK::SDKHooks::Hooks,
|
|
68
68
|
retry_config: T.nilable(::KintsugiSDK::Utils::RetryConfig),
|
|
69
|
-
timeout_ms: T.nilable(Integer),
|
|
69
|
+
timeout_ms: T.nilable(::Integer),
|
|
70
70
|
api_key_header: T.nilable(::String),
|
|
71
71
|
security_source: T.nilable(T.proc.returns(Models::Shared::Security)),
|
|
72
|
-
server_url: T.nilable(String),
|
|
73
|
-
server_idx: T.nilable(Integer)
|
|
72
|
+
server_url: T.nilable(::String),
|
|
73
|
+
server_idx: T.nilable(::Integer)
|
|
74
74
|
).void
|
|
75
75
|
end
|
|
76
76
|
def initialize(client, hooks, retry_config, timeout_ms, api_key_header, security_source, server_url, server_idx)
|
|
@@ -80,7 +80,7 @@ module KintsugiSDK
|
|
|
80
80
|
@server_url = server_url
|
|
81
81
|
@timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
82
82
|
@server_idx = server_idx.nil? ? 0 : server_idx
|
|
83
|
-
raise StandardError, "Invalid server index #{server_idx}" if @server_idx.negative? || @server_idx >= SERVERS.length
|
|
83
|
+
raise ::StandardError, "Invalid server index #{server_idx}" if @server_idx.negative? || @server_idx >= SERVERS.length
|
|
84
84
|
if !security_source.nil?
|
|
85
85
|
@security_source = security_source
|
|
86
86
|
elsif !api_key_header.nil?
|
|
@@ -88,12 +88,12 @@ module KintsugiSDK
|
|
|
88
88
|
end
|
|
89
89
|
@language = 'ruby'
|
|
90
90
|
@openapi_doc_version = '1.0.0'
|
|
91
|
-
@sdk_version = '5.7.
|
|
92
|
-
@gen_version = '2.
|
|
93
|
-
@user_agent = 'speakeasy-sdk/ruby 5.7.
|
|
91
|
+
@sdk_version = '5.7.1'
|
|
92
|
+
@gen_version = '2.968.1'
|
|
93
|
+
@user_agent = 'speakeasy-sdk/ruby 5.7.1 2.968.1 1.0.0 kintsugi_sdk'
|
|
94
94
|
end
|
|
95
95
|
|
|
96
|
-
sig { returns([String, T::Hash[Symbol, String]]) }
|
|
96
|
+
sig { returns([::String, T::Hash[::Symbol, ::String]]) }
|
|
97
97
|
def get_server_details
|
|
98
98
|
return [@server_url.delete_suffix('/'), {}] if !@server_url.nil?
|
|
99
99
|
@server_idx = T.must(@server_idx)
|
|
@@ -23,7 +23,7 @@ module KintsugiSDK
|
|
|
23
23
|
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
sig { params(base_url: String, url_variables: T.nilable(T::Hash[Symbol, T.any(String, T::Enum)])).returns(String) }
|
|
26
|
+
sig { params(base_url: ::String, url_variables: T.nilable(T::Hash[::Symbol, T.any(::String, T::Enum)])).returns(::String) }
|
|
27
27
|
def get_url(base_url:, url_variables: nil)
|
|
28
28
|
sd_base_url, sd_options = @sdk_configuration.get_server_details
|
|
29
29
|
|
|
@@ -41,7 +41,7 @@ module KintsugiSDK
|
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
sig { params(request: Models::Ops::EstimateTaxV1TaxEstimatePostRequest, timeout_ms: T.nilable(Integer), http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])).returns(Models::Shared::TransactionEstimateResponse) }
|
|
44
|
+
sig { params(request: Models::Ops::EstimateTaxV1TaxEstimatePostRequest, timeout_ms: T.nilable(::Integer), http_headers: T.nilable(T::Hash[T.any(::String, ::Symbol), ::String])).returns(Models::Shared::TransactionEstimateResponse) }
|
|
45
45
|
def estimate_tax(request:, timeout_ms: nil, http_headers: nil)
|
|
46
46
|
# estimate_tax - Estimate tax
|
|
47
47
|
# The Estimate Tax API calculates the estimated tax for a specific
|
|
@@ -51,15 +51,15 @@ module KintsugiSDK
|
|
|
51
51
|
base_url = Utils.template_url(url, params)
|
|
52
52
|
url = "#{base_url}/v1/tax/estimate"
|
|
53
53
|
headers = Utils.get_headers(request)
|
|
54
|
-
headers = T.cast(headers, T::Hash[String, String])
|
|
54
|
+
headers = T.cast(headers, T::Hash[::String, ::String])
|
|
55
55
|
req_content_type, data, form = Utils.serialize_request_body(request, false, false, :transaction_estimate_public_request, :json)
|
|
56
56
|
headers['content-type'] = req_content_type
|
|
57
|
-
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
|
57
|
+
raise ::StandardError, 'request body is required' if data.nil? && form.nil?
|
|
58
58
|
|
|
59
59
|
if form && !form.empty?
|
|
60
60
|
body = Utils.encode_form(form)
|
|
61
61
|
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
|
62
|
-
body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object]))
|
|
62
|
+
body = ::URI.encode_www_form(T.cast(data, T::Hash[::Symbol, ::Object]))
|
|
63
63
|
else
|
|
64
64
|
body = data
|
|
65
65
|
end
|
|
@@ -83,7 +83,7 @@ module KintsugiSDK
|
|
|
83
83
|
security_source: @sdk_configuration.security_source
|
|
84
84
|
)
|
|
85
85
|
|
|
86
|
-
error = T.let(nil, T.nilable(StandardError))
|
|
86
|
+
error = T.let(nil, T.nilable(::StandardError))
|
|
87
87
|
http_response = T.let(nil, T.nilable(Faraday::Response))
|
|
88
88
|
|
|
89
89
|
|
|
@@ -105,7 +105,7 @@ module KintsugiSDK
|
|
|
105
105
|
request: req
|
|
106
106
|
)
|
|
107
107
|
end
|
|
108
|
-
rescue StandardError => e
|
|
108
|
+
rescue ::StandardError => e
|
|
109
109
|
error = e
|
|
110
110
|
ensure
|
|
111
111
|
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
@@ -141,7 +141,7 @@ module KintsugiSDK
|
|
|
141
141
|
response: http_response
|
|
142
142
|
)
|
|
143
143
|
response_data = http_response.env.response_body
|
|
144
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Shared::TransactionEstimateResponse)
|
|
144
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Shared::TransactionEstimateResponse)
|
|
145
145
|
|
|
146
146
|
return obj
|
|
147
147
|
else
|
|
@@ -156,7 +156,7 @@ module KintsugiSDK
|
|
|
156
156
|
response: http_response
|
|
157
157
|
)
|
|
158
158
|
response_data = http_response.env.response_body
|
|
159
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ErrorResponse)
|
|
159
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Errors::ErrorResponse)
|
|
160
160
|
raise obj
|
|
161
161
|
else
|
|
162
162
|
raise ::KintsugiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
|
@@ -170,7 +170,7 @@ module KintsugiSDK
|
|
|
170
170
|
response: http_response
|
|
171
171
|
)
|
|
172
172
|
response_data = http_response.env.response_body
|
|
173
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BackendSrcTaxEstimationResponsesValidationErrorResponse)
|
|
173
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Errors::BackendSrcTaxEstimationResponsesValidationErrorResponse)
|
|
174
174
|
raise obj
|
|
175
175
|
else
|
|
176
176
|
raise ::KintsugiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
|
@@ -184,7 +184,7 @@ module KintsugiSDK
|
|
|
184
184
|
response: http_response
|
|
185
185
|
)
|
|
186
186
|
response_data = http_response.env.response_body
|
|
187
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ErrorResponse)
|
|
187
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Errors::ErrorResponse)
|
|
188
188
|
raise obj
|
|
189
189
|
else
|
|
190
190
|
raise ::KintsugiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|