Package com.github.copilot.sdk.json
Record Class SessionEndHookInput
java.lang.Object
java.lang.Record
com.github.copilot.sdk.json.SessionEndHookInput
- Record Components:
timestamp- the timestamp in milliseconds since epoch when the session endedcwd- the current working directoryreason- the reason: "complete", "error", "abort", "timeout", or "user_exit"finalMessage- the final message, ornullerror- the error message, ornull
public record SessionEndHookInput(long timestamp, String cwd, String reason, String finalMessage, String error)
extends Record
Input for a session-end hook.
This hook is invoked when a session ends, allowing you to perform cleanup or logging.
- Since:
- 1.0.7
-
Constructor Summary
ConstructorsConstructorDescriptionSessionEndHookInput(long timestamp, String cwd, String reason, String finalMessage, String error) Creates an instance of aSessionEndHookInputrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncwd()Returns the value of thecwdrecord component.final booleanIndicates whether some other object is "equal to" this one.error()Returns the value of theerrorrecord component.Returns the value of thefinalMessagerecord component.final inthashCode()Returns a hash code value for this object.reason()Returns the value of thereasonrecord component.longReturns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SessionEndHookInput
public SessionEndHookInput(long timestamp, String cwd, String reason, String finalMessage, String error) Creates an instance of aSessionEndHookInputrecord class.- Parameters:
timestamp- the value for thetimestamprecord componentcwd- the value for thecwdrecord componentreason- the value for thereasonrecord componentfinalMessage- the value for thefinalMessagerecord componenterror- the value for theerrorrecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
timestamp
public long timestamp()Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-
cwd
Returns the value of thecwdrecord component.- Returns:
- the value of the
cwdrecord component
-
reason
Returns the value of thereasonrecord component.- Returns:
- the value of the
reasonrecord component
-
finalMessage
Returns the value of thefinalMessagerecord component.- Returns:
- the value of the
finalMessagerecord component
-
error
Returns the value of theerrorrecord component.- Returns:
- the value of the
errorrecord component
-