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.FlagsNested 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongGet 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.longgetId()Get the unique identifier of this time entry within this business.longThe 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.longThe unique identifier of the project worked on during the time.longThe unique identifier of the retainer worked on during the time.longThe 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.longThe unique identifier of the task worked on during the time.booleanisActive()Whether the time entry is active or not.booleanWhether the time entry can be added to an invoice.booleanisBilled()Whether the time entry has already been added to an invoice or manually marked as billed.booleanGet if the time entry is for internal work and not assigned to a client.booleanisLogged()Whether the time entry has been finished and logged.voidsetActive(boolean active) Set whether the time entry is active or not.voidsetBillable(boolean billable) Set whether the time entry can be added to an invoice.voidsetBilled(boolean billed) Manually sets the time entry as billed.voidsetClientId(long clientId) Get the id of the client this time entry will be billed for.voidsetDuration(Duration duration) The length of the time entry in seconds.voidsetIdentityId(long identityId) The unique identifier of the team member or user logging the time entry.voidsetInternal(boolean internal) Set if the time entry is for internal work and not assigned to a client.voidsetLocalTimezone(ZoneId localTimezone) Set the user's local timezone for this time entry.voidsetLogged(boolean isLogged) Set if the time entry has been manually logged.voidA short description of the work being done during the time.voidsetPendingClient(String pendingClient) voidsetPendingProject(String pendingProject) voidsetPendingTask(String pendingTask) voidsetProjectId(long projectId) The unique identifier of the project worked on during the time.voidsetRetainerId(long retainerId) The unique identifier of the retainer worked on during the time.voidsetServiceId(long serviceId) The unique identifier of the project service worked on during the time.voidsetStartedAt(ZonedDateTime startedAt) The date/time to record for when the work started.voidsetTaskId(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, toStringMethods inherited from class com.google.api.client.util.GenericData
entrySet, equals, get, getClassInfo, getUnknownKeys, hashCode, put, putAll, remove, setUnknownKeysMethods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, isEmpty, keySet, size, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:ConvertibleContentReturn the objects values as a Map suitable to sending to FreshBooks in a POST or PUT request.- Specified by:
getContentin interfaceConvertibleContent- Returns:
-