Package com.github.copilot.sdk.json
Class JsonRpcRequest
java.lang.Object
com.github.copilot.sdk.json.JsonRpcRequest
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.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetId()Gets the request ID.Gets the JSON-RPC version.Gets the method name.Gets the method parameters.voidSets the request ID.voidsetJsonrpc(String jsonrpc) Sets the JSON-RPC version.voidSets the method name.voidSets the method parameters.
-
Constructor Details
-
JsonRpcRequest
public JsonRpcRequest()
-
-
Method Details
-
getJsonrpc
Gets the JSON-RPC version.- Returns:
- the version string (should be "2.0")
-
setJsonrpc
Sets the JSON-RPC version.- Parameters:
jsonrpc- the version string
-
getId
Gets the request ID.- Returns:
- the request identifier
-
setId
Sets the request ID.- Parameters:
id- the request identifier
-
getMethod
Gets the method name.- Returns:
- the RPC method to invoke
-
setMethod
Sets the method name.- Parameters:
method- the RPC method to invoke
-
getParams
Gets the method parameters.- Returns:
- the parameters object
-
setParams
Sets the method parameters.- Parameters:
params- the parameters object
-