Class EstimatesApiImpl

Object
ch.aaap.harvestclient.impl.EstimatesApiImpl
All Implemented Interfaces:
Api.Create<Estimate>, Api.Delete<Estimate>, Api.Get<Estimate>, Api.Simple<Estimate>, EstimatesApi

public class EstimatesApiImpl extends Object implements EstimatesApi
  • Constructor Details

  • Method Details

    • list

      public List<Estimate> list(EstimateFilter filter)
      Description copied from interface: EstimatesApi
      Return a list of estimates, sorted by issue date, newest first. Use the filter object to filter the list.
      Specified by:
      list in interface EstimatesApi
      Parameters:
      filter - filtering options
      Returns:
      a (filtered) list of Estimates
    • list

      public Pagination<Estimate> list(EstimateFilter filter, int page, int perPage)
      Description copied from interface: EstimatesApi
      Return a list of estimates, sorted by issue date, newest first. Use the filter object to filter the list. Page and perPage allow controlling how many results to return.
      Specified by:
      list in interface EstimatesApi
      Parameters:
      filter - filtering options
      page - the page number
      perPage - how many results to return for one page. Max 100
      Returns:
      a (filtered) list of Estimates
    • get

      public Estimate get(Reference<Estimate> estimateReference)
      Specified by:
      get in interface Api.Get<Estimate>
      Specified by:
      get in interface EstimatesApi
      Parameters:
      estimateReference - a reference to an existing Estimate
      Returns:
      Return a full Estimate object
    • create

      public Estimate create(Estimate estimateCreationInfo)
      Description copied from interface: EstimatesApi
      Create a new Estimate according to given creation information.
      Specified by:
      create in interface Api.Create<Estimate>
      Specified by:
      create in interface EstimatesApi
      Parameters:
      estimateCreationInfo - the creation options
      Returns:
      the newly created Estimate
    • addLineItem

      public Estimate addLineItem(Reference<Estimate> estimateReference, EstimateItem creationInfo)
      Description copied from interface: EstimatesApi
      Create a new estimate line item and add it to the given estimate
      Specified by:
      addLineItem in interface EstimatesApi
      Parameters:
      estimateReference - the estimate to add the item to
      creationInfo - the line item to be created
      Returns:
      the updated Estimate
    • updateLineItem

      public Estimate updateLineItem(Reference<Estimate> estimateReference, Reference<EstimateItem> estimateItemReference, EstimateItemUpdateInfo updateInfo)
      Description copied from interface: EstimatesApi
      Update an existing line item
      Specified by:
      updateLineItem in interface EstimatesApi
      Parameters:
      estimateReference - the estimate that contains the item
      estimateItemReference - a reference to the line item
      updateInfo - the line item to be updated
      Returns:
      the updated Estimate
    • deleteLineItem

      public Estimate deleteLineItem(Reference<Estimate> estimateReference, Reference<EstimateItem> estimateItemReference)
      Description copied from interface: EstimatesApi
      Delete an existing line item
      Specified by:
      deleteLineItem in interface EstimatesApi
      Parameters:
      estimateReference - the estimate that contains the item
      estimateItemReference - the line item to be deleted
      Returns:
      the updated Estimate
    • addLineItems

      public Estimate addLineItems(Reference<Estimate> estimateReference, List<EstimateItem> creationInfoList)
      Description copied from interface: EstimatesApi
      Create new estimate line items and add it to the given estimate
      Specified by:
      addLineItems in interface EstimatesApi
      Parameters:
      estimateReference - the estimate to add the item to
      creationInfoList - a list of items to be created
      Returns:
      the updated Estimate
    • updateLineItems

      public Estimate updateLineItems(Reference<Estimate> estimateReference, List<? extends Reference<EstimateItem>> estimateItemReferenceList, List<EstimateItemUpdateInfo> updateInfoList)
      Description copied from interface: EstimatesApi
      Update an existing line item
      Specified by:
      updateLineItems in interface EstimatesApi
      Parameters:
      estimateReference - the estimate that contains the item
      estimateItemReferenceList - a list of the item references to be updated, in the same order as updateInfoList
      updateInfoList - a list of the line items to be updated
      Returns:
      the updated Estimate
    • deleteLineItems

      public Estimate deleteLineItems(Reference<Estimate> estimateReference, List<? extends Reference<EstimateItem>> estimateItemReferenceList)
      Description copied from interface: EstimatesApi
      Delete an existing line item
      Specified by:
      deleteLineItems in interface EstimatesApi
      Parameters:
      estimateReference - the estimate that contains the item
      estimateItemReferenceList - a list of the line items to be deleted
      Returns:
      the updated Estimate
    • update

      public Estimate update(Reference<Estimate> estimateReference, EstimateUpdateInfo toChange)
      Description copied from interface: EstimatesApi
      Updates an existing Estimate with the properties set in EstimateUpdateInfo. Be careful: setting a list of EstimateItem will add them to the existing ones, not replace them. See EstimatesApi.deleteLineItems(Reference, List) to delete existing items
      Specified by:
      update in interface EstimatesApi
      Parameters:
      estimateReference - the existing estimate to be updated
      toChange - the properties to be updated
      Returns:
      the updated Estimate
    • delete

      public void delete(Reference<Estimate> estimateReference)
      Description copied from interface: EstimatesApi
      Delete an existing Estimate.
      Specified by:
      delete in interface Api.Delete<Estimate>
      Specified by:
      delete in interface EstimatesApi
      Parameters:
      estimateReference - a reference to an existing Estimate to be deleted