Record Class PreToolUseHookOutput
java.lang.Object
java.lang.Record
com.github.copilot.rpc.PreToolUseHookOutput
- Record Components:
permissionDecision- "allow", "deny", or "ask"permissionDecisionReason- the reason for the permission decisionmodifiedArgs- the modified tool arguments, ornullto use originaladditionalContext- additional context to provide to the modelsuppressOutput-trueto suppress output
-
Constructor Summary
ConstructorsConstructorDescriptionPreToolUseHookOutput(String permissionDecision, String permissionDecisionReason, com.fasterxml.jackson.databind.JsonNode modifiedArgs, String additionalContext, Boolean suppressOutput) Creates an instance of aPreToolUseHookOutputrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theadditionalContextrecord component.static PreToolUseHookOutputallow()Creates an output that allows the tool to execute.static PreToolUseHookOutputask()Creates an output that asks for user confirmation before executing the tool.static PreToolUseHookOutputdeny()Creates an output that denies the tool execution.static PreToolUseHookOutputCreates an output that denies the tool execution with a reason.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.com.fasterxml.jackson.databind.JsonNodeReturns the value of themodifiedArgsrecord component.Returns the value of thepermissionDecisionrecord component.Returns the value of thepermissionDecisionReasonrecord component.Returns the value of thesuppressOutputrecord component.final StringtoString()Returns a string representation of this record class.static PreToolUseHookOutputwithModifiedArgs(String permissionDecision, com.fasterxml.jackson.databind.JsonNode modifiedArgs) Creates an output with modified tool arguments.
-
Constructor Details
-
PreToolUseHookOutput
public PreToolUseHookOutput(String permissionDecision, String permissionDecisionReason, com.fasterxml.jackson.databind.JsonNode modifiedArgs, String additionalContext, Boolean suppressOutput) Creates an instance of aPreToolUseHookOutputrecord class.- Parameters:
permissionDecision- the value for thepermissionDecisionrecord componentpermissionDecisionReason- the value for thepermissionDecisionReasonrecord componentmodifiedArgs- the value for themodifiedArgsrecord componentadditionalContext- the value for theadditionalContextrecord componentsuppressOutput- the value for thesuppressOutputrecord component
-
-
Method Details
-
allow
Creates an output that allows the tool to execute.- Returns:
- a new PreToolUseHookOutput with permission decision "allow"
-
deny
Creates an output that denies the tool execution.- Returns:
- a new PreToolUseHookOutput with permission decision "deny"
-
deny
Creates an output that denies the tool execution with a reason.- Parameters:
reason- the reason for denying the tool execution- Returns:
- a new PreToolUseHookOutput with permission decision "deny" and reason
-
ask
Creates an output that asks for user confirmation before executing the tool.- Returns:
- a new PreToolUseHookOutput with permission decision "ask"
-
withModifiedArgs
public static PreToolUseHookOutput withModifiedArgs(String permissionDecision, com.fasterxml.jackson.databind.JsonNode modifiedArgs) Creates an output with modified tool arguments.- Parameters:
permissionDecision- "allow", "deny", or "ask"modifiedArgs- the modified tool arguments- Returns:
- a new PreToolUseHookOutput with the specified permission and modified arguments
-
toString
-
hashCode
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
permissionDecision
Returns the value of thepermissionDecisionrecord component.- Returns:
- the value of the
permissionDecisionrecord component
-
permissionDecisionReason
Returns the value of thepermissionDecisionReasonrecord component.- Returns:
- the value of the
permissionDecisionReasonrecord component
-
modifiedArgs
public com.fasterxml.jackson.databind.JsonNode modifiedArgs()Returns the value of themodifiedArgsrecord component.- Returns:
- the value of the
modifiedArgsrecord component
-
additionalContext
Returns the value of theadditionalContextrecord component.- Returns:
- the value of the
additionalContextrecord component
-
suppressOutput
Returns the value of thesuppressOutputrecord component.- Returns:
- the value of the
suppressOutputrecord component
-