Record Class McpAuthResponse
java.lang.Object
java.lang.Record
com.github.copilot.rpc.McpAuthResponse
- Record Components:
legacyResult- optional legacy token or cancellation resultisRuntimeRefresh- whether to hand an advertised Refresh back to its runtime operation
Opt-in MCP auth response that preserves legacy request and result record
patterns. A usable legacy token takes precedence over handoff; legacy
cancellation remains cancellation even if handoff is also requested.
- Since:
- 1.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionMcpAuthResponse(McpAuthResult legacyResult, boolean isRuntimeRefresh) Creates an instance of aMcpAuthResponserecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisRuntimeRefreshrecord component.static McpAuthResponselegacy(McpAuthResult result) Wraps an existing token or cancellation result.Returns the value of thelegacyResultrecord component.static McpAuthResponseHands an advertised Refresh back to the original runtime operation.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
McpAuthResponse
Creates an instance of aMcpAuthResponserecord class.- Parameters:
legacyResult- the value for thelegacyResultrecord componentisRuntimeRefresh- the value for theisRuntimeRefreshrecord component
-
-
Method Details
-
legacy
Wraps an existing token or cancellation result.- Parameters:
result- the legacy result- Returns:
- legacy response
-
runtimeRefresh
Hands an advertised Refresh back to the original runtime operation. Acceptance is not token installation or reconnect completion.- Returns:
- noninteractive runtime refresh response
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
legacyResult
Returns the value of thelegacyResultrecord component.- Returns:
- the value of the
legacyResultrecord component
-
isRuntimeRefresh
public boolean isRuntimeRefresh()Returns the value of theisRuntimeRefreshrecord component.- Returns:
- the value of the
isRuntimeRefreshrecord component
-