Class TimeEntries
java.lang.Object
net.amcintosh.freshbooks.resources.api.Resource
net.amcintosh.freshbooks.resources.api.ProjectResource
net.amcintosh.freshbooks.resources.api.TimeTrackingResource
net.amcintosh.freshbooks.resources.TimeEntries
FreshBooks TimeEntries 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 time entry from the provided data.Create a new time entry from the provided TimeEntry model.void
delete
(long businessId, long timeEntryId) Delete the time entry with the corresponding id.get
(long businessId, long timeEntryId) Get a single time entry with the corresponding id.get
(long businessId, long timeEntryId, IncludesQueryBuilder builder) Get a single time entry with the corresponding id.protected String
protected String
list
(long businessId) Get a list of time entries.list
(long businessId, List<QueryBuilder> builders) Get a list of time entries using the query strings generated by the QueryBuilder list.Update the time entry with the corresponding id.Update the time entry with the corresponding id.Methods inherited from class net.amcintosh.freshbooks.resources.api.TimeTrackingResource
getResourceType, getUrl, getUrl, getUrl, getUrl
Methods inherited from class net.amcintosh.freshbooks.resources.api.ProjectResource
getUrl, getUrl, handleListRequest, handleRequest, handleRequest
Methods inherited from class net.amcintosh.freshbooks.resources.api.Resource
buildQueryString
-
Constructor Details
-
TimeEntries
- Parameters:
freshBooksClient
- Initialized instance of FreshBooksClient
-
-
Method Details
-
getPathForSingle
- Specified by:
getPathForSingle
in classProjectResource
-
getPathForList
- Specified by:
getPathForList
in classProjectResource
-
list
Get a list of time entries.- Parameters:
businessId
- Id of the business- Returns:
- TimeEntryList containing time entries, pagination, and billing details.
- Throws:
FreshBooksException
- If the call is not successful
-
list
Get a list of time entries using the query strings generated by the QueryBuilder list.- Parameters:
businessId
- Id of the businessbuilders
- List of QueryBuilders- Returns:
- ProjectList containing time entries and pagination details
- Throws:
FreshBooksException
- If the call is not successful
-
get
Get a single time entry with the corresponding id.- Parameters:
businessId
- Id of the businesstimeEntryId
- Id of the resource to return- Returns:
- The TimeEntry
- Throws:
FreshBooksException
- If the call is not successful
-
get
public TimeEntry get(long businessId, long timeEntryId, IncludesQueryBuilder builder) throws FreshBooksException Get a single time entry with the corresponding id.- Parameters:
businessId
- Id of the businesstimeEntryId
- Id of the resource to returnbuilder
- IncludesQueryBuilder object for including additional data, sub-resources, etc.- Returns:
- The TimeEntry
- Throws:
FreshBooksException
- If the call is not successful
-
create
Create a new time entry from the provided TimeEntry model. Makes a POST call against the time_entries resource endpoint. This calls `timeEntry.getContent()` to get a hash map of data.- Parameters:
businessId
- Id of the businessdata
- TimeEntry model with create data- Returns:
- The created TimeEntry
- Throws:
FreshBooksException
- If the call is not successful
-
create
Create a new time entry from the provided data. Makes a POST call against the time_entries resource endpoint.- Parameters:
businessId
- Id of the businessdata
- Map of create data- Returns:
- The created TimeEntry
- Throws:
FreshBooksException
- If the call is not successful
-
update
public TimeEntry update(long businessId, long timeEntryId, TimeEntry data) throws FreshBooksException Update the time entry with the corresponding id. Makes a PUT call against the time_entries resource endpoint.- Parameters:
businessId
- Id of the businesstimeEntryId
- Id of the resource to updatedata
- TimeEntry model with updated data- Returns:
- The updated TimeEntry
- Throws:
FreshBooksException
- If the call is not successful
-
update
public TimeEntry update(long businessId, long timeEntryId, Map<String, Object> data) throws FreshBooksExceptionUpdate the time entry with the corresponding id. Makes a PUT call against the time_entries resource endpoint.- Parameters:
businessId
- Id of the businesstimeEntryId
- Id of the resource to updatedata
- Map of data to change- Returns:
- The updated TimeEntry
- Throws:
FreshBooksException
- If the call is not successful
-
delete
Delete the time entry with the corresponding id. Makes a DELETE call against the time_entries resource endpoint.
Note: Most FreshBooks resources are soft-deleted,- Parameters:
businessId
- Id of the businesstimeEntryId
- Id of the resource to update- Throws:
FreshBooksException
- If the call is not successful
-