Class: EasyPost::Services::EndShipper
- Defined in:
- lib/easypost/services/end_shipper.rb
Constant Summary collapse
- MODEL_CLASS =
EasyPost::Models::EndShipper
Instance Method Summary collapse
-
#all(params = {}) ⇒ Object
Retrieve all EndShipper objects.
-
#create(params = {}) ⇒ Object
Create an EndShipper object.
-
#retrieve(id) ⇒ Object
Retrieve an EndShipper object.
-
#update(id, params) ⇒ Object
Updates an EndShipper object.
Methods inherited from Service
Constructor Details
This class inherits a constructor from EasyPost::Services::Service
Instance Method Details
#all(params = {}) ⇒ Object
Retrieve all EndShipper objects.
19 20 21 |
# File 'lib/easypost/services/end_shipper.rb', line 19 def all(params = {}) @client.make_request(:get, 'end_shippers', MODEL_CLASS, params) end |
#create(params = {}) ⇒ Object
Create an EndShipper object.
7 8 9 10 11 |
# File 'lib/easypost/services/end_shipper.rb', line 7 def create(params = {}) wrapped_params = { address: params } @client.make_request(:post, 'end_shippers', MODEL_CLASS, wrapped_params) end |
#retrieve(id) ⇒ Object
Retrieve an EndShipper object.
14 15 16 |
# File 'lib/easypost/services/end_shipper.rb', line 14 def retrieve(id) @client.make_request(:get, "end_shippers/#{id}", MODEL_CLASS) end |
#update(id, params) ⇒ Object
Updates an EndShipper object. This requires all parameters to be set.
24 25 26 27 28 |
# File 'lib/easypost/services/end_shipper.rb', line 24 def update(id, params) wrapped_params = { address: params } @client.make_request(:put, "end_shippers/#{id}", MODEL_CLASS, wrapped_params) end |