Class OtherIncomes
java.lang.Object
net.amcintosh.freshbooks.resources.api.Resource
net.amcintosh.freshbooks.resources.api.AccountingResource
net.amcintosh.freshbooks.resources.OtherIncomes
FreshBooks other incomes resource with calls to get, list, create, update, delete
-
Field Summary
Fields inherited from class net.amcintosh.freshbooks.resources.api.Resource
freshBooksClient
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCreate a new other income from the provided data.create
(String accountId, OtherIncome data) Create a new other income from the provided OtherIncome model.void
Delete the other income with the corresponding id.Get a single other income with the corresponding id.get
(String accountId, long incomeId, IncludesQueryBuilder builder) Get a single other income with the corresponding id.protected String
getPath()
Get a list of other incomes using the query strings generated by the QueryBuilder list.list
(String accountId, List<QueryBuilder> builders) Get a list of other incomes using the query strings generated by the QueryBuilder list.Update the other income with the corresponding id.update
(String accountId, long otherIncomeId, OtherIncome data) Update the other income with the corresponding id.Methods inherited from class net.amcintosh.freshbooks.resources.api.AccountingResource
getResourceType, getUrl, getUrl, getUrl, getUrl, handleListRequest, handleRequest, handleRequest
Methods inherited from class net.amcintosh.freshbooks.resources.api.Resource
buildQueryString
-
Constructor Details
-
OtherIncomes
-
-
Method Details
-
getPath
- Specified by:
getPath
in classAccountingResource
-
list
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 accountbuilders
- List of QueryBuilders- Returns:
- OtherIncomeList containing other incomes and pagination details
- Throws:
FreshBooksException
- If the call is not successful
-
get
Get a single other income with the corresponding id.- Parameters:
accountId
- The alpha-numeric account idincomeId
- 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 idincomeId
- Id of the resource to returnbuilder
- IncludesQueryBuilder object for including additional data, sub-resources, etc.- Returns:
- The Other Income
- Throws:
FreshBooksException
- If the call is not successful
-
create
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 iddata
- OtherIncome model with create data- Returns:
- The created OtherIncome
- Throws:
FreshBooksException
- If the call is not successful
-
create
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 iddata
- 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 idotherIncomeId
- Id of the resource to returndata
- 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 FreshBooksExceptionUpdate the other income with the corresponding id. Makes a PUT call against the other income resource endpoint.- Parameters:
accountId
- The alpha-numeric account idotherIncomeId
- Id of the resource to updatedata
- Map of data to change- Returns:
- The updated OtherIncome
- Throws:
FreshBooksException
- If the call is not successful
-
delete
Delete the other income with the corresponding id.- Parameters:
accountId
- The alpha-numeric account idotherIncomeId
- Id of the resource to delete- Throws:
FreshBooksException
- If the call is not successful
-