Record Class McpAuthResponse

java.lang.Object
java.lang.Record
com.github.copilot.rpc.McpAuthResponse
Record Components:
legacyResult - optional legacy token or cancellation result
isRuntimeRefresh - whether to hand an advertised Refresh back to its runtime operation

public record McpAuthResponse(McpAuthResult legacyResult, boolean isRuntimeRefresh) extends Record
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 Details

    • McpAuthResponse

      public McpAuthResponse(McpAuthResult legacyResult, boolean isRuntimeRefresh)
      Creates an instance of a McpAuthResponse record class.
      Parameters:
      legacyResult - the value for the legacyResult record component
      isRuntimeRefresh - the value for the isRuntimeRefresh record component
  • Method Details

    • legacy

      public static McpAuthResponse legacy(McpAuthResult result)
      Wraps an existing token or cancellation result.
      Parameters:
      result - the legacy result
      Returns:
      legacy response
    • runtimeRefresh

      public static McpAuthResponse 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

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • legacyResult

      public McpAuthResult legacyResult()
      Returns the value of the legacyResult record component.
      Returns:
      the value of the legacyResult record component
    • isRuntimeRefresh

      public boolean isRuntimeRefresh()
      Returns the value of the isRuntimeRefresh record component.
      Returns:
      the value of the isRuntimeRefresh record component