Class JsonRpcRequest

java.lang.Object
com.github.copilot.sdk.json.JsonRpcRequest

public final class JsonRpcRequest extends Object
JSON-RPC 2.0 request structure.

This is an internal class representing the wire format of a JSON-RPC request. It follows the JSON-RPC 2.0 specification.

Since:
1.0.0
See Also:
  • Constructor Details

    • JsonRpcRequest

      public JsonRpcRequest()
  • Method Details

    • getJsonrpc

      public String getJsonrpc()
      Gets the JSON-RPC version.
      Returns:
      the version string (should be "2.0")
    • setJsonrpc

      public void setJsonrpc(String jsonrpc)
      Sets the JSON-RPC version.
      Parameters:
      jsonrpc - the version string
    • getId

      public Long getId()
      Gets the request ID.
      Returns:
      the request identifier
    • setId

      public void setId(Long id)
      Sets the request ID.
      Parameters:
      id - the request identifier
    • getMethod

      public String getMethod()
      Gets the method name.
      Returns:
      the RPC method to invoke
    • setMethod

      public void setMethod(String method)
      Sets the method name.
      Parameters:
      method - the RPC method to invoke
    • getParams

      public Object getParams()
      Gets the method parameters.
      Returns:
      the parameters object
    • setParams

      public void setParams(Object params)
      Sets the method parameters.
      Parameters:
      params - the parameters object