Package com.github.copilot.sdk.json
Class PermissionRequestResultKind
java.lang.Object
com.github.copilot.sdk.json.PermissionRequestResultKind
Describes the outcome kind of a permission request result.
This is a string-backed value type that can hold both well-known kinds (via the static constants) and arbitrary extension values forwarded by the server. Comparisons are case-insensitive to match server behaviour.
Well-known kinds
APPROVED— the permission was approved for this one instance.REJECTED— the permission was denied interactively by the user.USER_NOT_AVAILABLE— the permission was denied because user confirmation was unavailable.NO_RESULT— no permission decision was made.
- Since:
- 1.1.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PermissionRequestResultKindThe permission was approved for this one instance.static final PermissionRequestResultKindDeprecated.static final PermissionRequestResultKindDeprecated.UseUSER_NOT_AVAILABLEinstead.static final PermissionRequestResultKindDeprecated.UseREJECTEDinstead.static final PermissionRequestResultKindLeaves the pending permission request unanswered.static final PermissionRequestResultKindThe permission was denied interactively by the user.static final PermissionRequestResultKindThe permission was denied because user confirmation was unavailable. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a newPermissionRequestResultKindwith the given string value. -
Method Summary
-
Field Details
-
APPROVED
The permission was approved for this one instance. -
REJECTED
The permission was denied interactively by the user. -
USER_NOT_AVAILABLE
The permission was denied because user confirmation was unavailable. -
NO_RESULT
Leaves the pending permission request unanswered.When the SDK is used as an extension and the extension's permission handler cannot or chooses not to handle a given permission request, it can return
NO_RESULTto leave the request unanswered, allowing another client to handle it.Warning: This kind is only valid with protocol v3 servers (broadcast permission model). When connected to a protocol v2 server, the SDK will throw
IllegalStateExceptionbecause v2 expects exactly one response per permission request. -
DENIED_INTERACTIVELY_BY_USER
Deprecated.UseREJECTEDinstead. -
DENIED_COULD_NOT_REQUEST_FROM_USER
Deprecated.UseUSER_NOT_AVAILABLEinstead. -
DENIED_BY_RULES
Deprecated.UseUSER_NOT_AVAILABLEinstead.
-
-
Constructor Details
-
PermissionRequestResultKind
Creates a newPermissionRequestResultKindwith the given string value. Useful for extension kinds not covered by the well-known constants.- Parameters:
value- the string value;nullis treated as an empty string
-
-
Method Details
USER_NOT_AVAILABLEinstead.