Class: NewStoreApi::ShortingsController

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

Overview

ShortingsController

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_shortings(offset: nil, limit: nil, from_date: nil, to_date: nil, type: nil) ⇒ GetShortingsModel

🚧 BETA: This endpoint is in beta and may change.
See API Lifecycle Documentation for details.
here here

Parameters:

  • offset (Integer) (defaults to: nil)

    Optional parameter: TODO: type description here

  • limit (Integer) (defaults to: nil)

    Optional parameter: TODO: type description here

  • from_date (String) (defaults to: nil)

    Optional parameter: TODO: type description

  • to_date (String) (defaults to: nil)

    Optional parameter: TODO: type description here

  • type (ShortingTypeEnum) (defaults to: nil)

    Optional parameter: TODO: type description

Returns:



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/new_store_api/controllers/shortings_controller.rb', line 26

def list_shortings(offset: nil,
                   limit: nil,
                   from_date: nil,
                   to_date: nil,
                   type: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/fulfillment/shortings',
                                 Server::API)
               .query_param(new_parameter(offset, key: 'offset'))
               .query_param(new_parameter(limit, key: 'limit'))
               .query_param(new_parameter(from_date, key: 'from_date'))
               .query_param(new_parameter(to_date, key: 'to_date'))
               .query_param(new_parameter(type, key: 'type'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('oauth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(GetShortingsModel.method(:from_hash)))
    .execute
end