Package net.amcintosh.freshbooks.models
Class TimeEntry
java.lang.Object
java.util.AbstractMap<String,Object>
com.google.api.client.util.GenericData
com.google.api.client.json.GenericJson
net.amcintosh.freshbooks.models.TimeEntry
- All Implemented Interfaces:
Cloneable
,Map<String,
,Object> ConvertibleContent
Time Entries represent time spent working for a client or project.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.api.client.util.GenericData
com.google.api.client.util.GenericData.Flags
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
Get the id of the client this time entry is/will be billed for.Return the objects values as a Map suitable to sending to FreshBooks in a POST or PUT request.Get the creation time of the time entry record.The length of the time entry.long
getId()
Get the unique identifier of this time entry within this business.long
The unique identifier of the team member or user logging the time entry.The date/time at which the work recorded in this time entry started using the user's local timezone (set withsetLocalTimezone()
.Get the local timezone specified for this time entry.getNote()
A short description of the work being done during the time.long
The unique identifier of the project worked on during the time.long
The unique identifier of the retainer worked on during the time.long
The unique identifier of the project service worked on during the time.The date/time at which the work recorded in this time entry started in UTC.long
The unique identifier of the task worked on during the time.boolean
isActive()
Whether the time entry is active or not.boolean
Whether the time entry can be added to an invoice.boolean
isBilled()
Whether the time entry has already been added to an invoice or manually marked as billed.boolean
Get if the time entry is for internal work and not assigned to a client.boolean
isLogged()
Whether the time entry has been finished and logged.void
setActive
(boolean active) Set whether the time entry is active or not.void
setBillable
(boolean billable) Set whether the time entry can be added to an invoice.void
setBilled
(boolean billed) Manually sets the time entry as billed.void
setClientId
(long clientId) Get the id of the client this time entry will be billed for.void
setDuration
(Duration duration) The length of the time entry in seconds.void
setIdentityId
(long identityId) The unique identifier of the team member or user logging the time entry.void
setInternal
(boolean internal) Set if the time entry is for internal work and not assigned to a client.void
setLocalTimezone
(ZoneId localTimezone) Set the user's local timezone for this time entry.void
setLogged
(boolean isLogged) Set if the time entry has been manually logged.void
A short description of the work being done during the time.void
setPendingClient
(String pendingClient) void
setPendingProject
(String pendingProject) void
setPendingTask
(String pendingTask) void
setProjectId
(long projectId) The unique identifier of the project worked on during the time.void
setRetainerId
(long retainerId) The unique identifier of the retainer worked on during the time.void
setServiceId
(long serviceId) The unique identifier of the project service worked on during the time.void
setStartedAt
(ZonedDateTime startedAt) The date/time to record for when the work started.void
setTaskId
(long taskId) The unique identifier of the task worked on during the time.Methods inherited from class com.google.api.client.json.GenericJson
clone, getFactory, set, setFactory, toPrettyString, toString
Methods inherited from class com.google.api.client.util.GenericData
entrySet, equals, get, getClassInfo, getUnknownKeys, hashCode, put, putAll, remove, setUnknownKeys
Methods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, isEmpty, keySet, size, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
TimeEntry
public TimeEntry()
-
-
Method Details
-
getId
public long getId()Get the unique identifier of this time entry within this business.- Returns:
- TimeEntry id
-
isActive
public boolean isActive()Whether the time entry is active or not.
Note: A resource that is not active is essentially a "soft" delete.- Returns:
- True if active
-
setActive
public void setActive(boolean active) Set whether the time entry is active or not.
Note: A resource that is not active is essentially a "soft" delete.- Parameters:
active
- active
-
isBillable
public boolean isBillable()Whether the time entry can be added to an invoice.- Returns:
- True if billable
-
setBillable
public void setBillable(boolean billable) Set whether the time entry can be added to an invoice.- Parameters:
billable
- billable
-
isBilled
public boolean isBilled()Whether the time entry has already been added to an invoice or manually marked as billed.- Returns:
- True if it has been billed
-
setBilled
public void setBilled(boolean billed) Manually sets the time entry as billed.- Parameters:
billed
-
-
getClientId
public long getClientId()Get the id of the client this time entry is/will be billed for.- Returns:
- The client id in the business.
-
setClientId
public void setClientId(long clientId) Get the id of the client this time entry will be billed for.- Parameters:
clientId
-
-
getCreatedAt
Get the creation time of the time entry record. This is not the same as when the time entry began, which can be found withgetStartedAt
.
Note: The API returns this data in UTC.- Returns:
- Create time in UTC
-
getDuration
The length of the time entry.
Note: The API returns this data as seconds.- Returns:
-
setDuration
The length of the time entry in seconds.
Note: The API accepts this data as seconds.- Parameters:
duration
-
-
getIdentityId
public long getIdentityId()The unique identifier of the team member or user logging the time entry.- Returns:
-
setIdentityId
public void setIdentityId(long identityId) The unique identifier of the team member or user logging the time entry.- Parameters:
identityId
-
-
isInternal
public boolean isInternal()Get if the time entry is for internal work and not assigned to a client.- Returns:
- True if the time entry is not assigned to a client
-
setInternal
public void setInternal(boolean internal) Set if the time entry is for internal work and not assigned to a client.- Parameters:
internal
-
-
isLogged
public boolean isLogged()Whether the time entry has been finished and logged. Returns true if the time entry was created directly. Returns false if the time entry has been created by a timer which is still running.- Returns:
- False if the time entry is currently being created from a running timer
-
setLogged
public void setLogged(boolean isLogged) Set if the time entry has been manually logged. A time entry must be logged or belong to a timer.- Parameters:
isLogged
- If the time entry is being manually logged.
-
getLocalStartedAt
The date/time at which the work recorded in this time entry started using the user's local timezone (set withsetLocalTimezone()
.- Returns:
- Start time in user specified local timezone.
-
getLocalTimezone
Get the local timezone specified for this time entry.- Returns:
- ZoneId of user's timezone
-
setLocalTimezone
Set the user's local timezone for this time entry.- Parameters:
localTimezone
- ZoneId of user's timezone
-
getNote
A short description of the work being done during the time.- Returns:
-
setNote
A short description of the work being done during the time.- Parameters:
note
-
-
getPendingClient
-
setPendingClient
-
getPendingProject
-
setPendingProject
-
getPendingTask
-
setPendingTask
-
getProjectId
public long getProjectId()The unique identifier of the project worked on during the time.- Returns:
-
setProjectId
public void setProjectId(long projectId) The unique identifier of the project worked on during the time.- Parameters:
projectId
-
-
getRetainerId
public long getRetainerId()The unique identifier of the retainer worked on during the time.- Returns:
-
setRetainerId
public void setRetainerId(long retainerId) The unique identifier of the retainer worked on during the time.- Parameters:
retainerId
-
-
getServiceId
public long getServiceId()The unique identifier of the project service worked on during the time.- Returns:
-
setServiceId
public void setServiceId(long serviceId) The unique identifier of the project service worked on during the time.- Parameters:
serviceId
-
-
getStartedAt
The date/time at which the work recorded in this time entry started in UTC.- Returns:
- Start time in UTC
-
setStartedAt
The date/time to record for when the work started.- Parameters:
startedAt
- Start time in UTC
-
getTaskId
public long getTaskId()The unique identifier of the task worked on during the time.- Returns:
-
setTaskId
public void setTaskId(long taskId) The unique identifier of the task worked on during the time.- Parameters:
taskId
-
-
getContent
Description copied from interface:ConvertibleContent
Return the objects values as a Map suitable to sending to FreshBooks in a POST or PUT request.- Specified by:
getContent
in interfaceConvertibleContent
- Returns:
-