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

public class TimeEntry extends com.google.api.client.json.GenericJson implements ConvertibleContent
Time Entries represent time spent working for a client or project.
See Also:
  • 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

      public ZonedDateTime 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 with getStartedAt.

      Note: The API returns this data in UTC.
      Returns:
      Create time in UTC
    • getDuration

      public Duration getDuration()
      The length of the time entry.

      Note: The API returns this data as seconds.
      Returns:
    • setDuration

      public void setDuration(Duration duration)
      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

      public ZonedDateTime getLocalStartedAt()
      The date/time at which the work recorded in this time entry started using the user's local timezone (set with setLocalTimezone().
      Returns:
      Start time in user specified local timezone.
    • getLocalTimezone

      public ZoneId getLocalTimezone()
      Get the local timezone specified for this time entry.
      Returns:
      ZoneId of user's timezone
    • setLocalTimezone

      public void setLocalTimezone(ZoneId localTimezone)
      Set the user's local timezone for this time entry.
      Parameters:
      localTimezone - ZoneId of user's timezone
    • getNote

      public String getNote()
      A short description of the work being done during the time.
      Returns:
    • setNote

      public void setNote(String note)
      A short description of the work being done during the time.
      Parameters:
      note -
    • getPendingClient

      public String getPendingClient()
    • setPendingClient

      public void setPendingClient(String pendingClient)
    • getPendingProject

      public String getPendingProject()
    • setPendingProject

      public void setPendingProject(String pendingProject)
    • getPendingTask

      public String getPendingTask()
    • setPendingTask

      public void setPendingTask(String pendingTask)
    • 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

      public ZonedDateTime getStartedAt()
      The date/time at which the work recorded in this time entry started in UTC.
      Returns:
      Start time in UTC
    • setStartedAt

      public void setStartedAt(ZonedDateTime startedAt)
      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

      public Map<String,Object> 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 interface ConvertibleContent
      Returns: