Class: NewStoreApi::OrderInjectionConfigController
- Inherits:
-
BaseController
- Object
- BaseController
- NewStoreApi::OrderInjectionConfigController
- Defined in:
- lib/new_store_api/controllers/order_injection_config_controller.rb
Overview
OrderInjectionConfigController
Constant Summary
Constants inherited from BaseController
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
-
#create_order_injection_configuration(version, body: nil) ⇒ OrderInjectionConfigurationResponse
Use this method to create a new order injection configuration or completely replace the current configuration for your business.
-
#show_order_injection_configuration ⇒ OrderInjectionConfigurationResponse
Retrieves the current order injection configuration set up for your business.
-
#update_order_injection_configuration(version, body: nil) ⇒ OrderInjectionConfigurationResponse
Updates the current order injection configuration for your business.
Methods inherited from BaseController
#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent
Constructor Details
This class inherits a constructor from NewStoreApi::BaseController
Instance Method Details
#create_order_injection_configuration(version, body: nil) ⇒ OrderInjectionConfigurationResponse
Use this method to create a new order injection configuration or completely replace the current configuration for your business. The version value in the query parameter must either be set to 1 or it must match the latest version returned by the GET endpoint. updated config value
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/new_store_api/controllers/order_injection_config_controller.rb', line 62 def create_order_injection_configuration(version, body: nil) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/v1/r/config/order_injection', Server::API) .query_param(new_parameter(version, key: 'version')) .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('oauth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(OrderInjectionConfigurationResponse.method(:from_hash))) .execute end |
#show_order_injection_configuration ⇒ OrderInjectionConfigurationResponse
Retrieves the current order injection configuration set up for your business. The response payload also contains the current version of the configuration, the timestamp when it was last updated, and who updated it.
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/new_store_api/controllers/order_injection_config_controller.rb', line 15 def show_order_injection_configuration @api_call .request(new_request_builder(HttpMethodEnum::GET, '/v1/r/config/order_injection', Server::API) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('oauth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(OrderInjectionConfigurationResponse.method(:from_hash))) .execute end |
#update_order_injection_configuration(version, body: nil) ⇒ OrderInjectionConfigurationResponse
Updates the current order injection configuration for your business. The version value in the query parameter must match the latest version returned by the GET endpoint. updated config value
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/new_store_api/controllers/order_injection_config_controller.rb', line 35 def update_order_injection_configuration(version, body: nil) @api_call .request(new_request_builder(HttpMethodEnum::PATCH, '/v1/r/config/order_injection', Server::API) .query_param(new_parameter(version, key: 'version')) .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('oauth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(OrderInjectionConfigurationResponse.method(:from_hash))) .execute end |