Class: InvoiceLinesClient

Inherits:
Object
  • Object
show all
Defined in:
lib/lockstep_sdk/clients/invoice_lines_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ InvoiceLinesClient

Initialize the InvoiceLinesClient class with an API client instance.

Parameters:

  • connection (LockstepApi)

    The API client object for this connection



22
23
24
# File 'lib/lockstep_sdk/clients/invoice_lines_client.rb', line 22

def initialize(connection)
    @connection = connection
end

Instance Method Details

#create_invoiceline(body:) ⇒ Object

Creates one or more invoice lines within this account and returns the created records

Parameters:

  • body (InvoiceLineModel)


31
32
33
34
# File 'lib/lockstep_sdk/clients/invoice_lines_client.rb', line 31

def create_invoiceline(body:)
    path = "/api/v1/invoice-lines"
    @connection.request(:post, path, body, nil)
end

#delete_invoice_lines(body:) ⇒ Object

Parameters:

  • body (BulkDeleteRequestModel)

    The unique Lockstep Platform ID numbers of the Invoice Lines to delete; NOT the customer’s ERP keys



40
41
42
43
# File 'lib/lockstep_sdk/clients/invoice_lines_client.rb', line 40

def delete_invoice_lines(body:)
    path = "/api/v1/invoice-lines"
    @connection.request(:delete, path, body, nil)
end

#deletes_invoice_line(invoice_line_id:) ⇒ Object

Parameters:

  • invoice_line_id (uuid)

    Unique id of the the InvoiceLine



70
71
72
73
# File 'lib/lockstep_sdk/clients/invoice_lines_client.rb', line 70

def deletes_invoice_line(invoice_line_id:)
    path = "/api/v1/invoice-lines/#{invoiceLineId}"
    @connection.request(:delete, path, nil, nil)
end

#query_invoice_lines(filter:, include_param:, order:, page_size:, page_number:) ⇒ Object

Queries Invoice Lines for the account using specified filtering More information on querying can be found on the [Searchlight Query Language](developer.lockstep.io/docs/querying-with-searchlight) page on the Lockstep Developer website.

Parameters:

  • filter (string)

    The filter for this query. See [Searchlight Query Language](developer.lockstep.io/docs/querying-with-searchlight)

  • include_param (string)

    To fetch additional data on this object, specify the list of elements to retrieve.

  • order (string)

    The sort order for the results, in the [Searchlight order syntax]

  • page_size (int32)

    The page size for results (default 200, maximum of 10,000)

  • page_number (int32)

    The page number for results (default 0)



83
84
85
86
87
# File 'lib/lockstep_sdk/clients/invoice_lines_client.rb', line 83

def query_invoice_lines(filter:, include_param:, order:, page_size:, page_number:)
    path = "/api/v1/invoice-lines/query"
    params = {:filter => filter, :include => include_param, :order => order, :pageSize => page_size, :pageNumber => page_number}
    @connection.request(:get, path, nil, params)
end

#retrieves_invoice_line(invoice_line_id:) ⇒ Object

Parameters:

  • invoice_line_id (uuid)

    Unique id of the the InvoiceLine



49
50
51
52
# File 'lib/lockstep_sdk/clients/invoice_lines_client.rb', line 49

def retrieves_invoice_line(invoice_line_id:)
    path = "/api/v1/invoice-lines/#{invoiceLineId}"
    @connection.request(:get, path, nil, nil)
end

#update_invoice_line(invoice_line_id:, body:) ⇒ Object

Updates an existing Invoice Line with the information supplied to this PATCH call.

The PATCH method allows you to change specific values on the object while leaving other values alone. As input you should supply a list of field names and new values. If you do not provide the name of a field, that field will remain unchanged. This allows you to ensure that you are only updating the specific fields desired.

Parameters:

  • invoice_line_id (uuid)

    Unique id of the the InvoiceLine

  • body (object)

    A list of changes to apply to this Invoice Line



61
62
63
64
# File 'lib/lockstep_sdk/clients/invoice_lines_client.rb', line 61

def update_invoice_line(invoice_line_id:, body:)
    path = "/api/v1/invoice-lines/#{invoiceLineId}"
    @connection.request(:patch, path, body.to_camelback_keys.to_json, nil)
end