Class Taxes
java.lang.Object
net.amcintosh.freshbooks.resources.api.Resource
net.amcintosh.freshbooks.resources.api.AccountingResource
net.amcintosh.freshbooks.resources.Taxes
FreshBooks taxes 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 tax from the provided data.Create a new tax from the provided Tax model.void
Delete the tax with the corresponding id.Get a single tax with the corresponding id.get
(String accountId, long taxId, IncludesQueryBuilder builder) Get a single tax with the corresponding id.protected String
getPath()
Get a list of taxes using the query strings generated by the QueryBuilder list.list
(String accountId, List<QueryBuilder> builders) Get a list of taxes using the query strings generated by the QueryBuilder list.Update the tax with the corresponding id.Update the tax 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
-
Taxes
-
-
Method Details
-
getPath
- Specified by:
getPath
in classAccountingResource
-
list
Get a list of taxes using the query strings generated by the QueryBuilder list.- Parameters:
accountId
- Id of the account- Returns:
- TaxList containing taxes and pagination details
- Throws:
FreshBooksException
- If the call is not successful
-
list
Get a list of taxes using the query strings generated by the QueryBuilder list.- Parameters:
accountId
- Id of the accountbuilders
- List of QueryBuilders- Returns:
- TaxList containing taxes and pagination details
- Throws:
FreshBooksException
- If the call is not successful
-
get
Get a single tax with the corresponding id.- Parameters:
accountId
- The alpha-numeric account idtaxId
- Id of the resource to return- Returns:
- The Tax
- Throws:
FreshBooksException
- If the call is not successful
-
get
public Tax get(String accountId, long taxId, IncludesQueryBuilder builder) throws FreshBooksException Get a single tax with the corresponding id.- Parameters:
accountId
- The alpha-numeric account idtaxId
- Id of the resource to returnbuilder
- IncludesQueryBuilder object for including additional data, sub-resources, etc.- Returns:
- The Tax
- Throws:
FreshBooksException
- If the call is not successful
-
create
Create a new tax from the provided Tax model. Makes a POST call against the tax resource endpoint. This calls `tax.getContent()` to get a hash map of data.- Parameters:
accountId
- The alpha-numeric account iddata
- Tax model with create data- Returns:
- The created Tax
- Throws:
FreshBooksException
- If the call is not successful
-
create
Create a new tax from the provided data. Makes a POST call against the tax resource endpoint.- Parameters:
accountId
- The alpha-numeric account iddata
- Map of create data- Returns:
- The created Tax
- Throws:
FreshBooksException
- If the call is not successful
-
update
Update the tax with the corresponding id. Makes a PUT call against the tax resource endpoint.- Parameters:
accountId
- The alpha-numeric account idtaxId
- Id of the resource to returndata
- Tax model with updated data- Returns:
- The updated Tax
- Throws:
FreshBooksException
- If the call is not successful
-
update
Update the tax with the corresponding id. Makes a PUT call against the tax resource endpoint.- Parameters:
accountId
- The alpha-numeric account idtaxId
- Id of the resource to updatedata
- Map of data to change- Returns:
- The updated Tax
- Throws:
FreshBooksException
- If the call is not successful
-
delete
Delete the tax with the corresponding id.
Note: Most FreshBooks resources are soft-deleted,- Parameters:
accountId
- The alpha-numeric account idtaxId
- Id of the resource to update- Throws:
FreshBooksException
- If the call is not successful- See Also:
-