Package ch.aaap.harvestclient.impl
Class InvoiceMessagesApiImpl
Object
ch.aaap.harvestclient.impl.InvoiceMessagesApiImpl
- All Implemented Interfaces:
InvoiceMessagesApi
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreate
(Reference<Invoice> invoiceReference, InvoiceMessage creationInfo) Create a new InvoiceMessagevoid
delete
(Reference<Invoice> invoiceReference, Reference<InvoiceMessage> invoiceMessageReference) Delete an existing InvoiceMessage.markAs
(Reference<Invoice> invoiceReference, InvoiceMessage.EventType eventType) Change the state of an invoice to the given eventType.
-
Constructor Details
-
InvoiceMessagesApiImpl
-
-
Method Details
-
list
- Specified by:
list
in interfaceInvoiceMessagesApi
- Parameters:
invoiceReference
- the invoice containing the messagesupdatedSince
- return only InvoiceMessages that have been updated at least 1 second after updatedSince. Set to null to disable filtering.- Returns:
- a list of all InvoiceMessages in the invoice, sorted by creation date, newest first.
-
list
public Pagination<InvoiceMessage> list(Reference<Invoice> invoiceReference, Instant updatedSince, int page, int perPage) - Specified by:
list
in interfaceInvoiceMessagesApi
- Parameters:
invoiceReference
- the invoice containing the messagesupdatedSince
- return only InvoiceMessages that have been updated at least 1 second after updatedSince. Set to null to disable filtering.page
- the page numberperPage
- how many results to return for one page. Max 100- Returns:
- a list of all InvoiceMessages in the invoice, sorted by creation date, newest first.
-
create
Description copied from interface:InvoiceMessagesApi
Create a new InvoiceMessage- Specified by:
create
in interfaceInvoiceMessagesApi
- Parameters:
invoiceReference
- the invoice that will contain the messagecreationInfo
- creation information- Returns:
- the created InvoiceMessage
-
markAs
public InvoiceMessage markAs(Reference<Invoice> invoiceReference, InvoiceMessage.EventType eventType) Description copied from interface:InvoiceMessagesApi
Change the state of an invoice to the given eventType. Not all transitions are allowed: see the web interface for more information- Specified by:
markAs
in interfaceInvoiceMessagesApi
- Parameters:
invoiceReference
- the invoice against which to record the eventeventType
- the event you want to record for this invoice- Returns:
- the InvoiceMessage that was used to do the marking
-
delete
public void delete(Reference<Invoice> invoiceReference, Reference<InvoiceMessage> invoiceMessageReference) Description copied from interface:InvoiceMessagesApi
Delete an existing InvoiceMessage. Deleting an Accept Message does not change the status of the Invoice.- Specified by:
delete
in interfaceInvoiceMessagesApi
- Parameters:
invoiceReference
- the invoice that contains the messageinvoiceMessageReference
- An existing InvoiceMessage to be deleted
-