Class ServiceRates


public class ServiceRates extends CommentSubResource
FreshBooks service rates sub-resource with calls to get, list, create, update
  • Constructor Details

  • Method Details

    • getPathForParent

      protected String getPathForParent()
      Specified by:
      getPathForParent in class CommentSubResource
    • getPathForSingle

      protected String getPathForSingle()
      Specified by:
      getPathForSingle in class ProjectResource
    • getPathForList

      protected String getPathForList()
      Specified by:
      getPathForList in class ProjectResource
    • list

      public ServiceRateList list(long businessId) throws FreshBooksException
      Get a list of service rates for this business.
      Parameters:
      businessId - Id of the business
      Returns:
      ServiceRateList containing service rates
      Throws:
      FreshBooksException - If the call is not successful
    • get

      public ServiceRate get(long businessId, long serviceId) throws FreshBooksException
      Get a single service rate from the service with the corresponding id.
      Parameters:
      businessId - Id of the business
      serviceId - Id of the resource to return
      Returns:
      The ServiceRate
      Throws:
      FreshBooksException - If the call is not successful
    • create

      public ServiceRate create(long businessId, long serviceId, ServiceRate data) throws FreshBooksException
      Create a new service rate from the provided ServiceRate model. Makes a POST call against the service rates resource endpoint. This calls `serviceRate.getContent()` to get a hash map of data.
      Parameters:
      businessId - Id of the business
      serviceId - Id of the service to set the rate for
      data - ServiceRate model with create data
      Returns:
      The created ServiceRate
      Throws:
      FreshBooksException - If the call is not successful
    • create

      public ServiceRate create(long businessId, long serviceId, Map<String,Object> data) throws FreshBooksException
      Create a new service rate from the provided data. Makes a POST call against the service rates resource endpoint.
      Parameters:
      businessId - Id of the business
      serviceId - Id of the service to set the rate for
      data - Map of create data
      Returns:
      The created ServiceRate
      Throws:
      FreshBooksException - If the call is not successful
    • update

      public ServiceRate update(long businessId, long serviceId, ServiceRate data) throws FreshBooksException
      Update the service rate with the corresponding id. Makes a PUT call against the service rate resource endpoint.
      Parameters:
      businessId - Id of the business
      serviceId - Id of the service to set the rate for
      data - ServiceRate model with updated data
      Returns:
      The updated ServiceRate
      Throws:
      FreshBooksException - If the call is not successful
    • update

      public ServiceRate update(long businessId, long serviceId, Map<String,Object> data) throws FreshBooksException
      Update the service rate with the corresponding id. Makes a PUT call against the service rate resource endpoint.
      Parameters:
      businessId - Id of the business
      serviceId - Id of the service to set the rate for
      data - Map of data to change
      Returns:
      The updated ServiceRate
      Throws:
      FreshBooksException - If the call is not successful