java.lang.Object
com.github.copilot.rpc.PermissionRequestResult
Result of a permission request decision.
This object indicates whether a permission request was approved or denied, and may include additional rules for future similar requests.
Common Result Kinds
PermissionRequestResultKind.APPROVED— approvedPermissionRequestResultKind.DENIED_BY_RULES— denied by rulesPermissionRequestResultKind.DENIED_COULD_NOT_REQUEST_FROM_USER— no handler and couldn't ask userPermissionRequestResultKind.DENIED_INTERACTIVELY_BY_USER— denied by the user interactively
- Since:
- 1.0.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PermissionRequestResultCreates a result that approves this single request.Gets optional human-readable feedback to forward to the LLM along with the decision.getKind()Gets the result kind as a string.getRules()Gets the approval rules.static PermissionRequestResultnoResult()Creates a result that declines to respond to this permission request, allowing another connected client to answer instead.static PermissionRequestResultCreates a result that rejects the request, optionally forwarding feedback to the LLM.setFeedback(String feedback) Sets optional human-readable feedback to forward to the LLM along with the decision.Sets the result kind using aPermissionRequestResultKindvalue.Sets the result kind using a raw string value.Sets approval rules for future similar requests.static PermissionRequestResultCreates a result denying the request because no user is available to confirm it.
-
Constructor Details
-
PermissionRequestResult
public PermissionRequestResult()
-
-
Method Details
-
approveOnce
Creates a result that approves this single request.- Returns:
- a new approved result
- Since:
- 1.3.0
-
reject
Creates a result that rejects the request, optionally forwarding feedback to the LLM.- Parameters:
feedback- optional feedback message, ornull- Returns:
- a new rejected result
- Since:
- 1.3.0
-
userNotAvailable
Creates a result denying the request because no user is available to confirm it.- Returns:
- a new user-not-available result
- Since:
- 1.3.0
-
noResult
Creates a result that declines to respond to this permission request, allowing another connected client to answer instead.- Returns:
- a new no-result result
- Since:
- 1.3.0
-
getKind
Gets the result kind as a string.- Returns:
- the result kind indicating approval or denial
-
setKind
Sets the result kind using aPermissionRequestResultKindvalue.- Parameters:
kind- the result kind- Returns:
- this result for method chaining
- Since:
- 1.1.0
-
setKind
Sets the result kind using a raw string value.- Parameters:
kind- the result kind string- Returns:
- this result for method chaining
-
getRules
Gets the approval rules.- Returns:
- the list of rules for future similar requests
-
setRules
Sets approval rules for future similar requests.- Parameters:
rules- the list of rules- Returns:
- this result for method chaining
-
getFeedback
Gets optional human-readable feedback to forward to the LLM along with the decision.- Returns:
- the feedback message, or
null - Since:
- 1.3.0
-
setFeedback
Sets optional human-readable feedback to forward to the LLM along with the decision.- Parameters:
feedback- the feedback message- Returns:
- this result for method chaining
- Since:
- 1.3.0
-