Class: CheckoutSdk::ApiClient
- Inherits:
-
Object
- Object
- CheckoutSdk::ApiClient
- Defined in:
- lib/checkout_sdk/api_client.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#log ⇒ Object
Returns the value of attribute log.
-
#multipart_client ⇒ Object
Returns the value of attribute multipart_client.
Instance Method Summary collapse
-
#initialize(configuration, uri) ⇒ ApiClient
constructor
A new instance of ApiClient.
- #invoke_delete(path, authorization) ⇒ Object
- #invoke_get(path, authorization, params = nil) ⇒ Object
- #invoke_patch(path, authorization, request = nil) ⇒ Object
- #invoke_post(path, authorization, request = nil, idempotency_key = nil) ⇒ Object
- #invoke_put(path, authorization, request) ⇒ Object
- #submit_file(path, authorization, request) ⇒ Object
Constructor Details
#initialize(configuration, uri) ⇒ ApiClient
Returns a new instance of ApiClient.
9 10 11 12 13 14 15 |
# File 'lib/checkout_sdk/api_client.rb', line 9 def initialize(configuration, uri) @client = configuration.http_client.clone @client.url_prefix = uri @multipart_client = configuration.multipart_http_client.clone @multipart_client.url_prefix = uri @log = configuration.logger end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
7 8 9 |
# File 'lib/checkout_sdk/api_client.rb', line 7 def client @client end |
#log ⇒ Object
Returns the value of attribute log.
7 8 9 |
# File 'lib/checkout_sdk/api_client.rb', line 7 def log @log end |
#multipart_client ⇒ Object
Returns the value of attribute multipart_client.
7 8 9 |
# File 'lib/checkout_sdk/api_client.rb', line 7 def multipart_client @multipart_client end |
Instance Method Details
#invoke_delete(path, authorization) ⇒ Object
33 34 35 |
# File 'lib/checkout_sdk/api_client.rb', line 33 def invoke_delete(path, ) invoke(:delete, path, ) end |
#invoke_get(path, authorization, params = nil) ⇒ Object
17 18 19 |
# File 'lib/checkout_sdk/api_client.rb', line 17 def invoke_get(path, , params = nil) invoke(:get, path, , params: params) end |
#invoke_patch(path, authorization, request = nil) ⇒ Object
29 30 31 |
# File 'lib/checkout_sdk/api_client.rb', line 29 def invoke_patch(path, , request = nil) invoke(:patch, path, , request) end |
#invoke_post(path, authorization, request = nil, idempotency_key = nil) ⇒ Object
21 22 23 |
# File 'lib/checkout_sdk/api_client.rb', line 21 def invoke_post(path, , request = nil, idempotency_key = nil) invoke(:post, path, , request, idempotency_key) end |
#invoke_put(path, authorization, request) ⇒ Object
25 26 27 |
# File 'lib/checkout_sdk/api_client.rb', line 25 def invoke_put(path, , request) invoke(:put, path, , request) end |
#submit_file(path, authorization, request) ⇒ Object
37 38 39 |
# File 'lib/checkout_sdk/api_client.rb', line 37 def submit_file(path, , request) upload(path, , request) end |