class EasyPost::Services::EndShipper

Constants

MODEL_CLASS

EndShipper objects are fully-qualified Address objects that require all parameters and get verified upon creation.

Public Instance Methods

all(params = {}) click to toggle source

Retrieve all EndShipper objects.

# File lib/easypost/services/end_shipper.rb, line 22
def all(params = {})
  response = @client.make_request(:get, 'end_shippers', params)

  EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS)
end
create(params = {}) click to toggle source

Create an EndShipper object.

# File lib/easypost/services/end_shipper.rb, line 7
def create(params = {})
  wrapped_params = { address: params }
  response = @client.make_request(:post, 'end_shippers', wrapped_params)

  EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS)
end
retrieve(id) click to toggle source

Retrieve an EndShipper object.

# File lib/easypost/services/end_shipper.rb, line 15
def retrieve(id)
  response = @client.make_request(:get, "end_shippers/#{id}")

  EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS)
end
update(id, params) click to toggle source

Updates an EndShipper object. This requires all parameters to be set.

# File lib/easypost/services/end_shipper.rb, line 29
def update(id, params)
  wrapped_params = { address: params }
  response = @client.make_request(:put, "end_shippers/#{id}", wrapped_params)

  EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS)
end