Class: NewStoreApi::ShippingOptionAuditsController

Inherits:
BaseController show all
Defined in:
lib/new_store_api/controllers/shipping_option_audits_controller.rb

Overview

ShippingOptionAuditsController

Constant Summary

Constants inherited from BaseController

BaseController::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseController

#config, #http_call_back

Instance Method Summary collapse

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

#list_shipping_option_audits(search_from, offset: 0, page_size: 15, search_key: nil) ⇒ AuditsResponse

TODO: type endpoint description here here

Parameters:

  • search_from (DateTime)

    Required parameter: TODO: type description

  • offset (Integer) (defaults to: 0)

    Optional parameter: Example:0

  • page_size (Integer) (defaults to: 15)

    Optional parameter: Example:15

  • search_key (String) (defaults to: nil)

    Optional parameter: Example:

Returns:



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/new_store_api/controllers/shipping_option_audits_controller.rb', line 16

def list_shipping_option_audits(search_from,
                                offset: 0,
                                page_size: 15,
                                search_key: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/fulfillment/shipping-audits',
                                 Server::API)
               .query_param(new_parameter(search_from, key: 'search_from'))
               .query_param(new_parameter(offset, key: 'offset'))
               .query_param(new_parameter(page_size, key: 'page_size'))
               .query_param(new_parameter(search_key, key: 'search_key'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('oauth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(AuditsResponse.method(:from_hash)))
    .execute
end

#show_shipping_option_audit(audit_id) ⇒ AuditResponse

TODO: type endpoint description here

Parameters:

  • audit_id (String)

    Required parameter: TODO: type description here

Returns:



39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/new_store_api/controllers/shipping_option_audits_controller.rb', line 39

def show_shipping_option_audit(audit_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/fulfillment/shipping-audits/{audit_id}',
                                 Server::API)
               .template_param(new_parameter(audit_id, key: 'audit_id')
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('oauth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(AuditResponse.method(:from_hash)))
    .execute
end