Class: NewStoreApi::ShipmentConfigurationsController

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

Overview

ShipmentConfigurationsController

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

#create_configuration_by_name(name, body) ⇒ UsePrioritizedProviderRates | UseCustomizableProviderRates | SetFixServiceLevelShippingPrice | PackingTimeDuration | CustomizationAdapterConfig | CarriersConfig | AdapterHttpTimeout | FulfillmentNodeCustomsInfo | GenerateStaticOptionForDc

TODO: type endpoint description here description here SetFixServiceLevelShippingPrice | PackingTimeDuration | CustomizationAdapterConfig | CarriersConfig | AdapterHttpTimeout | FulfillmentNodeCustomsInfo | GenerateStaticOptionForDc] body Required parameter: TODO: type description here

Parameters:

Returns:



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/new_store_api/controllers/shipment_configurations_controller.rb', line 42

def create_configuration_by_name(name,
                                 body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/fulfillment/configurations/shipments/{name}',
                                 Server::API)
               .template_param(new_parameter(name, key: 'name')
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .validator(proc do |value|
                              UnionTypeLookUp.get(:CreateConfigurationByNameBody)
                                             .validate(value)
                            end))
               .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(proc do |response, should_symbolize|
                  APIHelper.deserialize_union_type(
                    UnionTypeLookUp.get(:CreateConfigurationByNameResponse),
                    response, should_symbolize, true
                  )
                end)
                .deserialize_into(ResponseCreateconfigurationbyname.method(:from_hash)))
    .execute
end

#create_configuration_feature_flags(body) ⇒ ConfigurationFeatureFlags

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

Parameters:

Returns:



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/new_store_api/controllers/shipment_configurations_controller.rb', line 120

def create_configuration_feature_flags(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/fulfillment/configurations/shipments/feature-flags',
                                 Server::API)
               .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(ConfigurationFeatureFlags.method(:from_hash)))
    .execute
end

#show_configuration_by_name(name) ⇒ UsePrioritizedProviderRates | UseCustomizableProviderRates | SetFixServiceLevelShippingPrice | PackingTimeDuration | CustomizationAdapterConfig | CarriersConfig | AdapterHttpTimeout | FulfillmentNodeCustomsInfo | GenerateStaticOptionForDc

TODO: type endpoint description here description here



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/new_store_api/controllers/shipment_configurations_controller.rb', line 13

def show_configuration_by_name(name)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/fulfillment/configurations/shipments/{name}',
                                 Server::API)
               .template_param(new_parameter(name, key: 'name')
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('oauth')))
    .response(new_response_handler
                .deserializer(proc do |response, should_symbolize|
                  APIHelper.deserialize_union_type(
                    UnionTypeLookUp.get(:ShowConfigurationByNameResponse),
                    response, should_symbolize, true
                  )
                end)
                .deserialize_into(ResponseShowconfigurationbyname.method(:from_hash)))
    .execute
end

#show_configuration_feature_flagsConfigurationFeatureFlags

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

Returns:



95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/new_store_api/controllers/shipment_configurations_controller.rb', line 95

def show_configuration_feature_flags
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/fulfillment/configurations/shipments/feature-flags',
                                 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(ConfigurationFeatureFlags.method(:from_hash)))
    .execute
end

#show_configurations_checksHash[String, Mixed]

Designed for humans only: check Provider Rates, Service Levels, PRP and Carriers configurations

Returns:

  • (Hash[String, Mixed])

    Response from the API call.



73
74
75
76
77
78
79
80
81
82
83
# File 'lib/new_store_api/controllers/shipment_configurations_controller.rb', line 73

def show_configurations_checks
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/fulfillment/configurations/shipments/checks',
                                 Server::API)
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('oauth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:dynamic_deserializer)))
    .execute
end