Record Class SessionStartHookInput

java.lang.Object
java.lang.Record
com.github.copilot.sdk.json.SessionStartHookInput
Record Components:
timestamp - the timestamp in milliseconds since epoch when the session started
cwd - the current working directory
source - the source: "startup", "resume", or "new"
initialPrompt - the initial prompt, or null

public record SessionStartHookInput(long timestamp, String cwd, String source, String initialPrompt) extends Record
Input for a session-start hook.

This hook is invoked when a session starts, allowing you to perform initialization or modify the session configuration.

Since:
1.0.7
  • Constructor Details

    • SessionStartHookInput

      public SessionStartHookInput(long timestamp, String cwd, String source, String initialPrompt)
      Creates an instance of a SessionStartHookInput record class.
      Parameters:
      timestamp - the value for the timestamp record component
      cwd - the value for the cwd record component
      source - the value for the source record component
      initialPrompt - the value for the initialPrompt record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • timestamp

      public long timestamp()
      Returns the value of the timestamp record component.
      Returns:
      the value of the timestamp record component
    • cwd

      public String cwd()
      Returns the value of the cwd record component.
      Returns:
      the value of the cwd record component
    • source

      public String source()
      Returns the value of the source record component.
      Returns:
      the value of the source record component
    • initialPrompt

      public String initialPrompt()
      Returns the value of the initialPrompt record component.
      Returns:
      the value of the initialPrompt record component