Class PermissionRequest

java.lang.Object
com.github.copilot.rpc.PermissionRequest

public class PermissionRequest extends Object
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 Details

    • PermissionRequest

      public PermissionRequest()
  • Method Details

    • fromJsonValue

      public static PermissionRequest fromJsonValue(Object value)
      Converts the value exposed by a permission.requested event into a typed permission request.
      Parameters:
      value - the event's permissionRequest value
      Returns:
      the typed permission request
      Throws:
      IllegalArgumentException - if the value cannot be converted
    • getKind

      public String getKind()
      Gets the kind of permission being requested.
      Returns:
      the permission kind
    • setKind

      public void setKind(String kind)
      Sets the permission kind.
      Parameters:
      kind - the permission kind
    • getToolCallId

      public String getToolCallId()
      Gets the associated tool call ID, if applicable.
      Returns:
      the tool call ID, or null if not a tool-related request
    • setToolCallId

      public void setToolCallId(String toolCallId)
      Sets the tool call ID.
      Parameters:
      toolCallId - the tool call ID
    • getManagedApprovalRequired

      public Boolean getManagedApprovalRequired()
      Gets whether managed policy requires an explicit human decision.
      Returns:
      true when automatic approval must be bypassed, otherwise false or null
    • setManagedApprovalRequired

      public void setManagedApprovalRequired(Boolean managedApprovalRequired)
      Sets whether managed policy requires an explicit human decision.
      Parameters:
      managedApprovalRequired - whether managed approval is required
    • getExtensionData

      public Map<String,Object> getExtensionData()
      Gets additional extension data for the request.
      Returns:
      the extension data map
    • setExtensionData

      public void setExtensionData(Map<String,Object> extensionData)
      Sets additional extension data for the request.
      Parameters:
      extensionData - the extension data map