kintsugi_sdk 5.5.12 → 5.6.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/lib/crystalline/enum.rbi +17 -0
- data/lib/crystalline/metadata_fields.rb +94 -38
- data/lib/crystalline/module.rb +103 -13
- data/lib/crystalline/types.rb +100 -16
- data/lib/crystalline/utils.rb +13 -0
- data/lib/kintsugi_sdk/addressvalidation.rb +3 -3
- data/lib/kintsugi_sdk/customers.rb +10 -10
- data/lib/kintsugi_sdk/exemptions.rb +7 -7
- data/lib/kintsugi_sdk/models/errors/backend_src_address_validation_responses_validationerrorresponse.rb +0 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_customers_responses_validationerrorresponse.rb +0 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_exemptions_responses_validationerrorresponse.rb +0 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_products_responses_validationerrorresponse.rb +0 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_tax_estimation_responses_validationerrorresponse.rb +0 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_transactions_responses_validationerrorresponse.rb +0 -1
- data/lib/kintsugi_sdk/models/errors/errorresponse.rb +0 -1
- data/lib/kintsugi_sdk/models/errors/httpvalidationerror.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/createtransactionbycustomer_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/estimate_tax_v1_tax_estimate_post_request.rb +2 -3
- data/lib/kintsugi_sdk/models/ops/get_customer_by_external_id_v1_customers_external_external_id_get_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/get_customer_by_id_v1_customers_customer_id_get_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/get_customers_v1_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/get_exemption_by_id_v1_exemptions_exemption_id_get_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/get_exemptions_v1_exemptions_get_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/get_nexus_for_org_v1_nexus_get_request.rb +12 -5
- data/lib/kintsugi_sdk/models/ops/get_nexus_for_org_v1_nexus_get_request.rbi +4 -0
- data/lib/kintsugi_sdk/models/ops/get_product_by_id_v1_products_product_id_get_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/get_transaction_by_id_v1_transactions_transaction_id_get_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/get_transactions_v1_transactions_get_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/getexemptionattachments_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/gettransactionbyexternalid_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/gettransactionsbycustomer_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/gettransactionsbyfiling_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/search_v1_address_validation_search_post_security.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/update_customer_v1_customers_customer_id_put_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/update_product_v1_products_product_id_put_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/update_transaction_v1_transactions_transaction_id_put_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/uploadexemptioncert_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/addressbase.rb +1 -2
- data/lib/kintsugi_sdk/models/shared/addresses.rb +3 -4
- data/lib/kintsugi_sdk/models/shared/addressresponsedata.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/addresssearchresponse.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/addressstatus.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/addresssubmittedresponse.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/addresstype.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/appliedto.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/attachmentread.rb +1 -2
- data/lib/kintsugi_sdk/models/shared/backend_src_address_validation_responses_validationerroritem.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/backend_src_customers_responses_validationerroritem.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/backend_src_exemptions_models_exemptionread.rb +4 -5
- data/lib/kintsugi_sdk/models/shared/backend_src_exemptions_responses_validationerroritem.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/backend_src_exemptions_serializers_exemptionread.rb +4 -5
- data/lib/kintsugi_sdk/models/shared/backend_src_products_responses_validationerroritem.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/backend_src_tax_estimation_responses_validationerroritem.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/backend_src_transactions_responses_validationerroritem.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/body_upload_exemption_certificate_v1_exemptions_exemption_id_attachments_post.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/countrycodeenum.rb +1 -3
- data/lib/kintsugi_sdk/models/shared/currencyenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/customerbase.rb +4 -5
- data/lib/kintsugi_sdk/models/shared/customerbasebase.rb +4 -5
- data/lib/kintsugi_sdk/models/shared/customerbasepublic.rb +4 -5
- data/lib/kintsugi_sdk/models/shared/customercreate.rb +14 -7
- data/lib/kintsugi_sdk/models/shared/customercreate.rbi +4 -0
- data/lib/kintsugi_sdk/models/shared/customerread.rb +14 -7
- data/lib/kintsugi_sdk/models/shared/customerread.rbi +4 -0
- data/lib/kintsugi_sdk/models/shared/customertaxregistrationread.rb +52 -0
- data/lib/kintsugi_sdk/models/shared/customertaxregistrationread.rbi +23 -0
- data/lib/kintsugi_sdk/models/shared/customertaxtypeenum.rb +25 -0
- data/lib/kintsugi_sdk/models/shared/customertaxtypeenum.rbi +11 -0
- data/lib/kintsugi_sdk/models/shared/customerupdate.rb +10 -7
- data/lib/kintsugi_sdk/models/shared/customerupdate.rbi +2 -0
- data/lib/kintsugi_sdk/models/shared/discountbuilder.rb +2 -3
- data/lib/kintsugi_sdk/models/shared/exemption.rb +5 -6
- data/lib/kintsugi_sdk/models/shared/exemptioncreate.rb +4 -5
- data/lib/kintsugi_sdk/models/shared/exemptionrequired.rb +6 -5
- data/lib/kintsugi_sdk/models/shared/exemptionstatus.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/exemptiontype.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/fastapi_pagination_default_page_exemptionread_2.rb +3 -4
- data/lib/kintsugi_sdk/models/shared/file.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/findthresholdcrossingtransactionstate.rb +56 -0
- data/lib/kintsugi_sdk/models/shared/findthresholdcrossingtransactionstate.rbi +25 -0
- data/lib/kintsugi_sdk/models/shared/jurisdictiontype.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/nexusresponse.rb +41 -26
- data/lib/kintsugi_sdk/models/shared/nexusresponse.rbi +10 -2
- data/lib/kintsugi_sdk/models/shared/nexusstateenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/nexusstatusenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/nexustypeenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/page_customerread_.rb +3 -4
- data/lib/kintsugi_sdk/models/shared/page_nexusresponse_.rb +3 -4
- data/lib/kintsugi_sdk/models/shared/page_transactionestimateresponse_.rb +3 -4
- data/lib/kintsugi_sdk/models/shared/page_transactionread_.rb +3 -4
- data/lib/kintsugi_sdk/models/shared/periodmodelenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/processingstatusenum.rb +1 -3
- data/lib/kintsugi_sdk/models/shared/productread.rb +12 -9
- data/lib/kintsugi_sdk/models/shared/productstatusenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/productupdate.rb +10 -7
- data/lib/kintsugi_sdk/models/shared/registration.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/registrationsregimeenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/relatedentitytype.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/salesortransactionsenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/security.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/sourceenum.rb +10 -4
- data/lib/kintsugi_sdk/models/shared/statusenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/taxexemptionenum.rb +1 -3
- data/lib/kintsugi_sdk/models/shared/taxitembuilder.rb +4 -5
- data/lib/kintsugi_sdk/models/shared/taxitemestimate.rb +1 -2
- data/lib/kintsugi_sdk/models/shared/taxitemread.rb +4 -5
- data/lib/kintsugi_sdk/models/shared/taxitemreturnreasonenum.rb +2 -3
- data/lib/kintsugi_sdk/models/shared/taxitemtypeenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/taxliabilitysourceenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/transactionaddressbuilder.rb +3 -4
- data/lib/kintsugi_sdk/models/shared/transactionaddresspublic.rb +2 -3
- data/lib/kintsugi_sdk/models/shared/transactionaddressread_output.rb +3 -4
- data/lib/kintsugi_sdk/models/shared/transactioncreate.rb +23 -19
- data/lib/kintsugi_sdk/models/shared/transactioncreate.rbi +2 -2
- data/lib/kintsugi_sdk/models/shared/transactionestimatepublicrequest.rb +6 -11
- data/lib/kintsugi_sdk/models/shared/transactionestimatepublicrequest.rbi +0 -2
- data/lib/kintsugi_sdk/models/shared/transactionestimateresponse.rb +7 -12
- data/lib/kintsugi_sdk/models/shared/transactionestimateresponse.rbi +0 -2
- data/lib/kintsugi_sdk/models/shared/transactionestimateresponse_addresses.rb +3 -4
- data/lib/kintsugi_sdk/models/shared/transactionestimateresponse_type.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/transactionexemptstatusenum.rb +2 -3
- data/lib/kintsugi_sdk/models/shared/transactionitembuilder.rb +8 -7
- data/lib/kintsugi_sdk/models/shared/transactionitemcreateupdate.rb +8 -7
- data/lib/kintsugi_sdk/models/shared/transactionitemestimatebase.rb +9 -8
- data/lib/kintsugi_sdk/models/shared/transactionitemestimateresponse.rb +10 -9
- data/lib/kintsugi_sdk/models/shared/transactionitemread.rb +7 -6
- data/lib/kintsugi_sdk/models/shared/transactionpublicrequest.rb +21 -17
- data/lib/kintsugi_sdk/models/shared/transactionpublicrequest.rbi +2 -2
- data/lib/kintsugi_sdk/models/shared/transactionread.rb +24 -20
- data/lib/kintsugi_sdk/models/shared/transactionread.rbi +2 -2
- data/lib/kintsugi_sdk/models/shared/transactionrefundstatus.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/transactionstatusenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/transactiontypeenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/transactionupdate.rb +19 -60
- data/lib/kintsugi_sdk/models/shared/transactionupdate.rbi +2 -24
- data/lib/kintsugi_sdk/models/shared/treatmentenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/type.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/validationaddress.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/validationerror.rb +0 -1
- data/lib/kintsugi_sdk/models/shared.rb +3 -7
- data/lib/kintsugi_sdk/nexus.rb +1 -1
- data/lib/kintsugi_sdk/openapisdk.rb +13 -15
- data/lib/kintsugi_sdk/products.rb +6 -414
- data/lib/kintsugi_sdk/sdk_hooks/hooks.rb +0 -1
- data/lib/kintsugi_sdk/sdkconfiguration.rb +5 -10
- data/lib/kintsugi_sdk/taxestimation.rb +4 -4
- data/lib/kintsugi_sdk/transactions.rb +8 -8
- data/lib/kintsugi_sdk/utils/forms.rb +1 -1
- data/lib/kintsugi_sdk/utils/query_params.rb +4 -2
- data/lib/kintsugi_sdk/utils/request_bodies.rb +11 -6
- data/lib/kintsugi_sdk/utils/security.rb +10 -0
- data/lib/kintsugi_sdk/utils/url.rb +11 -5
- data/lib/kintsugi_sdk/utils/utils.rb +45 -3
- metadata +77 -41
- data/lib/kintsugi_sdk/models/ops/get_products_v1_products_get_request.rb +0 -61
- data/lib/kintsugi_sdk/models/ops/get_products_v1_products_get_request.rbi +0 -27
- data/lib/kintsugi_sdk/models/shared/page_productread_.rb +0 -49
- data/lib/kintsugi_sdk/models/shared/page_productread_.rbi +0 -21
- data/lib/kintsugi_sdk/models/shared/productcategories.rb +0 -38
- data/lib/kintsugi_sdk/models/shared/productcategories.rbi +0 -15
- data/lib/kintsugi_sdk/models/shared/productcategoryenum.rb +0 -25
- data/lib/kintsugi_sdk/models/shared/productcategoryenum.rbi +0 -11
- data/lib/kintsugi_sdk/models/shared/productcodeenum.rb +0 -82
- data/lib/kintsugi_sdk/models/shared/productcodeenum.rbi +0 -11
- data/lib/kintsugi_sdk/models/shared/productcreatemanual.rb +0 -61
- data/lib/kintsugi_sdk/models/shared/productcreatemanual.rbi +0 -27
- data/lib/kintsugi_sdk/models/shared/productsubcategory.rb +0 -46
- data/lib/kintsugi_sdk/models/shared/productsubcategory.rbi +0 -19
- data/lib/kintsugi_sdk/models/shared/productsubcategoryenum.rb +0 -83
- data/lib/kintsugi_sdk/models/shared/productsubcategoryenum.rbi +0 -11
|
@@ -22,6 +22,8 @@ module KintsugiSDK
|
|
|
22
22
|
autoload :CustomerBasePublic, 'kintsugi_sdk/models/shared/customerbasepublic.rb'
|
|
23
23
|
autoload :CustomerCreate, 'kintsugi_sdk/models/shared/customercreate.rb'
|
|
24
24
|
autoload :CustomerRead, 'kintsugi_sdk/models/shared/customerread.rb'
|
|
25
|
+
autoload :CustomerTaxRegistrationRead, 'kintsugi_sdk/models/shared/customertaxregistrationread.rb'
|
|
26
|
+
autoload :CustomerTaxTypeEnum, 'kintsugi_sdk/models/shared/customertaxtypeenum.rb'
|
|
25
27
|
autoload :CustomerUpdate, 'kintsugi_sdk/models/shared/customerupdate.rb'
|
|
26
28
|
autoload :DiscountBuilder, 'kintsugi_sdk/models/shared/discountbuilder.rb'
|
|
27
29
|
autoload :Exemption, 'kintsugi_sdk/models/shared/exemption.rb'
|
|
@@ -30,6 +32,7 @@ module KintsugiSDK
|
|
|
30
32
|
autoload :ExemptionStatus, 'kintsugi_sdk/models/shared/exemptionstatus.rb'
|
|
31
33
|
autoload :ExemptionType, 'kintsugi_sdk/models/shared/exemptiontype.rb'
|
|
32
34
|
autoload :File, 'kintsugi_sdk/models/shared/file.rb'
|
|
35
|
+
autoload :FindThresholdCrossingTransactionState, 'kintsugi_sdk/models/shared/findthresholdcrossingtransactionstate.rb'
|
|
33
36
|
autoload :JurisdictionType, 'kintsugi_sdk/models/shared/jurisdictiontype.rb'
|
|
34
37
|
autoload :NexusResponse, 'kintsugi_sdk/models/shared/nexusresponse.rb'
|
|
35
38
|
autoload :NexusStateEnum, 'kintsugi_sdk/models/shared/nexusstateenum.rb'
|
|
@@ -37,19 +40,12 @@ module KintsugiSDK
|
|
|
37
40
|
autoload :NexusTypeEnum, 'kintsugi_sdk/models/shared/nexustypeenum.rb'
|
|
38
41
|
autoload :PageCustomerRead, 'kintsugi_sdk/models/shared/page_customerread_.rb'
|
|
39
42
|
autoload :PageNexusResponse, 'kintsugi_sdk/models/shared/page_nexusresponse_.rb'
|
|
40
|
-
autoload :PageProductRead, 'kintsugi_sdk/models/shared/page_productread_.rb'
|
|
41
43
|
autoload :PageTransactionEstimateResponse, 'kintsugi_sdk/models/shared/page_transactionestimateresponse_.rb'
|
|
42
44
|
autoload :PageTransactionRead, 'kintsugi_sdk/models/shared/page_transactionread_.rb'
|
|
43
45
|
autoload :PeriodModelEnum, 'kintsugi_sdk/models/shared/periodmodelenum.rb'
|
|
44
46
|
autoload :ProcessingStatusEnum, 'kintsugi_sdk/models/shared/processingstatusenum.rb'
|
|
45
|
-
autoload :ProductCategories, 'kintsugi_sdk/models/shared/productcategories.rb'
|
|
46
|
-
autoload :ProductCategoryEnum, 'kintsugi_sdk/models/shared/productcategoryenum.rb'
|
|
47
|
-
autoload :ProductCodeEnum, 'kintsugi_sdk/models/shared/productcodeenum.rb'
|
|
48
|
-
autoload :ProductCreateManual, 'kintsugi_sdk/models/shared/productcreatemanual.rb'
|
|
49
47
|
autoload :ProductRead, 'kintsugi_sdk/models/shared/productread.rb'
|
|
50
48
|
autoload :ProductStatusEnum, 'kintsugi_sdk/models/shared/productstatusenum.rb'
|
|
51
|
-
autoload :ProductSubCategory, 'kintsugi_sdk/models/shared/productsubcategory.rb'
|
|
52
|
-
autoload :ProductSubCategoryEnum, 'kintsugi_sdk/models/shared/productsubcategoryenum.rb'
|
|
53
49
|
autoload :ProductUpdate, 'kintsugi_sdk/models/shared/productupdate.rb'
|
|
54
50
|
autoload :RegistrationsRegimeEnum, 'kintsugi_sdk/models/shared/registrationsregimeenum.rb'
|
|
55
51
|
autoload :RelatedEntityType, 'kintsugi_sdk/models/shared/relatedentitytype.rb'
|
data/lib/kintsugi_sdk/nexus.rb
CHANGED
|
@@ -63,7 +63,7 @@ module KintsugiSDK
|
|
|
63
63
|
hook_ctx = SDKHooks::HookContext.new(
|
|
64
64
|
config: @sdk_configuration,
|
|
65
65
|
base_url: base_url,
|
|
66
|
-
oauth2_scopes:
|
|
66
|
+
oauth2_scopes: nil,
|
|
67
67
|
operation_id: 'get_nexus_for_org_v1_nexus_get',
|
|
68
68
|
security_source: @sdk_configuration.security_source
|
|
69
69
|
)
|
|
@@ -18,6 +18,16 @@ module KintsugiSDK
|
|
|
18
18
|
|
|
19
19
|
attr_accessor :address_validation, :customers, :exemptions, :nexus, :products, :transactions, :tax_estimation
|
|
20
20
|
|
|
21
|
+
# Instantiates the SDK, configuring it with the provided parameters.
|
|
22
|
+
#
|
|
23
|
+
# @param client [Faraday::Connection, nil] The faraday HTTP client to use for all operations
|
|
24
|
+
# @param retry_config [::KintsugiSDK::Utils::RetryConfig, nil] The retry configuration to use for all operations
|
|
25
|
+
# @param timeout_ms [Integer, nil] Request timeout in milliseconds for all operations
|
|
26
|
+
# @param security [Models::Shared::Security, nil] The security details required for authentication
|
|
27
|
+
# @param security_source [Proc{|| Models::Shared::Security, nil}] A function that returns security details required for authentication
|
|
28
|
+
# @param server_idx [Integer, nil] The index of the server to use for all operations
|
|
29
|
+
# @param server_url [String, nil] The server URL to use for all operations
|
|
30
|
+
# @param url_params [Hash{Symbol => String}, nil] Parameters to optionally template the server URL with
|
|
21
31
|
sig do
|
|
22
32
|
params(
|
|
23
33
|
client: T.nilable(Faraday::Connection),
|
|
@@ -27,20 +37,10 @@ module KintsugiSDK
|
|
|
27
37
|
security_source: T.nilable(T.proc.returns(Models::Shared::Security)),
|
|
28
38
|
server_idx: T.nilable(Integer),
|
|
29
39
|
server_url: T.nilable(String),
|
|
30
|
-
url_params: T.nilable(T::Hash[Symbol, String])
|
|
31
|
-
debug_logging: T.nilable(T::Boolean)
|
|
40
|
+
url_params: T.nilable(T::Hash[Symbol, String])
|
|
32
41
|
).void
|
|
33
42
|
end
|
|
34
|
-
def initialize(client: nil, retry_config: nil, timeout_ms: nil, security: nil, security_source: nil, server_idx: nil, server_url: nil, url_params: nil
|
|
35
|
-
## Instantiates the SDK configuring it with the provided parameters.
|
|
36
|
-
# @param [T.nilable(Faraday::Connection)] client The faraday HTTP client to use for all operations
|
|
37
|
-
# @param [T.nilable(::KintsugiSDK::Utils::RetryConfig)] retry_config The retry configuration to use for all operations
|
|
38
|
-
# @param [T.nilable(Integer)] timeout_ms Request timeout in milliseconds for all operations
|
|
39
|
-
# @param [T.nilable(Models::Shared::Security)] security: The security details required for authentication
|
|
40
|
-
# @param [T.proc.returns(T.nilable(Models::Shared::Security))] security_source: A function that returns security details required for authentication
|
|
41
|
-
# @param [T.nilable(::Integer)] server_idx The index of the server to use for all operations
|
|
42
|
-
# @param [T.nilable(::String)] server_url The server URL to use for all operations
|
|
43
|
-
# @param [T.nilable(::Hash<::Symbol, ::String>)] url_params Parameters to optionally template the server URL with
|
|
43
|
+
def initialize(client: nil, retry_config: nil, timeout_ms: nil, security: nil, security_source: nil, server_idx: nil, server_url: nil, url_params: nil)
|
|
44
44
|
|
|
45
45
|
connection_options = {
|
|
46
46
|
request: {
|
|
@@ -49,11 +49,9 @@ module KintsugiSDK
|
|
|
49
49
|
}
|
|
50
50
|
connection_options[:request][:timeout] = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
51
51
|
|
|
52
|
-
debug_enabled = debug_logging == true || ENV['KINTSUGI_DEBUG'] == 'true'
|
|
53
|
-
|
|
54
52
|
client ||= Faraday.new(**connection_options) do |f|
|
|
55
53
|
f.request :multipart, {}
|
|
56
|
-
f.response :logger,
|
|
54
|
+
# f.response :logger, nil, { headers: true, bodies: true, errors: true }
|
|
57
55
|
end
|
|
58
56
|
|
|
59
57
|
if !server_url.nil?
|
|
@@ -39,302 +39,6 @@ module KintsugiSDK
|
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
sig { params(request: Models::Ops::GetProductsV1ProductsGetRequest, timeout_ms: T.nilable(Integer)).returns(Models::Shared::PageProductRead) }
|
|
43
|
-
def list(request:, timeout_ms: nil)
|
|
44
|
-
# list - Get Products
|
|
45
|
-
# Retrieve a paginated list of products based on filters and search query.
|
|
46
|
-
url, params = @sdk_configuration.get_server_details
|
|
47
|
-
base_url = Utils.template_url(url, params)
|
|
48
|
-
url = "#{base_url}/v1/products/"
|
|
49
|
-
headers = {}
|
|
50
|
-
headers = T.cast(headers, T::Hash[String, String])
|
|
51
|
-
query_params = Utils.get_query_params(Models::Ops::GetProductsV1ProductsGetRequest, request, nil)
|
|
52
|
-
headers['Accept'] = 'application/json'
|
|
53
|
-
headers['user-agent'] = @sdk_configuration.user_agent
|
|
54
|
-
|
|
55
|
-
security = @sdk_configuration.security_source&.call
|
|
56
|
-
|
|
57
|
-
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
58
|
-
timeout ||= @sdk_configuration.timeout
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
connection = @sdk_configuration.client
|
|
62
|
-
|
|
63
|
-
hook_ctx = SDKHooks::HookContext.new(
|
|
64
|
-
config: @sdk_configuration,
|
|
65
|
-
base_url: base_url,
|
|
66
|
-
oauth2_scopes: [],
|
|
67
|
-
operation_id: 'get_products_v1_products__get',
|
|
68
|
-
security_source: @sdk_configuration.security_source
|
|
69
|
-
)
|
|
70
|
-
|
|
71
|
-
error = T.let(nil, T.nilable(StandardError))
|
|
72
|
-
http_response = T.let(nil, T.nilable(Faraday::Response))
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
begin
|
|
76
|
-
http_response = T.must(connection).get(url) do |req|
|
|
77
|
-
req.headers.merge!(headers)
|
|
78
|
-
req.options.timeout = timeout unless timeout.nil?
|
|
79
|
-
req.params = query_params
|
|
80
|
-
Utils.configure_request_security(req, security)
|
|
81
|
-
|
|
82
|
-
@sdk_configuration.hooks.before_request(
|
|
83
|
-
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
84
|
-
hook_ctx: hook_ctx
|
|
85
|
-
),
|
|
86
|
-
request: req
|
|
87
|
-
)
|
|
88
|
-
end
|
|
89
|
-
rescue StandardError => e
|
|
90
|
-
error = e
|
|
91
|
-
ensure
|
|
92
|
-
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
93
|
-
http_response = @sdk_configuration.hooks.after_error(
|
|
94
|
-
error: error,
|
|
95
|
-
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
|
96
|
-
hook_ctx: hook_ctx
|
|
97
|
-
),
|
|
98
|
-
response: http_response
|
|
99
|
-
)
|
|
100
|
-
else
|
|
101
|
-
http_response = @sdk_configuration.hooks.after_success(
|
|
102
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
103
|
-
hook_ctx: hook_ctx
|
|
104
|
-
),
|
|
105
|
-
response: http_response
|
|
106
|
-
)
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
if http_response.nil?
|
|
110
|
-
raise error if !error.nil?
|
|
111
|
-
raise 'no response'
|
|
112
|
-
end
|
|
113
|
-
end
|
|
114
|
-
|
|
115
|
-
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
116
|
-
if Utils.match_status_code(http_response.status, ['200'])
|
|
117
|
-
if Utils.match_content_type(content_type, 'application/json')
|
|
118
|
-
@sdk_configuration.hooks.after_success(
|
|
119
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
120
|
-
hook_ctx: hook_ctx
|
|
121
|
-
),
|
|
122
|
-
response: http_response
|
|
123
|
-
)
|
|
124
|
-
response_data = http_response.env.response_body
|
|
125
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Shared::PageProductRead)
|
|
126
|
-
|
|
127
|
-
return obj
|
|
128
|
-
else
|
|
129
|
-
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'
|
|
130
|
-
end
|
|
131
|
-
elsif Utils.match_status_code(http_response.status, ['401', '404'])
|
|
132
|
-
if Utils.match_content_type(content_type, 'application/json')
|
|
133
|
-
@sdk_configuration.hooks.after_success(
|
|
134
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
135
|
-
hook_ctx: hook_ctx
|
|
136
|
-
),
|
|
137
|
-
response: http_response
|
|
138
|
-
)
|
|
139
|
-
response_data = http_response.env.response_body
|
|
140
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ErrorResponse)
|
|
141
|
-
raise obj
|
|
142
|
-
else
|
|
143
|
-
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'
|
|
144
|
-
end
|
|
145
|
-
elsif Utils.match_status_code(http_response.status, ['422'])
|
|
146
|
-
if Utils.match_content_type(content_type, 'application/json')
|
|
147
|
-
@sdk_configuration.hooks.after_success(
|
|
148
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
149
|
-
hook_ctx: hook_ctx
|
|
150
|
-
),
|
|
151
|
-
response: http_response
|
|
152
|
-
)
|
|
153
|
-
response_data = http_response.env.response_body
|
|
154
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BackendSrcProductsResponsesValidationErrorResponse)
|
|
155
|
-
raise obj
|
|
156
|
-
else
|
|
157
|
-
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'
|
|
158
|
-
end
|
|
159
|
-
elsif Utils.match_status_code(http_response.status, ['500'])
|
|
160
|
-
if Utils.match_content_type(content_type, 'application/json')
|
|
161
|
-
@sdk_configuration.hooks.after_success(
|
|
162
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
163
|
-
hook_ctx: hook_ctx
|
|
164
|
-
),
|
|
165
|
-
response: http_response
|
|
166
|
-
)
|
|
167
|
-
response_data = http_response.env.response_body
|
|
168
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ErrorResponse)
|
|
169
|
-
raise obj
|
|
170
|
-
else
|
|
171
|
-
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'
|
|
172
|
-
end
|
|
173
|
-
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
|
174
|
-
raise ::KintsugiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
175
|
-
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
|
176
|
-
raise ::KintsugiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
177
|
-
else
|
|
178
|
-
raise ::KintsugiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown status code received'
|
|
179
|
-
|
|
180
|
-
end
|
|
181
|
-
end
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
sig { params(request: Models::Shared::ProductCreateManual, timeout_ms: T.nilable(Integer)).returns(Models::Shared::ProductRead) }
|
|
185
|
-
def create(request:, timeout_ms: nil)
|
|
186
|
-
# create - Create Product
|
|
187
|
-
# The Create Product API allows users to manually create a new product
|
|
188
|
-
# in the system. This includes specifying product details such as category,
|
|
189
|
-
# subcategory, and tax exemption status, etc.
|
|
190
|
-
url, params = @sdk_configuration.get_server_details
|
|
191
|
-
base_url = Utils.template_url(url, params)
|
|
192
|
-
url = "#{base_url}/v1/products/"
|
|
193
|
-
headers = {}
|
|
194
|
-
headers = T.cast(headers, T::Hash[String, String])
|
|
195
|
-
req_content_type, data, form = Utils.serialize_request_body(request, false, false, :request, :json)
|
|
196
|
-
headers['content-type'] = req_content_type
|
|
197
|
-
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
|
198
|
-
|
|
199
|
-
if form
|
|
200
|
-
body = Utils.encode_form(form)
|
|
201
|
-
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
|
202
|
-
body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object]))
|
|
203
|
-
else
|
|
204
|
-
body = data
|
|
205
|
-
end
|
|
206
|
-
headers['Accept'] = 'application/json'
|
|
207
|
-
headers['user-agent'] = @sdk_configuration.user_agent
|
|
208
|
-
|
|
209
|
-
security = @sdk_configuration.security_source&.call
|
|
210
|
-
|
|
211
|
-
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
212
|
-
timeout ||= @sdk_configuration.timeout
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
connection = @sdk_configuration.client
|
|
216
|
-
|
|
217
|
-
hook_ctx = SDKHooks::HookContext.new(
|
|
218
|
-
config: @sdk_configuration,
|
|
219
|
-
base_url: base_url,
|
|
220
|
-
oauth2_scopes: [],
|
|
221
|
-
operation_id: 'create_product_v1_products__post',
|
|
222
|
-
security_source: @sdk_configuration.security_source
|
|
223
|
-
)
|
|
224
|
-
|
|
225
|
-
error = T.let(nil, T.nilable(StandardError))
|
|
226
|
-
http_response = T.let(nil, T.nilable(Faraday::Response))
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
begin
|
|
230
|
-
http_response = T.must(connection).post(url) do |req|
|
|
231
|
-
req.body = body
|
|
232
|
-
req.headers.merge!(headers)
|
|
233
|
-
req.options.timeout = timeout unless timeout.nil?
|
|
234
|
-
Utils.configure_request_security(req, security)
|
|
235
|
-
|
|
236
|
-
@sdk_configuration.hooks.before_request(
|
|
237
|
-
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
238
|
-
hook_ctx: hook_ctx
|
|
239
|
-
),
|
|
240
|
-
request: req
|
|
241
|
-
)
|
|
242
|
-
end
|
|
243
|
-
rescue StandardError => e
|
|
244
|
-
error = e
|
|
245
|
-
ensure
|
|
246
|
-
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
247
|
-
http_response = @sdk_configuration.hooks.after_error(
|
|
248
|
-
error: error,
|
|
249
|
-
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
|
250
|
-
hook_ctx: hook_ctx
|
|
251
|
-
),
|
|
252
|
-
response: http_response
|
|
253
|
-
)
|
|
254
|
-
else
|
|
255
|
-
http_response = @sdk_configuration.hooks.after_success(
|
|
256
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
257
|
-
hook_ctx: hook_ctx
|
|
258
|
-
),
|
|
259
|
-
response: http_response
|
|
260
|
-
)
|
|
261
|
-
end
|
|
262
|
-
|
|
263
|
-
if http_response.nil?
|
|
264
|
-
raise error if !error.nil?
|
|
265
|
-
raise 'no response'
|
|
266
|
-
end
|
|
267
|
-
end
|
|
268
|
-
|
|
269
|
-
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
270
|
-
if Utils.match_status_code(http_response.status, ['200'])
|
|
271
|
-
if Utils.match_content_type(content_type, 'application/json')
|
|
272
|
-
@sdk_configuration.hooks.after_success(
|
|
273
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
274
|
-
hook_ctx: hook_ctx
|
|
275
|
-
),
|
|
276
|
-
response: http_response
|
|
277
|
-
)
|
|
278
|
-
response_data = http_response.env.response_body
|
|
279
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Shared::ProductRead)
|
|
280
|
-
|
|
281
|
-
return obj
|
|
282
|
-
else
|
|
283
|
-
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'
|
|
284
|
-
end
|
|
285
|
-
elsif Utils.match_status_code(http_response.status, ['401'])
|
|
286
|
-
if Utils.match_content_type(content_type, 'application/json')
|
|
287
|
-
@sdk_configuration.hooks.after_success(
|
|
288
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
289
|
-
hook_ctx: hook_ctx
|
|
290
|
-
),
|
|
291
|
-
response: http_response
|
|
292
|
-
)
|
|
293
|
-
response_data = http_response.env.response_body
|
|
294
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ErrorResponse)
|
|
295
|
-
raise obj
|
|
296
|
-
else
|
|
297
|
-
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'
|
|
298
|
-
end
|
|
299
|
-
elsif Utils.match_status_code(http_response.status, ['422'])
|
|
300
|
-
if Utils.match_content_type(content_type, 'application/json')
|
|
301
|
-
@sdk_configuration.hooks.after_success(
|
|
302
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
303
|
-
hook_ctx: hook_ctx
|
|
304
|
-
),
|
|
305
|
-
response: http_response
|
|
306
|
-
)
|
|
307
|
-
response_data = http_response.env.response_body
|
|
308
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BackendSrcProductsResponsesValidationErrorResponse)
|
|
309
|
-
raise obj
|
|
310
|
-
else
|
|
311
|
-
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'
|
|
312
|
-
end
|
|
313
|
-
elsif Utils.match_status_code(http_response.status, ['500'])
|
|
314
|
-
if Utils.match_content_type(content_type, 'application/json')
|
|
315
|
-
@sdk_configuration.hooks.after_success(
|
|
316
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
317
|
-
hook_ctx: hook_ctx
|
|
318
|
-
),
|
|
319
|
-
response: http_response
|
|
320
|
-
)
|
|
321
|
-
response_data = http_response.env.response_body
|
|
322
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ErrorResponse)
|
|
323
|
-
raise obj
|
|
324
|
-
else
|
|
325
|
-
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
|
-
end
|
|
327
|
-
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
|
328
|
-
raise ::KintsugiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
329
|
-
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
|
330
|
-
raise ::KintsugiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
331
|
-
else
|
|
332
|
-
raise ::KintsugiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown status code received'
|
|
333
|
-
|
|
334
|
-
end
|
|
335
|
-
end
|
|
336
|
-
|
|
337
|
-
|
|
338
42
|
sig { params(request: Models::Ops::GetProductByIdV1ProductsProductIdGetRequest, timeout_ms: T.nilable(Integer)).returns(Models::Shared::ProductRead) }
|
|
339
43
|
def get(request:, timeout_ms: nil)
|
|
340
44
|
# get - Get Product By Id
|
|
@@ -365,7 +69,7 @@ module KintsugiSDK
|
|
|
365
69
|
hook_ctx = SDKHooks::HookContext.new(
|
|
366
70
|
config: @sdk_configuration,
|
|
367
71
|
base_url: base_url,
|
|
368
|
-
oauth2_scopes:
|
|
72
|
+
oauth2_scopes: nil,
|
|
369
73
|
operation_id: 'get_product_by_id_v1_products__product_id__get',
|
|
370
74
|
security_source: @sdk_configuration.security_source
|
|
371
75
|
)
|
|
@@ -486,7 +190,9 @@ module KintsugiSDK
|
|
|
486
190
|
def update(request:, timeout_ms: nil)
|
|
487
191
|
# update - Update Product
|
|
488
192
|
# The Update Product API allows users to modify the details of
|
|
489
|
-
# an existing product identified by its unique product_id
|
|
193
|
+
# an existing product identified by its unique product_id. You can
|
|
194
|
+
# retrieve supported categories and subcategories from
|
|
195
|
+
# [GET /products/categories endpoint](/reference/api/products/get-product-categories)
|
|
490
196
|
url, params = @sdk_configuration.get_server_details
|
|
491
197
|
base_url = Utils.template_url(url, params)
|
|
492
198
|
url = Utils.generate_url(
|
|
@@ -501,7 +207,7 @@ module KintsugiSDK
|
|
|
501
207
|
headers['content-type'] = req_content_type
|
|
502
208
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
|
503
209
|
|
|
504
|
-
if form
|
|
210
|
+
if form && !form.empty?
|
|
505
211
|
body = Utils.encode_form(form)
|
|
506
212
|
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
|
507
213
|
body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object]))
|
|
@@ -522,7 +228,7 @@ module KintsugiSDK
|
|
|
522
228
|
hook_ctx = SDKHooks::HookContext.new(
|
|
523
229
|
config: @sdk_configuration,
|
|
524
230
|
base_url: base_url,
|
|
525
|
-
oauth2_scopes:
|
|
231
|
+
oauth2_scopes: nil,
|
|
526
232
|
operation_id: 'update_product_v1_products__product_id__put',
|
|
527
233
|
security_source: @sdk_configuration.security_source
|
|
528
234
|
)
|
|
@@ -638,119 +344,5 @@ module KintsugiSDK
|
|
|
638
344
|
|
|
639
345
|
end
|
|
640
346
|
end
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
sig { params(timeout_ms: T.nilable(Integer)).returns(T::Array[Models::Shared::ProductCategories]) }
|
|
644
|
-
def list_categories(timeout_ms: nil)
|
|
645
|
-
# list_categories - Get Product Categories
|
|
646
|
-
# The Get Product Categories API retrieves all
|
|
647
|
-
# product categories. This endpoint helps users understand and select the
|
|
648
|
-
# appropriate categories for their products.
|
|
649
|
-
url, params = @sdk_configuration.get_server_details
|
|
650
|
-
base_url = Utils.template_url(url, params)
|
|
651
|
-
url = "#{base_url}/v1/products/categories/"
|
|
652
|
-
headers = {}
|
|
653
|
-
headers = T.cast(headers, T::Hash[String, String])
|
|
654
|
-
headers['Accept'] = 'application/json'
|
|
655
|
-
headers['user-agent'] = @sdk_configuration.user_agent
|
|
656
|
-
|
|
657
|
-
security = @sdk_configuration.security_source&.call
|
|
658
|
-
|
|
659
|
-
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
660
|
-
timeout ||= @sdk_configuration.timeout
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
connection = @sdk_configuration.client
|
|
664
|
-
|
|
665
|
-
hook_ctx = SDKHooks::HookContext.new(
|
|
666
|
-
config: @sdk_configuration,
|
|
667
|
-
base_url: base_url,
|
|
668
|
-
oauth2_scopes: [],
|
|
669
|
-
operation_id: 'get_product_categories_v1_products_categories__get',
|
|
670
|
-
security_source: @sdk_configuration.security_source
|
|
671
|
-
)
|
|
672
|
-
|
|
673
|
-
error = T.let(nil, T.nilable(StandardError))
|
|
674
|
-
http_response = T.let(nil, T.nilable(Faraday::Response))
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
begin
|
|
678
|
-
http_response = T.must(connection).get(url) do |req|
|
|
679
|
-
req.headers.merge!(headers)
|
|
680
|
-
req.options.timeout = timeout unless timeout.nil?
|
|
681
|
-
Utils.configure_request_security(req, security)
|
|
682
|
-
|
|
683
|
-
@sdk_configuration.hooks.before_request(
|
|
684
|
-
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
685
|
-
hook_ctx: hook_ctx
|
|
686
|
-
),
|
|
687
|
-
request: req
|
|
688
|
-
)
|
|
689
|
-
end
|
|
690
|
-
rescue StandardError => e
|
|
691
|
-
error = e
|
|
692
|
-
ensure
|
|
693
|
-
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
694
|
-
http_response = @sdk_configuration.hooks.after_error(
|
|
695
|
-
error: error,
|
|
696
|
-
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
|
697
|
-
hook_ctx: hook_ctx
|
|
698
|
-
),
|
|
699
|
-
response: http_response
|
|
700
|
-
)
|
|
701
|
-
else
|
|
702
|
-
http_response = @sdk_configuration.hooks.after_success(
|
|
703
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
704
|
-
hook_ctx: hook_ctx
|
|
705
|
-
),
|
|
706
|
-
response: http_response
|
|
707
|
-
)
|
|
708
|
-
end
|
|
709
|
-
|
|
710
|
-
if http_response.nil?
|
|
711
|
-
raise error if !error.nil?
|
|
712
|
-
raise 'no response'
|
|
713
|
-
end
|
|
714
|
-
end
|
|
715
|
-
|
|
716
|
-
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
717
|
-
if Utils.match_status_code(http_response.status, ['200'])
|
|
718
|
-
if Utils.match_content_type(content_type, 'application/json')
|
|
719
|
-
@sdk_configuration.hooks.after_success(
|
|
720
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
721
|
-
hook_ctx: hook_ctx
|
|
722
|
-
),
|
|
723
|
-
response: http_response
|
|
724
|
-
)
|
|
725
|
-
response_data = http_response.env.response_body
|
|
726
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Crystalline::Array.new(Models::Shared::ProductCategories))
|
|
727
|
-
|
|
728
|
-
return obj
|
|
729
|
-
else
|
|
730
|
-
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'
|
|
731
|
-
end
|
|
732
|
-
elsif Utils.match_status_code(http_response.status, ['422'])
|
|
733
|
-
if Utils.match_content_type(content_type, 'application/json')
|
|
734
|
-
@sdk_configuration.hooks.after_success(
|
|
735
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
736
|
-
hook_ctx: hook_ctx
|
|
737
|
-
),
|
|
738
|
-
response: http_response
|
|
739
|
-
)
|
|
740
|
-
response_data = http_response.env.response_body
|
|
741
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::HTTPValidationError)
|
|
742
|
-
raise obj
|
|
743
|
-
else
|
|
744
|
-
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'
|
|
745
|
-
end
|
|
746
|
-
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
|
747
|
-
raise ::KintsugiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
748
|
-
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
|
749
|
-
raise ::KintsugiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
750
|
-
else
|
|
751
|
-
raise ::KintsugiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown status code received'
|
|
752
|
-
|
|
753
|
-
end
|
|
754
|
-
end
|
|
755
347
|
end
|
|
756
348
|
end
|
|
@@ -34,9 +34,6 @@ module KintsugiSDK
|
|
|
34
34
|
sig { returns(T.nilable(Float)) }
|
|
35
35
|
attr_accessor :timeout
|
|
36
36
|
|
|
37
|
-
sig { returns(T.nilable(T::Boolean)) }
|
|
38
|
-
attr_accessor :debug_logging
|
|
39
|
-
|
|
40
37
|
|
|
41
38
|
sig { returns(T.nilable(T.proc.returns(T.nilable(Models::Shared::Security)))) }
|
|
42
39
|
attr_accessor :security_source
|
|
@@ -74,11 +71,10 @@ module KintsugiSDK
|
|
|
74
71
|
security: T.nilable(Models::Shared::Security),
|
|
75
72
|
security_source: T.nilable(T.proc.returns(Models::Shared::Security)),
|
|
76
73
|
server_url: T.nilable(String),
|
|
77
|
-
server_idx: T.nilable(Integer)
|
|
78
|
-
debug_logging: T.nilable(T::Boolean)
|
|
74
|
+
server_idx: T.nilable(Integer)
|
|
79
75
|
).void
|
|
80
76
|
end
|
|
81
|
-
def initialize(client, hooks, retry_config, timeout_ms, security, security_source, server_url, server_idx
|
|
77
|
+
def initialize(client, hooks, retry_config, timeout_ms, security, security_source, server_url, server_idx)
|
|
82
78
|
@client = client
|
|
83
79
|
@hooks = hooks
|
|
84
80
|
@retry_config = retry_config
|
|
@@ -93,10 +89,9 @@ module KintsugiSDK
|
|
|
93
89
|
end
|
|
94
90
|
@language = 'ruby'
|
|
95
91
|
@openapi_doc_version = '1.0.0'
|
|
96
|
-
@sdk_version = '5.
|
|
97
|
-
@gen_version = '2.
|
|
98
|
-
@user_agent = 'speakeasy-sdk/ruby 5.
|
|
99
|
-
@debug_logging = debug_logging.nil? ? (ENV['KINTSUGI_DEBUG'] == 'true') : debug_logging
|
|
92
|
+
@sdk_version = '5.6.0'
|
|
93
|
+
@gen_version = '2.845.15'
|
|
94
|
+
@user_agent = 'speakeasy-sdk/ruby 5.6.0 2.845.15 1.0.0 kintsugi_sdk'
|
|
100
95
|
end
|
|
101
96
|
|
|
102
97
|
sig { returns([String, T::Hash[Symbol, String]]) }
|
|
@@ -39,7 +39,7 @@ module KintsugiSDK
|
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
sig { params(request: Models::Ops::EstimateTaxV1TaxEstimatePostRequest, timeout_ms: T.nilable(Integer)).returns(Models::Shared::
|
|
42
|
+
sig { params(request: Models::Ops::EstimateTaxV1TaxEstimatePostRequest, timeout_ms: T.nilable(Integer)).returns(Models::Shared::PageTransactionEstimateResponse) }
|
|
43
43
|
def estimate_tax(request:, timeout_ms: nil)
|
|
44
44
|
# estimate_tax - Estimate Tax
|
|
45
45
|
# The Estimate Tax API calculates the estimated tax for a specific
|
|
@@ -54,7 +54,7 @@ module KintsugiSDK
|
|
|
54
54
|
headers['content-type'] = req_content_type
|
|
55
55
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
|
56
56
|
|
|
57
|
-
if form
|
|
57
|
+
if form && !form.empty?
|
|
58
58
|
body = Utils.encode_form(form)
|
|
59
59
|
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
|
60
60
|
body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object]))
|
|
@@ -76,7 +76,7 @@ module KintsugiSDK
|
|
|
76
76
|
hook_ctx = SDKHooks::HookContext.new(
|
|
77
77
|
config: @sdk_configuration,
|
|
78
78
|
base_url: base_url,
|
|
79
|
-
oauth2_scopes:
|
|
79
|
+
oauth2_scopes: nil,
|
|
80
80
|
operation_id: 'estimate_tax_v1_tax_estimate_post',
|
|
81
81
|
security_source: @sdk_configuration.security_source
|
|
82
82
|
)
|
|
@@ -136,7 +136,7 @@ module KintsugiSDK
|
|
|
136
136
|
response: http_response
|
|
137
137
|
)
|
|
138
138
|
response_data = http_response.env.response_body
|
|
139
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Shared::
|
|
139
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Shared::PageTransactionEstimateResponse)
|
|
140
140
|
|
|
141
141
|
return obj
|
|
142
142
|
else
|