kintsugi_sdk 5.5.14 → 5.6.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/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 +111 -19
- data/lib/crystalline/utils.rb +13 -0
- data/lib/kintsugi_sdk/addressvalidation.rb +24 -16
- data/lib/kintsugi_sdk/customers.rb +76 -53
- data/lib/kintsugi_sdk/exemptions.rb +55 -38
- data/lib/kintsugi_sdk/models/errors/apierror.rbi +2 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_address_validation_responses_validationerrorresponse.rb +0 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_address_validation_responses_validationerrorresponse.rbi +1 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_customers_responses_validationerrorresponse.rb +0 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_customers_responses_validationerrorresponse.rbi +1 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_exemptions_responses_validationerrorresponse.rb +0 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_exemptions_responses_validationerrorresponse.rbi +1 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_products_responses_validationerrorresponse.rb +0 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_products_responses_validationerrorresponse.rbi +1 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_tax_estimation_responses_validationerrorresponse.rb +0 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_tax_estimation_responses_validationerrorresponse.rbi +1 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_transactions_responses_validationerrorresponse.rb +0 -1
- data/lib/kintsugi_sdk/models/errors/backend_src_transactions_responses_validationerrorresponse.rbi +1 -1
- data/lib/kintsugi_sdk/models/errors/errorresponse.rb +0 -1
- data/lib/kintsugi_sdk/models/errors/errorresponse.rbi +1 -1
- data/lib/kintsugi_sdk/models/errors/httpvalidationerror.rb +0 -1
- data/lib/kintsugi_sdk/models/errors/httpvalidationerror.rbi +1 -1
- data/lib/kintsugi_sdk/models/ops/createtransactionbycustomer_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/createtransactionbycustomer_request.rbi +1 -1
- data/lib/kintsugi_sdk/models/ops/estimate_tax_v1_tax_estimate_post_request.rb +2 -3
- data/lib/kintsugi_sdk/models/ops/estimate_tax_v1_tax_estimate_post_request.rbi +1 -1
- 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_external_id_v1_customers_external_external_id_get_request.rbi +1 -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_customer_by_id_v1_customers_customer_id_get_request.rbi +1 -1
- data/lib/kintsugi_sdk/models/ops/get_customers_v1_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/get_customers_v1_request.rbi +1 -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_exemption_by_id_v1_exemptions_exemption_id_get_request.rbi +1 -1
- data/lib/kintsugi_sdk/models/ops/get_exemptions_v1_exemptions_get_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/get_exemptions_v1_exemptions_get_request.rbi +1 -1
- data/lib/kintsugi_sdk/models/ops/get_nexus_for_org_v1_nexus_get_request.rb +6 -3
- data/lib/kintsugi_sdk/models/ops/get_nexus_for_org_v1_nexus_get_request.rbi +3 -1
- 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_product_by_id_v1_products_product_id_get_request.rbi +1 -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_transaction_by_id_v1_transactions_transaction_id_get_request.rbi +1 -1
- data/lib/kintsugi_sdk/models/ops/get_transactions_v1_transactions_get_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/get_transactions_v1_transactions_get_request.rbi +1 -1
- data/lib/kintsugi_sdk/models/ops/getexemptionattachments_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/getexemptionattachments_request.rbi +1 -1
- data/lib/kintsugi_sdk/models/ops/gettransactionbyexternalid_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/gettransactionbyexternalid_request.rbi +1 -1
- data/lib/kintsugi_sdk/models/ops/gettransactionsbycustomer_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/gettransactionsbycustomer_request.rbi +1 -1
- data/lib/kintsugi_sdk/models/ops/gettransactionsbyfiling_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/gettransactionsbyfiling_request.rbi +1 -1
- data/lib/kintsugi_sdk/models/ops/search_v1_address_validation_search_post_security.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/search_v1_address_validation_search_post_security.rbi +1 -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_customer_v1_customers_customer_id_put_request.rbi +1 -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_product_v1_products_product_id_put_request.rbi +1 -1
- data/lib/kintsugi_sdk/models/ops/update_transaction_v1_transactions_transaction_id_put_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/update_transaction_v1_transactions_transaction_id_put_request.rbi +1 -1
- data/lib/kintsugi_sdk/models/ops/uploadexemptioncert_request.rb +0 -1
- data/lib/kintsugi_sdk/models/ops/uploadexemptioncert_request.rbi +1 -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/addressbase.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/addresses.rb +3 -4
- data/lib/kintsugi_sdk/models/shared/addresses.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/addressresponsedata.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/addressresponsedata.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/addresssearchresponse.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/addresssearchresponse.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/addressstatus.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/addressstatus.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/addresssubmittedresponse.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/addresssubmittedresponse.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/addresstype.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/addresstype.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/appliedto.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/appliedto.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/attachmentread.rb +1 -2
- data/lib/kintsugi_sdk/models/shared/attachmentread.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/backend_src_address_validation_responses_validationerroritem.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/backend_src_address_validation_responses_validationerroritem.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/backend_src_customers_responses_validationerroritem.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/backend_src_customers_responses_validationerroritem.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/backend_src_exemptions_models_exemptionread.rb +4 -5
- data/lib/kintsugi_sdk/models/shared/backend_src_exemptions_models_exemptionread.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/backend_src_exemptions_responses_validationerroritem.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/backend_src_exemptions_responses_validationerroritem.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/backend_src_exemptions_serializers_exemptionread.rb +4 -5
- data/lib/kintsugi_sdk/models/shared/backend_src_exemptions_serializers_exemptionread.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/backend_src_products_responses_validationerroritem.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/backend_src_products_responses_validationerroritem.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/backend_src_tax_estimation_responses_validationerroritem.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/backend_src_tax_estimation_responses_validationerroritem.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/backend_src_transactions_responses_validationerroritem.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/backend_src_transactions_responses_validationerroritem.rbi +1 -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/body_upload_exemption_certificate_v1_exemptions_exemption_id_attachments_post.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/countrycodeenum.rb +1 -3
- data/lib/kintsugi_sdk/models/shared/countrycodeenum.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/currencyenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/currencyenum.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/customerbase.rb +4 -5
- data/lib/kintsugi_sdk/models/shared/customerbase.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/customerbasebase.rb +4 -5
- data/lib/kintsugi_sdk/models/shared/customerbasebase.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/customerbasepublic.rb +4 -5
- data/lib/kintsugi_sdk/models/shared/customerbasepublic.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/customercreate.rb +4 -5
- data/lib/kintsugi_sdk/models/shared/customercreate.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/customerread.rb +4 -5
- data/lib/kintsugi_sdk/models/shared/customerread.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/customertaxregistrationread.rb +2 -3
- data/lib/kintsugi_sdk/models/shared/customertaxregistrationread.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/customertaxtypeenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/customertaxtypeenum.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/customerupdate.rb +4 -5
- data/lib/kintsugi_sdk/models/shared/customerupdate.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/discountbuilder.rb +2 -3
- data/lib/kintsugi_sdk/models/shared/discountbuilder.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/exemption.rb +5 -6
- data/lib/kintsugi_sdk/models/shared/exemption.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/exemptioncreate.rb +4 -5
- data/lib/kintsugi_sdk/models/shared/exemptioncreate.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/exemptionrequired.rb +6 -5
- data/lib/kintsugi_sdk/models/shared/exemptionrequired.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/exemptionstatus.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/exemptionstatus.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/exemptiontype.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/exemptiontype.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/fastapi_pagination_default_page_exemptionread_2.rb +3 -4
- data/lib/kintsugi_sdk/models/shared/fastapi_pagination_default_page_exemptionread_2.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/file.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/file.rbi +1 -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/jurisdictiontype.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/nexusresponse.rb +41 -22
- data/lib/kintsugi_sdk/models/shared/nexusresponse.rbi +11 -1
- data/lib/kintsugi_sdk/models/shared/nexusstateenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/nexusstateenum.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/nexusstatusenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/nexusstatusenum.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/nexustypeenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/nexustypeenum.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/page_customerread_.rb +3 -4
- data/lib/kintsugi_sdk/models/shared/page_customerread_.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/page_nexusresponse_.rb +3 -4
- data/lib/kintsugi_sdk/models/shared/page_nexusresponse_.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/page_transactionestimateresponse_.rb +3 -4
- data/lib/kintsugi_sdk/models/shared/page_transactionestimateresponse_.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/page_transactionread_.rb +3 -4
- data/lib/kintsugi_sdk/models/shared/page_transactionread_.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/periodmodelenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/periodmodelenum.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/processingstatusenum.rb +1 -3
- data/lib/kintsugi_sdk/models/shared/processingstatusenum.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/productread.rb +12 -9
- data/lib/kintsugi_sdk/models/shared/productread.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/productstatusenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/productstatusenum.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/productupdate.rb +10 -7
- data/lib/kintsugi_sdk/models/shared/productupdate.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/registration.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/registration.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/registrationsregimeenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/registrationsregimeenum.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/relatedentitytype.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/relatedentitytype.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/salesortransactionsenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/salesortransactionsenum.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/security.rb +2 -3
- data/lib/kintsugi_sdk/models/shared/security.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/sourceenum.rb +6 -3
- data/lib/kintsugi_sdk/models/shared/sourceenum.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/statusenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/statusenum.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/taxexemptionenum.rb +1 -3
- data/lib/kintsugi_sdk/models/shared/taxexemptionenum.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/taxitembuilder.rb +4 -5
- data/lib/kintsugi_sdk/models/shared/taxitembuilder.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/taxitemestimate.rb +1 -2
- data/lib/kintsugi_sdk/models/shared/taxitemestimate.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/taxitemread.rb +4 -5
- data/lib/kintsugi_sdk/models/shared/taxitemread.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/taxitemreturnreasonenum.rb +2 -3
- data/lib/kintsugi_sdk/models/shared/taxitemreturnreasonenum.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/taxitemtypeenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/taxitemtypeenum.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/taxliabilitysourceenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/taxliabilitysourceenum.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/transactionaddressbuilder.rb +3 -4
- data/lib/kintsugi_sdk/models/shared/transactionaddressbuilder.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/transactionaddresspublic.rb +2 -3
- data/lib/kintsugi_sdk/models/shared/transactionaddresspublic.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/transactionaddressread_output.rb +3 -4
- data/lib/kintsugi_sdk/models/shared/transactionaddressread_output.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/transactioncreate.rb +23 -19
- data/lib/kintsugi_sdk/models/shared/transactioncreate.rbi +3 -3
- data/lib/kintsugi_sdk/models/shared/transactionestimatepublicrequest.rb +6 -11
- data/lib/kintsugi_sdk/models/shared/transactionestimatepublicrequest.rbi +1 -3
- data/lib/kintsugi_sdk/models/shared/transactionestimateresponse.rb +7 -12
- data/lib/kintsugi_sdk/models/shared/transactionestimateresponse.rbi +1 -3
- data/lib/kintsugi_sdk/models/shared/transactionestimateresponse_addresses.rb +3 -4
- data/lib/kintsugi_sdk/models/shared/transactionestimateresponse_addresses.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/transactionestimateresponse_type.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/transactionestimateresponse_type.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/transactionexemptstatusenum.rb +2 -3
- data/lib/kintsugi_sdk/models/shared/transactionexemptstatusenum.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/transactionitembuilder.rb +8 -7
- data/lib/kintsugi_sdk/models/shared/transactionitembuilder.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/transactionitemcreateupdate.rb +8 -7
- data/lib/kintsugi_sdk/models/shared/transactionitemcreateupdate.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/transactionitemestimatebase.rb +2 -3
- data/lib/kintsugi_sdk/models/shared/transactionitemestimatebase.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/transactionitemestimateresponse.rb +3 -4
- data/lib/kintsugi_sdk/models/shared/transactionitemestimateresponse.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/transactionitemread.rb +7 -6
- data/lib/kintsugi_sdk/models/shared/transactionitemread.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/transactionpublicrequest.rb +21 -17
- data/lib/kintsugi_sdk/models/shared/transactionpublicrequest.rbi +3 -3
- data/lib/kintsugi_sdk/models/shared/transactionread.rb +24 -20
- data/lib/kintsugi_sdk/models/shared/transactionread.rbi +3 -3
- data/lib/kintsugi_sdk/models/shared/transactionrefundstatus.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/transactionrefundstatus.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/transactionstatusenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/transactionstatusenum.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/transactiontypeenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/transactiontypeenum.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/transactionupdate.rb +20 -16
- data/lib/kintsugi_sdk/models/shared/transactionupdate.rbi +3 -3
- data/lib/kintsugi_sdk/models/shared/treatmentenum.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/treatmentenum.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/type.rb +0 -3
- data/lib/kintsugi_sdk/models/shared/type.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/validationaddress.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/validationaddress.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared/validationerror.rb +0 -1
- data/lib/kintsugi_sdk/models/shared/validationerror.rbi +1 -1
- data/lib/kintsugi_sdk/models/shared.rb +1 -7
- data/lib/kintsugi_sdk/nexus.rb +13 -8
- data/lib/kintsugi_sdk/openapisdk.rb +15 -16
- data/lib/kintsugi_sdk/products.rb +25 -425
- data/lib/kintsugi_sdk/sdk_hooks/hooks.rb +0 -1
- data/lib/kintsugi_sdk/sdkconfiguration.rb +7 -13
- data/lib/kintsugi_sdk/taxestimation.rb +15 -10
- data/lib/kintsugi_sdk/transactions.rb +65 -45
- 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/retries.rb +4 -1
- data/lib/kintsugi_sdk/utils/security.rb +32 -11
- data/lib/kintsugi_sdk/utils/url.rb +11 -5
- data/lib/kintsugi_sdk/utils/utils.rb +45 -3
- metadata +73 -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
|
@@ -39,304 +39,10 @@ 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
42
|
|
|
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
43
|
|
|
236
|
-
|
|
237
|
-
|
|
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
|
-
sig { params(request: Models::Ops::GetProductByIdV1ProductsProductIdGetRequest, timeout_ms: T.nilable(Integer)).returns(Models::Shared::ProductRead) }
|
|
339
|
-
def get(request:, timeout_ms: nil)
|
|
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
|
+
def get(request:, timeout_ms: nil, http_headers: nil)
|
|
340
46
|
# get - Get Product By Id
|
|
341
47
|
# The Get Product By ID API retrieves detailed information about
|
|
342
48
|
# a single product by its unique ID. This API helps in viewing the specific details
|
|
@@ -358,14 +64,14 @@ module KintsugiSDK
|
|
|
358
64
|
|
|
359
65
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
360
66
|
timeout ||= @sdk_configuration.timeout
|
|
361
|
-
|
|
67
|
+
|
|
362
68
|
|
|
363
69
|
connection = @sdk_configuration.client
|
|
364
70
|
|
|
365
71
|
hook_ctx = SDKHooks::HookContext.new(
|
|
366
72
|
config: @sdk_configuration,
|
|
367
73
|
base_url: base_url,
|
|
368
|
-
oauth2_scopes:
|
|
74
|
+
oauth2_scopes: nil,
|
|
369
75
|
operation_id: 'get_product_by_id_v1_products__product_id__get',
|
|
370
76
|
security_source: @sdk_configuration.security_source
|
|
371
77
|
)
|
|
@@ -373,12 +79,15 @@ module KintsugiSDK
|
|
|
373
79
|
error = T.let(nil, T.nilable(StandardError))
|
|
374
80
|
http_response = T.let(nil, T.nilable(Faraday::Response))
|
|
375
81
|
|
|
376
|
-
|
|
82
|
+
|
|
377
83
|
begin
|
|
378
84
|
http_response = T.must(connection).get(url) do |req|
|
|
379
85
|
req.headers.merge!(headers)
|
|
380
86
|
req.options.timeout = timeout unless timeout.nil?
|
|
381
87
|
Utils.configure_request_security(req, security)
|
|
88
|
+
http_headers&.each do |key, value|
|
|
89
|
+
req.headers[key.to_s] = value
|
|
90
|
+
end
|
|
382
91
|
|
|
383
92
|
@sdk_configuration.hooks.before_request(
|
|
384
93
|
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
@@ -406,13 +115,13 @@ module KintsugiSDK
|
|
|
406
115
|
response: http_response
|
|
407
116
|
)
|
|
408
117
|
end
|
|
409
|
-
|
|
118
|
+
|
|
410
119
|
if http_response.nil?
|
|
411
120
|
raise error if !error.nil?
|
|
412
121
|
raise 'no response'
|
|
413
122
|
end
|
|
414
123
|
end
|
|
415
|
-
|
|
124
|
+
|
|
416
125
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
417
126
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
418
127
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -482,11 +191,13 @@ module KintsugiSDK
|
|
|
482
191
|
end
|
|
483
192
|
|
|
484
193
|
|
|
485
|
-
sig { params(request: Models::Ops::UpdateProductV1ProductsProductIdPutRequest, timeout_ms: T.nilable(Integer)).returns(Models::Shared::ProductRead) }
|
|
486
|
-
def update(request:, timeout_ms: nil)
|
|
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
|
+
def update(request:, timeout_ms: nil, http_headers: nil)
|
|
487
196
|
# update - Update Product
|
|
488
197
|
# The Update Product API allows users to modify the details of
|
|
489
|
-
# an existing product identified by its unique product_id
|
|
198
|
+
# an existing product identified by its unique product_id. You can
|
|
199
|
+
# retrieve supported categories and subcategories from
|
|
200
|
+
# [GET /products/categories endpoint](/reference/api/products/get-product-categories)
|
|
490
201
|
url, params = @sdk_configuration.get_server_details
|
|
491
202
|
base_url = Utils.template_url(url, params)
|
|
492
203
|
url = Utils.generate_url(
|
|
@@ -501,7 +212,7 @@ module KintsugiSDK
|
|
|
501
212
|
headers['content-type'] = req_content_type
|
|
502
213
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
|
503
214
|
|
|
504
|
-
if form
|
|
215
|
+
if form && !form.empty?
|
|
505
216
|
body = Utils.encode_form(form)
|
|
506
217
|
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
|
507
218
|
body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object]))
|
|
@@ -515,14 +226,14 @@ module KintsugiSDK
|
|
|
515
226
|
|
|
516
227
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
517
228
|
timeout ||= @sdk_configuration.timeout
|
|
518
|
-
|
|
229
|
+
|
|
519
230
|
|
|
520
231
|
connection = @sdk_configuration.client
|
|
521
232
|
|
|
522
233
|
hook_ctx = SDKHooks::HookContext.new(
|
|
523
234
|
config: @sdk_configuration,
|
|
524
235
|
base_url: base_url,
|
|
525
|
-
oauth2_scopes:
|
|
236
|
+
oauth2_scopes: nil,
|
|
526
237
|
operation_id: 'update_product_v1_products__product_id__put',
|
|
527
238
|
security_source: @sdk_configuration.security_source
|
|
528
239
|
)
|
|
@@ -530,13 +241,16 @@ module KintsugiSDK
|
|
|
530
241
|
error = T.let(nil, T.nilable(StandardError))
|
|
531
242
|
http_response = T.let(nil, T.nilable(Faraday::Response))
|
|
532
243
|
|
|
533
|
-
|
|
244
|
+
|
|
534
245
|
begin
|
|
535
246
|
http_response = T.must(connection).put(url) do |req|
|
|
536
247
|
req.body = body
|
|
537
248
|
req.headers.merge!(headers)
|
|
538
249
|
req.options.timeout = timeout unless timeout.nil?
|
|
539
250
|
Utils.configure_request_security(req, security)
|
|
251
|
+
http_headers&.each do |key, value|
|
|
252
|
+
req.headers[key.to_s] = value
|
|
253
|
+
end
|
|
540
254
|
|
|
541
255
|
@sdk_configuration.hooks.before_request(
|
|
542
256
|
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
@@ -564,13 +278,13 @@ module KintsugiSDK
|
|
|
564
278
|
response: http_response
|
|
565
279
|
)
|
|
566
280
|
end
|
|
567
|
-
|
|
281
|
+
|
|
568
282
|
if http_response.nil?
|
|
569
283
|
raise error if !error.nil?
|
|
570
284
|
raise 'no response'
|
|
571
285
|
end
|
|
572
286
|
end
|
|
573
|
-
|
|
287
|
+
|
|
574
288
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
575
289
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
576
290
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -638,119 +352,5 @@ module KintsugiSDK
|
|
|
638
352
|
|
|
639
353
|
end
|
|
640
354
|
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
|
-
end
|
|
355
|
+
end
|
|
756
356
|
end
|
|
@@ -13,10 +13,9 @@ require_relative 'utils/retries'
|
|
|
13
13
|
module KintsugiSDK
|
|
14
14
|
extend T::Sig
|
|
15
15
|
|
|
16
|
-
SERVERS = [
|
|
16
|
+
SERVERS = T.let([
|
|
17
17
|
'https://api.trykintsugi.com', # 1 - Production API server URL
|
|
18
|
-
].freeze
|
|
19
|
-
SERVERS = T.let(SERVERS, T::Array[String])
|
|
18
|
+
].freeze, T::Array[String])
|
|
20
19
|
# Contains the list of servers available to the SDK
|
|
21
20
|
|
|
22
21
|
class SDKConfiguration
|
|
@@ -34,9 +33,6 @@ module KintsugiSDK
|
|
|
34
33
|
sig { returns(T.nilable(Float)) }
|
|
35
34
|
attr_accessor :timeout
|
|
36
35
|
|
|
37
|
-
sig { returns(T.nilable(T::Boolean)) }
|
|
38
|
-
attr_accessor :debug_logging
|
|
39
|
-
|
|
40
36
|
|
|
41
37
|
sig { returns(T.nilable(T.proc.returns(T.nilable(Models::Shared::Security)))) }
|
|
42
38
|
attr_accessor :security_source
|
|
@@ -74,11 +70,10 @@ module KintsugiSDK
|
|
|
74
70
|
security: T.nilable(Models::Shared::Security),
|
|
75
71
|
security_source: T.nilable(T.proc.returns(Models::Shared::Security)),
|
|
76
72
|
server_url: T.nilable(String),
|
|
77
|
-
server_idx: T.nilable(Integer)
|
|
78
|
-
debug_logging: T.nilable(T::Boolean)
|
|
73
|
+
server_idx: T.nilable(Integer)
|
|
79
74
|
).void
|
|
80
75
|
end
|
|
81
|
-
def initialize(client, hooks, retry_config, timeout_ms, security, security_source, server_url, server_idx
|
|
76
|
+
def initialize(client, hooks, retry_config, timeout_ms, security, security_source, server_url, server_idx)
|
|
82
77
|
@client = client
|
|
83
78
|
@hooks = hooks
|
|
84
79
|
@retry_config = retry_config
|
|
@@ -93,10 +88,9 @@ module KintsugiSDK
|
|
|
93
88
|
end
|
|
94
89
|
@language = 'ruby'
|
|
95
90
|
@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
|
|
91
|
+
@sdk_version = '5.6.1'
|
|
92
|
+
@gen_version = '2.916.2'
|
|
93
|
+
@user_agent = 'speakeasy-sdk/ruby 5.6.1 2.916.2 1.0.0 kintsugi_sdk'
|
|
100
94
|
end
|
|
101
95
|
|
|
102
96
|
sig { returns([String, T::Hash[Symbol, String]]) }
|