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.DENIED_BY_RULES— the permission was denied by policy rules.DENIED_COULD_NOT_REQUEST_FROM_USER— the permission was denied because no approval rule was found and the user could not be prompted.DENIED_INTERACTIVELY_BY_USER— the permission was denied interactively by the user.
- Since:
- 1.1.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PermissionRequestResultKindThe permission was approved.static final PermissionRequestResultKindThe permission was denied by policy rules.static final PermissionRequestResultKindThe permission was denied because no approval rule was found and the user could not be prompted.static final PermissionRequestResultKindThe permission was denied interactively by the user.static final PermissionRequestResultKindLeaves the pending permission request unanswered. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a newPermissionRequestResultKindwith the given string value. -
Method Summary
-
Field Details
-
APPROVED
The permission was approved. -
DENIED_BY_RULES
The permission was denied by policy rules. -
DENIED_COULD_NOT_REQUEST_FROM_USER
The permission was denied because no approval rule was found and the user could not be prompted. -
DENIED_INTERACTIVELY_BY_USER
The permission was denied interactively by the user. -
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.
-
-
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