Class: StickyIoRestfulApiV2025731::ShippingController

Inherits:
BaseController
  • Object
show all
Defined in:
lib/sticky_io_restful_api_v2025731/controllers/shipping_controller.rb

Overview

ShippingController

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, user_agent_parameters

Constructor Details

This class inherits a constructor from StickyIoRestfulApiV2025731::BaseController

Instance Method Details

#create_shipping_method(body, domain, v2_ext) ⇒ ApiResponse

Fetch a specific shipping method object by ID. **Request Data** Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description | | — | — | — | — | — | | id | Required | - | Integer | The shipping method ID. | | name | Required | - | String | The shipping method name. | | description | Required | - | String | The shipping method description. | | service_code | Required | - | String | The shipping method service code. These codes are used per order to pass information to fulfillment and will be provided by your fulfillment provider if needed | | threshold_amount | Optional | | NULL,String(double) | If an order total is over the threshold amount, the threshold charge amount will be charged for shipping on the order | | threshold_charge_amount | Optional | | NULL,String(double) | The shipping method threshold charge amount, applies conditionally | | freight_code | Optional | | String | The shipping method freight code charge paid for carriage or transportation of goods by air, land, or sea. Enter in your Tax Fright Code if required by your Tax Provider | | amount_trial | Required | - | String(double) | Initial/trial shipping price | | amount_recurring | Required | - | String(double) | recurring subscription shipping price | | type_id | Required | - | Integer | The existed shipping type ID. | description here

Parameters:

  • body (CreateShippingMethodRequest)

    Required parameter: TODO: type

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/sticky_io_restful_api_v2025731/controllers/shipping_controller.rb', line 161

def create_shipping_method(body,
                           domain,
                           v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/.{domain}{v2_ext}shipping',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(CreateShippingMethod.method(:from_hash))
                .is_api_response(true))
    .execute
end

#delete_shipping_method(domain, v2_ext, shipping_id) ⇒ ApiResponse

Delete an existing shipping method. here

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

  • shipping_id (String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
# File 'lib/sticky_io_restful_api_v2025731/controllers/shipping_controller.rb', line 255

def delete_shipping_method(domain,
                           v2_ext,
                           shipping_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::DELETE,
                                 '/.{domain}{v2_ext}shipping/{shipping_id}',
                                 Server::SERVER_1)
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(shipping_id, key: 'shipping_id')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(DeleteShippingMethod.method(:from_hash))
                .is_api_response(true))
    .execute
end

#get_shipping_method(domain, v2_ext) ⇒ ApiResponse

Fetch a specific shipping method object by ID. **Response Data** Response parameters expected in the shipping method object contained within the data field object: | Field | Data Type | Description | | — | — | — | | id | Integer | The shipping method ID. | | name | String | The shipping method name. | | description | String | The shipping method description. | | service_code | String | The shipping method service code. These codes are used per order to pass information to fulfillment and will be provided by your fulfillment provider if needed | | threshold_amount | NULL,String(double) | If an order total is over the threshold amount, the threshold charge amount will be charged for shipping on the order | | threshold_charge_amount | NULL,String(double) | The shipping method threshold charge amount, applies conditionally | | freight_code | String | The shipping method freight code charge paid for carriage or transportation of goods by air, land, or sea. Enter in your Tax Fright Code if required by your Tax Provider | | amount_trial | String(double) | Initial/trial shipping price | | amount_recurring | String(double) | recurring subscription shipping price | | created_at | String | A timestamp that represents when the shipping method was created. | | updated_at | String,NULL | A timestamp that represents when the shipping method was last updated. | | type | Object | The shipping type object associated with this shipping method. Shipping Groups house shipping codes which are typically dictated by a fulfillment provider | | type.id | Integer | The shipping type ID. | | type.name | String | The shipping type name. | | type.code | String | The shipping type code. | | type.created_at | String | A timestamp that represents when the shipping type was created. | | type.updated_at | String,NULL | A timestamp that represents when the shipping type was last updated. |

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/sticky_io_restful_api_v2025731/controllers/shipping_controller.rb', line 110

def get_shipping_method(domain,
                        v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v2_ext}shipping/16',
                                 Server::SERVER_1)
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(GetShippingMethod.method(:from_hash))
                .is_api_response(true))
    .execute
end

#get_shipping_methods(domain, v2_ext) ⇒ ApiResponse

Fetch a list of shipping method objects. **Response Data** Response parameters expected in each shipping method object contained within the ‘data` field array: | Field | Data Type | Description | | — | — | — | | id | Integer | The shipping method ID. | | name | String | The shipping method name. | | description | String | The shipping method description. | | service_code | String | The shipping method service code. These codes are used per order to pass information to fulfillment and will be provided by your fulfillment provider if needed | | threshold_amount | NULL,String(double) | If an order total is over the threshold amount, the threshold charge amount will be charged for shipping on the order | | threshold_charge_amount | NULL,String(double) | The shipping method threshold charge amount, applies conditionally | | freight_code | String | The shipping method freight code charge paid for carriage or transportation of goods by air, land, or sea. Enter in your Tax Fright Code if required by your Tax Provider | | amount_trial | String(double) | Initial/trial shipping price | | amount_recurring | String(double) | recurring subscription shipping price | | created_at | String | A timestamp that represents when the shipping method was created. | | updated_at | String,NULL | A timestamp that represents when the shipping method was last updated. | | type | Object | The shipping type object associated with this shipping method. Shipping Groups house shipping codes which are typically dictated by a fulfillment provider | | type.id | Integer | The shipping type ID. | | type.name | String | The shipping type name. | | type.code | String | The shipping type code. | | type.created_at | String | A timestamp that represents when the shipping type was created. | | type.updated_at | String,NULL | A timestamp that represents when the shipping type was last updated. |

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/sticky_io_restful_api_v2025731/controllers/shipping_controller.rb', line 49

def get_shipping_methods(domain,
                         v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v2_ext}shipping',
                                 Server::SERVER_1)
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(GetShippingMethods.method(:from_hash))
                .is_api_response(true))
    .execute
end

#update_shipping_method(body, domain, v2_ext, shipping_id) ⇒ ApiResponse

Fetch a specific shipping method object by ID. **Request Data** Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description | | — | — | — | — | — | | id | Optional | - | Integer | The shipping method ID. | | name | Optional | - | String | The shipping method name. | | description | Optional | - | String | The shipping method description. | | service_code | Optional | - | String | The shipping method service code. These codes are used per order to pass information to fulfillment and will be provided by your fulfillment provider if needed | | threshold_amount | Optional | | NULL,String(double) | If an order total is over the threshold amount, the threshold charge amount will be charged for shipping on the order | | threshold_charge_amount | Optional | | NULL,String(double) | The shipping method threshold charge amount, applies conditionally | | freight_code | Optional | | String | The shipping method freight code charge paid for carriage or transportation of goods by air, land, or sea. Enter in your Tax Fright Code if required by your Tax Provider | | amount_trial | Optional | - | String(double) | Initial/trial shipping price | | amount_recurring | Optional | - | String(double) | recurring subscription shipping price | | type_id | Optional | - | Integer | The existed shipping type ID. | description here here

Parameters:

  • body (UpdateShippingMethodRequest)

    Required parameter: TODO: type

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

  • shipping_id (String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/sticky_io_restful_api_v2025731/controllers/shipping_controller.rb', line 219

def update_shipping_method(body,
                           domain,
                           v2_ext,
                           shipping_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::PUT,
                                 '/.{domain}{v2_ext}shipping/{shipping_id}',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(shipping_id, key: 'shipping_id')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(UpdateShippingMethod.method(:from_hash))
                .is_api_response(true))
    .execute
end