Class GitHubTokenProviderResult
java.lang.Object
com.github.copilot.rpc.GitHubTokenProviderResult
Result of acquiring a session-scoped GitHub token.
Token values are redacted from toString().
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic GitHubTokenProviderResultCreates an explicit cancellation result.Gets the access token.longGets the remaining token lifetime.Gets the OAuth token type.booleanGets whether acquisition was cancelled.static GitHubTokenProviderResultCreates a token result.static GitHubTokenProviderResultCreates a token result with an explicit OAuth token type.toString()
-
Method Details
-
token
Creates a token result.- Parameters:
accessToken- GitHub access tokenexpiresIn- positive remaining lifetime in seconds when the callback completes- Returns:
- the token result
-
token
Creates a token result with an explicit OAuth token type.- Parameters:
accessToken- GitHub access tokenexpiresIn- positive remaining lifetime in seconds when the callback completestokenType- OAuth token type, ornullto use the runtime's bearer default- Returns:
- the token result
-
cancelled
Creates an explicit cancellation result.- Returns:
- the cancellation result
-
isCancelled
public boolean isCancelled()Gets whether acquisition was cancelled.- Returns:
truefor a cancellation result
-
getAccessToken
-
getExpiresIn
public long getExpiresIn()Gets the remaining token lifetime.- Returns:
- remaining lifetime in seconds
-
getTokenType
Gets the OAuth token type.- Returns:
- token type, or
nullfor the runtime default
-
toString
-