Class: Ingenico::Connect::SDK::Merchant::Productgroups::ProductgroupsClient
- Inherits:
-
ApiResource
- Object
- ApiResource
- Ingenico::Connect::SDK::Merchant::Productgroups::ProductgroupsClient
- Defined in:
- lib/ingenico/connect/sdk/merchant/productgroups/productgroups_client.rb
Overview
Productgroups client. Thread-safe.
Instance Attribute Summary
Attributes inherited from ApiResource
#client_meta_info, #communicator
Instance Method Summary collapse
-
#find(query, context = nil) ⇒ Object
Resource /{merchantId}/productgroups.
-
#get(payment_product_group_id, query, context = nil) ⇒ Object
Resource /{merchantId}/productgroups/{paymentProductGroupId}.
-
#initialize(parent, path_context) ⇒ ProductgroupsClient
constructor
- parent
- ApiResource path_context
-
Hash of String to String.
Constructor Details
#initialize(parent, path_context) ⇒ ProductgroupsClient
- parent
- path_context
-
Hash of String to String
20 21 22 |
# File 'lib/ingenico/connect/sdk/merchant/productgroups/productgroups_client.rb', line 20 def initialize(parent, path_context) super(parent, path_context) end |
Instance Method Details
#find(query, context = nil) ⇒ Object
Resource /{merchantId}/productgroups
_merchantId__productgroups_get Get payment product groups
- query
-
FindParams
- context
- Returns
- Raises
-
ValidationException if the request was not correct and couldn’t be processed (HTTP status code 400)
- Raises
-
AuthorizationException if the request was not allowed (HTTP status code 403)
- Raises
-
IdempotenceException if an idempotent request caused a conflict (HTTP status code 409)
- Raises
-
ReferenceException if an object was attempted to be referenced that doesn’t exist or has been removed,
or there was a conflict (HTTP status code 404, 409 or 410)
- Raises
-
GlobalCollectException if something went wrong at the GlobalCollect platform,
the GlobalCollect platform was unable to process a message from a downstream partner/acquirer,
or the service that you’re trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
- Raises
-
ApiException if the GlobalCollect platform returned any other error
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/ingenico/connect/sdk/merchant/productgroups/productgroups_client.rb', line 39 def find(query, context=nil) uri = instantiate_uri('/{apiVersion}/{merchantId}/productgroups', nil) return @communicator.get( uri, client_headers, query, Ingenico::Connect::SDK::Domain::Product::PaymentProductGroups, context) rescue ResponseException => e error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |
#get(payment_product_group_id, query, context = nil) ⇒ Object
Resource /{merchantId}/productgroups/{paymentProductGroupId}
_merchantId__productgroups__paymentProductGroupId__get Get payment product group
- payment_product_group_id
-
String
- query
-
GetParams
- context
- Returns
- Raises
-
ValidationException if the request was not correct and couldn’t be processed (HTTP status code 400)
- Raises
-
AuthorizationException if the request was not allowed (HTTP status code 403)
- Raises
-
IdempotenceException if an idempotent request caused a conflict (HTTP status code 409)
- Raises
-
ReferenceException if an object was attempted to be referenced that doesn’t exist or has been removed,
or there was a conflict (HTTP status code 404, 409 or 410)
- Raises
-
GlobalCollectException if something went wrong at the GlobalCollect platform,
the GlobalCollect platform was unable to process a message from a downstream partner/acquirer,
or the service that you’re trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
- Raises
-
ApiException if the GlobalCollect platform returned any other error
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/ingenico/connect/sdk/merchant/productgroups/productgroups_client.rb', line 69 def get(payment_product_group_id, query, context=nil) path_context = { 'paymentProductGroupId' => payment_product_group_id, } uri = instantiate_uri('/{apiVersion}/{merchantId}/productgroups/{paymentProductGroupId}', path_context) return @communicator.get( uri, client_headers, query, Ingenico::Connect::SDK::Domain::Product::PaymentProductGroupResponse, context) rescue ResponseException => e error_type = { 404 => Ingenico::Connect::SDK::Domain::Errors::ErrorResponse, }.fetch(e.status_code, Ingenico::Connect::SDK::Domain::Errors::ErrorResponse) error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |