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