Class: PlentyClient::Order::Shipping::Information

Inherits:
Object
  • Object
show all
Extended by:
Endpoint, Request
Defined in:
lib/plenty_client/order/shipping/information.rb

Constant Summary collapse

BASE_ORDERS_SHIPPING_INFORMATION_PATH =
'/orders/{orderId}/shipping'.freeze
LIST_ORDERS_SHIPPING_INFORMATION =
'/shipping_information'.freeze
DELETE_ORDER_SHIPPING_INFORMATION =
'/shipping_information'.freeze
CREATE_ORDER_SHIPPING_INFORMATION =
'/shipping_information'.freeze
UPDATE_ORDER_SHIPPING_STATUS =
'/shipping_information/status'.freeze
UPDATE_ORDER_SHIPPING_DATA =
'/shipping_information/additional_data'.freeze

Class Method Summary collapse

Methods included from Endpoint

build_endpoint, routes

Methods included from Request

delete, get, patch, post, put, request

Class Method Details

.create(order_id, body = {}) ⇒ Object



22
23
24
25
# File 'lib/plenty_client/order/shipping/information.rb', line 22

def create(order_id, body = {})
  post(build_endpoint("#{BASE_ORDERS_SHIPPING_INFORMATION_PATH}#{CREATE_ORDER_SHIPPING_INFORMATION}",
                      order: order_id), body)
end

.delete(order_id, body = {}) ⇒ Object



37
38
39
40
# File 'lib/plenty_client/order/shipping/information.rb', line 37

def delete(order_id, body = {})
  delete(build_endpoint("#{BASE_ORDERS_SHIPPING_INFORMATION_PATH}#{DELETE_ORDER_SHIPPING_INFORMATION}",
                        order: order_id), body)
end

.list(order_id, headers = {}, &block) ⇒ Object



17
18
19
20
# File 'lib/plenty_client/order/shipping/information.rb', line 17

def list(order_id, headers = {}, &block)
  get(build_endpoint("#{BASE_ORDERS_SHIPPING_INFORMATION_PATH}#{LIST_ORDERS_SHIPPING_INFORMATION}",
                     order: order_id), headers, &block)
end

.update_data(order_id, body = {}) ⇒ Object



32
33
34
35
# File 'lib/plenty_client/order/shipping/information.rb', line 32

def update_data(order_id, body = {})
  put(build_endpoint("#{BASE_ORDERS_SHIPPING_INFORMATION_PATH}#{UPDATE_ORDER_SHIPPING_DATA}",
                     order: order_id), body)
end

.update_status(order_id, body = {}) ⇒ Object



27
28
29
30
# File 'lib/plenty_client/order/shipping/information.rb', line 27

def update_status(order_id, body = {})
  put(build_endpoint("#{BASE_ORDERS_SHIPPING_INFORMATION_PATH}#{UPDATE_ORDER_SHIPPING_STATUS}",
                     order: order_id), body)
end