class EasyPost::Services::ScanForm
Constants
Public Instance Methods
all(params = {})
click to toggle source
Retrieve a list of ScanForms
# File lib/easypost/services/scan_form.rb, line 21 def all(params = {}) filters = { key: 'scan_forms' } get_all_helper('scan_forms', MODEL_CLASS, params, filters) end
create(params = {})
click to toggle source
Create a ScanForm
.
# File lib/easypost/services/scan_form.rb, line 7 def create(params = {}) response = @client.make_request(:post, 'scan_forms', params) EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS) end
get_next_page(collection, page_size = nil)
click to toggle source
Get the next page of ScanForms.
# File lib/easypost/services/scan_form.rb, line 28 def get_next_page(collection, page_size = nil) raise EasyPost::Errors::EndOfPaginationError.new unless more_pages?(collection) params = { before_id: collection.scan_forms.last.id } params[:page_size] = page_size unless page_size.nil? all(params) end
retrieve(id)
click to toggle source
Retrieve a ScanForm
.
# File lib/easypost/services/scan_form.rb, line 14 def retrieve(id) response = @client.make_request(:get, "scan_forms/#{id}") EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS) end