Class: EasyPost::Services::CustomsItem

Inherits:
Service
  • Object
show all
Defined in:
lib/easypost/services/customs_item.rb

Constant Summary collapse

MODEL_CLASS =
EasyPost::Models::CustomsItem

Instance Method Summary collapse

Methods inherited from Service

#initialize

Constructor Details

This class inherits a constructor from EasyPost::Services::Service

Instance Method Details

#create(params) ⇒ Object

Create a CustomsItem object



7
8
9
10
11
# File 'lib/easypost/services/customs_item.rb', line 7

def create(params)
  response = @client.make_request(:post, 'customs_items', params)

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

#retrieve(id) ⇒ Object

Retrieve a CustomsItem object



14
15
16
17
18
# File 'lib/easypost/services/customs_item.rb', line 14

def retrieve(id)
  response = @client.make_request(:get, "customs_items/#{id}")

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