Interface EstimatesApi

All Superinterfaces:
Api.Create<Estimate>, Api.Delete<Estimate>, Api.Get<Estimate>, Api.Simple<Estimate>
All Known Implementing Classes:
EstimatesApiImpl

public interface EstimatesApi extends Api.Simple<Estimate>
See Also:
  • Method Details

    • list

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

      Pagination<Estimate> list(EstimateFilter filter, int page, int perPage)
      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.
      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

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

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

      Estimate addLineItem(Reference<Estimate> estimateReference, EstimateItem creationInfo)
      Create a new estimate line item and add it to the given estimate
      Parameters:
      estimateReference - the estimate to add the item to
      creationInfo - the line item to be created
      Returns:
      the updated Estimate
    • updateLineItem

      Estimate updateLineItem(Reference<Estimate> estimateReference, Reference<EstimateItem> estimateItemReference, EstimateItemUpdateInfo updateInfo)
      Update an existing line item
      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

      Estimate deleteLineItem(Reference<Estimate> estimateReference, Reference<EstimateItem> estimateItemReference)
      Delete an existing line item
      Parameters:
      estimateReference - the estimate that contains the item
      estimateItemReference - the line item to be deleted
      Returns:
      the updated Estimate
    • addLineItems

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

      Estimate updateLineItems(Reference<Estimate> estimateReference, List<? extends Reference<EstimateItem>> estimateItemReferenceList, List<EstimateItemUpdateInfo> updateInfoList)
      Update an existing line item
      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

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

      Estimate update(Reference<Estimate> estimateReference, EstimateUpdateInfo toChange)
      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 deleteLineItems(Reference, List) to delete existing items
      Parameters:
      estimateReference - the existing estimate to be updated
      toChange - the properties to be updated
      Returns:
      the updated Estimate
    • delete

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