Class PermissionRequest
java.lang.Object
com.github.copilot.rpc.PermissionRequest
Represents a permission request from the AI assistant.
When the assistant needs permission to perform certain actions, this object contains the details of the request, including the kind of permission and any associated tool call.
- Since:
- 1.0.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PermissionRequestfromJsonValue(Object value) Converts the value exposed by apermission.requestedevent into a typed permission request.Gets additional extension data for the request.getKind()Gets the kind of permission being requested.Gets whether managed policy requires an explicit human decision.Gets the associated tool call ID, if applicable.voidsetExtensionData(Map<String, Object> extensionData) Sets additional extension data for the request.voidSets the permission kind.voidsetManagedApprovalRequired(Boolean managedApprovalRequired) Sets whether managed policy requires an explicit human decision.voidsetToolCallId(String toolCallId) Sets the tool call ID.
-
Constructor Details
-
PermissionRequest
public PermissionRequest()
-
-
Method Details
-
fromJsonValue
Converts the value exposed by apermission.requestedevent into a typed permission request.- Parameters:
value- the event'spermissionRequestvalue- Returns:
- the typed permission request
- Throws:
IllegalArgumentException- if the value cannot be converted
-
getKind
-
setKind
-
getToolCallId
Gets the associated tool call ID, if applicable.- Returns:
- the tool call ID, or
nullif not a tool-related request
-
setToolCallId
Sets the tool call ID.- Parameters:
toolCallId- the tool call ID
-
getManagedApprovalRequired
Gets whether managed policy requires an explicit human decision.- Returns:
truewhen automatic approval must be bypassed, otherwisefalseornull
-
setManagedApprovalRequired
Sets whether managed policy requires an explicit human decision.- Parameters:
managedApprovalRequired- whether managed approval is required
-
getExtensionData
-
setExtensionData
-