Class: Increase::Resources::Lockboxes

Inherits:
Object
  • Object
show all
Defined in:
lib/increase/resources/lockboxes.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Lockboxes

Returns a new instance of Lockboxes.



6
7
8
# File 'lib/increase/resources/lockboxes.rb', line 6

def initialize(client:)
  @client = client
end

Instance Method Details

#create(params = {}, opts = {}) ⇒ Increase::Models::Lockbox

Create a Lockbox

Parameters:

  • params (Hash) (defaults to: {})

    Attributes to send in this request.

  • opts (Hash|RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Options Hash (params):

  • :account_id (String)

    The Account checks sent to this Lockbox should be deposited into.

  • :description (String)

    The description you choose for the Lockbox, for display purposes.

Returns:



19
20
21
22
23
24
25
26
# File 'lib/increase/resources/lockboxes.rb', line 19

def create(params = {}, opts = {})
  req = {}
  req[:method] = :post
  req[:path] = "/lockboxes"
  req[:body] = params
  req[:model] = Increase::Models::Lockbox
  @client.request(req, opts)
end

#list(params = {}, opts = {}) ⇒ Increase::Page<Increase::Models::Lockbox>

List Lockboxes

Parameters:

  • params (Hash) (defaults to: {})

    Attributes to send in this request.

  • opts (Hash|RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Options Hash (params):

  • :account_id (String)

    Filter Lockboxes to those associated with the provided Account.

  • :created_at (CreatedAt)
  • :cursor (String)

    Return the page of entries after this one.

  • :idempotency_key (String)

    Filter records to the one with the specified idempotency_key you chose for that object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about idempotency.

  • :limit (Integer)

    Limit the size of the list that is returned. The default (and maximum) is 100 objects.

Returns:



78
79
80
81
82
83
84
85
86
# File 'lib/increase/resources/lockboxes.rb', line 78

def list(params = {}, opts = {})
  req = {}
  req[:method] = :get
  req[:path] = "/lockboxes"
  req[:query] = params
  req[:page] = Increase::Page
  req[:model] = Increase::Models::Lockbox
  @client.request(req, opts)
end

#retrieve(lockbox_id, opts = {}) ⇒ Increase::Models::Lockbox

Retrieve a Lockbox

Parameters:

  • lockbox_id (String)

    The identifier of the Lockbox to retrieve.

  • opts (Hash|RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:



34
35
36
37
38
39
40
# File 'lib/increase/resources/lockboxes.rb', line 34

def retrieve(lockbox_id, opts = {})
  req = {}
  req[:method] = :get
  req[:path] = "/lockboxes/#{lockbox_id}"
  req[:model] = Increase::Models::Lockbox
  @client.request(req, opts)
end

#update(lockbox_id, params = {}, opts = {}) ⇒ Increase::Models::Lockbox

Update a Lockbox

Parameters:

  • lockbox_id (String)

    The identifier of the Lockbox.

  • params (Hash) (defaults to: {})

    Attributes to send in this request.

  • opts (Hash|RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Options Hash (params):

  • :description (String)

    The description you choose for the Lockbox.

  • :status (Symbol)

    This indicates if checks can be sent to the Lockbox.

Returns:



53
54
55
56
57
58
59
60
# File 'lib/increase/resources/lockboxes.rb', line 53

def update(lockbox_id, params = {}, opts = {})
  req = {}
  req[:method] = :patch
  req[:path] = "/lockboxes/#{lockbox_id}"
  req[:body] = params
  req[:model] = Increase::Models::Lockbox
  @client.request(req, opts)
end