Class: KintsugiSDK::OpenApiSDK
- Inherits:
-
Object
- Object
- KintsugiSDK::OpenApiSDK
- Extended by:
- T::Sig
- Defined in:
- lib/kintsugi_sdk/openapisdk.rb
Instance Attribute Summary collapse
-
#address_validation ⇒ Object
Returns the value of attribute address_validation.
-
#customers ⇒ Object
Returns the value of attribute customers.
-
#exemptions ⇒ Object
Returns the value of attribute exemptions.
-
#nexus ⇒ Object
Returns the value of attribute nexus.
-
#products ⇒ Object
Returns the value of attribute products.
-
#tax_estimation ⇒ Object
Returns the value of attribute tax_estimation.
-
#transactions ⇒ Object
Returns the value of attribute transactions.
Instance Method Summary collapse
- #get_url(base_url:, url_variables: nil) ⇒ Object
- #init_sdks ⇒ Object
-
#initialize(client: nil, retry_config: nil, timeout_ms: nil, security: nil, security_source: nil, server_idx: nil, server_url: nil, url_params: nil) ⇒ OpenApiSDK
constructor
A new instance of OpenApiSDK.
Constructor Details
#initialize(client: nil, retry_config: nil, timeout_ms: nil, security: nil, security_source: nil, server_idx: nil, server_url: nil, url_params: nil) ⇒ OpenApiSDK
Returns a new instance of OpenApiSDK.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/kintsugi_sdk/openapisdk.rb', line 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) = { request: { params_encoder: Faraday::FlatParamsEncoder } } [:request][:timeout] = (timeout_ms.to_f / 1000) unless timeout_ms.nil? client ||= Faraday.new(**) do |f| f.request :multipart, {} # f.response :logger, nil, { headers: true, bodies: true, errors: true } end if !server_url.nil? if !url_params.nil? server_url = Utils.template_url(server_url, url_params) end end server_idx = 0 if server_idx.nil? hooks = SDKHooks::Hooks.new @sdk_configuration = SDKConfiguration.new( client, hooks, retry_config, timeout_ms, security, security_source, server_url, server_idx ) @sdk_configuration = hooks.sdk_init(config: @sdk_configuration) init_sdks end |
Instance Attribute Details
#address_validation ⇒ Object
Returns the value of attribute address_validation.
19 20 21 |
# File 'lib/kintsugi_sdk/openapisdk.rb', line 19 def address_validation @address_validation end |
#customers ⇒ Object
Returns the value of attribute customers.
19 20 21 |
# File 'lib/kintsugi_sdk/openapisdk.rb', line 19 def customers @customers end |
#exemptions ⇒ Object
Returns the value of attribute exemptions.
19 20 21 |
# File 'lib/kintsugi_sdk/openapisdk.rb', line 19 def exemptions @exemptions end |
#nexus ⇒ Object
Returns the value of attribute nexus.
19 20 21 |
# File 'lib/kintsugi_sdk/openapisdk.rb', line 19 def nexus @nexus end |
#products ⇒ Object
Returns the value of attribute products.
19 20 21 |
# File 'lib/kintsugi_sdk/openapisdk.rb', line 19 def products @products end |
#tax_estimation ⇒ Object
Returns the value of attribute tax_estimation.
19 20 21 |
# File 'lib/kintsugi_sdk/openapisdk.rb', line 19 def tax_estimation @tax_estimation end |
#transactions ⇒ Object
Returns the value of attribute transactions.
19 20 21 |
# File 'lib/kintsugi_sdk/openapisdk.rb', line 19 def transactions @transactions end |
Instance Method Details
#get_url(base_url:, url_variables: nil) ⇒ Object
91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/kintsugi_sdk/openapisdk.rb', line 91 def get_url(base_url:, url_variables: nil) sd_base_url, = @sdk_configuration.get_server_details if base_url.nil? base_url = sd_base_url end if url_variables.nil? url_variables = end return Utils.template_url base_url, url_variables end |
#init_sdks ⇒ Object
80 81 82 83 84 85 86 87 88 |
# File 'lib/kintsugi_sdk/openapisdk.rb', line 80 def init_sdks @address_validation = AddressValidation.new(@sdk_configuration) @customers = Customers.new(@sdk_configuration) @exemptions = Exemptions.new(@sdk_configuration) @nexus = Nexus.new(@sdk_configuration) @products = Products.new(@sdk_configuration) @transactions = Transactions.new(@sdk_configuration) @tax_estimation = TaxEstimation.new(@sdk_configuration) end |