Package ch.aaap.harvestclient.impl
Class InvoiceMessagesApiImpl
Object
ch.aaap.harvestclient.impl.InvoiceMessagesApiImpl
- All Implemented Interfaces:
InvoiceMessagesApi
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate(Reference<Invoice> invoiceReference, InvoiceMessage creationInfo) Create a new InvoiceMessagevoiddelete(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:
listin 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:
listin 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:InvoiceMessagesApiCreate a new InvoiceMessage- Specified by:
createin 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:InvoiceMessagesApiChange the state of an invoice to the given eventType. Not all transitions are allowed: see the web interface for more information- Specified by:
markAsin 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:InvoiceMessagesApiDelete an existing InvoiceMessage. Deleting an Accept Message does not change the status of the Invoice.- Specified by:
deletein interfaceInvoiceMessagesApi- Parameters:
invoiceReference- the invoice that contains the messageinvoiceMessageReference- An existing InvoiceMessage to be deleted
-