Class OtherIncomes


public class OtherIncomes extends AccountingResource
FreshBooks other incomes resource with calls to get, list, create, update, delete
  • Constructor Details

  • Method Details

    • getPath

      protected String getPath()
      Specified by:
      getPath in class AccountingResource
    • list

      public OtherIncomeList list(String accountId) throws FreshBooksException
      Get a list of other incomes using the query strings generated by the QueryBuilder list.
      Parameters:
      accountId - Id of the account
      Returns:
      OtherIncomeList containing other incomes and pagination details
      Throws:
      FreshBooksException - If the call is not successful
    • list

      public OtherIncomeList list(String accountId, List<QueryBuilder> builders) throws FreshBooksException
      Get a list of other incomes using the query strings generated by the QueryBuilder list.
      Parameters:
      accountId - Id of the account
      builders - List of QueryBuilders
      Returns:
      OtherIncomeList containing other incomes and pagination details
      Throws:
      FreshBooksException - If the call is not successful
    • get

      public OtherIncome get(String accountId, long incomeId) throws FreshBooksException
      Get a single other income with the corresponding id.
      Parameters:
      accountId - The alpha-numeric account id
      incomeId - Id of the resource to return
      Returns:
      The Other Income
      Throws:
      FreshBooksException - If the call is not successful
    • get

      public OtherIncome get(String accountId, long incomeId, IncludesQueryBuilder builder) throws FreshBooksException
      Get a single other income with the corresponding id.
      Parameters:
      accountId - The alpha-numeric account id
      incomeId - Id of the resource to return
      builder - IncludesQueryBuilder object for including additional data, sub-resources, etc.
      Returns:
      The Other Income
      Throws:
      FreshBooksException - If the call is not successful
    • create

      public OtherIncome create(String accountId, OtherIncome data) throws FreshBooksException
      Create a new other income from the provided OtherIncome model. Makes a POST call against the other income resource endpoint. This calls `otherIncome.getContent()` to get a hash map of data.
      Parameters:
      accountId - The alpha-numeric account id
      data - OtherIncome model with create data
      Returns:
      The created OtherIncome
      Throws:
      FreshBooksException - If the call is not successful
    • create

      public OtherIncome create(String accountId, Map<String,Object> data) throws FreshBooksException
      Create a new other income from the provided data. Makes a POST call against the other income resource endpoint.
      Parameters:
      accountId - The alpha-numeric account id
      data - Map of create data
      Returns:
      The created OtherIncome
      Throws:
      FreshBooksException - If the call is not successful
    • update

      public OtherIncome update(String accountId, long otherIncomeId, OtherIncome data) throws FreshBooksException
      Update the other income with the corresponding id. Makes a PUT call against the other income resource endpoint.
      Parameters:
      accountId - The alpha-numeric account id
      otherIncomeId - Id of the resource to return
      data - OtherIncome model with updated data
      Returns:
      The updated OtherIncome
      Throws:
      FreshBooksException - If the call is not successful
    • update

      public OtherIncome update(String accountId, long otherIncomeId, Map<String,Object> data) throws FreshBooksException
      Update the other income with the corresponding id. Makes a PUT call against the other income resource endpoint.
      Parameters:
      accountId - The alpha-numeric account id
      otherIncomeId - Id of the resource to update
      data - Map of data to change
      Returns:
      The updated OtherIncome
      Throws:
      FreshBooksException - If the call is not successful
    • delete

      public void delete(String accountId, long otherIncomeId) throws FreshBooksException
      Delete the other income with the corresponding id.
      Parameters:
      accountId - The alpha-numeric account id
      otherIncomeId - Id of the resource to delete
      Throws:
      FreshBooksException - If the call is not successful