Class ExtensionContextAttachment

java.lang.Object
com.github.copilot.rpc.ExtensionContextAttachment
All Implemented Interfaces:
MessageAttachment

public final class ExtensionContextAttachment extends Object implements MessageAttachment
Structured context contributed by an extension.
Since:
1.0.0
See Also:
  • Constructor Details

    • ExtensionContextAttachment

      public ExtensionContextAttachment()
  • Method Details

    • getType

      public String getType()
      Returns the attachment type, always "extension_context".
      Specified by:
      getType in interface MessageAttachment
      Returns:
      "extension_context"
    • getCapturedAt

      public String getCapturedAt()
      Gets the ISO 8601 capture timestamp.
      Returns:
      the capture timestamp
    • setCapturedAt

      public ExtensionContextAttachment setCapturedAt(String capturedAt)
      Sets the ISO 8601 capture timestamp.
      Parameters:
      capturedAt - the capture timestamp
      Returns:
      this attachment for method chaining
    • getExtensionId

      public String getExtensionId()
      Gets the owning extension identifier.
      Returns:
      the extension identifier
    • setExtensionId

      public ExtensionContextAttachment setExtensionId(String extensionId)
      Sets the owning extension identifier.
      Parameters:
      extensionId - the extension identifier
      Returns:
      this attachment for method chaining
    • getTitle

      public String getTitle()
      Gets the human-readable context title.
      Returns:
      the context title
    • setTitle

      public ExtensionContextAttachment setTitle(String title)
      Sets the human-readable context title.
      Parameters:
      title - the context title
      Returns:
      this attachment for method chaining
    • getCanvasId

      public String getCanvasId()
      Gets the provider-local canvas identifier.
      Returns:
      the canvas identifier, or null
    • setCanvasId

      public ExtensionContextAttachment setCanvasId(String canvasId)
      Sets the provider-local canvas identifier.
      Parameters:
      canvasId - the canvas identifier
      Returns:
      this attachment for method chaining
    • getInstanceId

      public String getInstanceId()
      Gets the open canvas instance identifier.
      Returns:
      the instance identifier, or null
    • setInstanceId

      public ExtensionContextAttachment setInstanceId(String instanceId)
      Sets the open canvas instance identifier.
      Parameters:
      instanceId - the instance identifier
      Returns:
      this attachment for method chaining
    • getPayload

      public Object getPayload()
      Gets the extension-defined structured payload.
      Returns:
      the structured payload, or null
    • setPayload

      public ExtensionContextAttachment setPayload(Object payload)
      Sets the extension-defined structured payload.
      Parameters:
      payload - a JSON-serializable payload
      Returns:
      this attachment for method chaining