JsonRPC/examples/example.jrpc

55 lines
1.1 KiB
Plaintext
Raw Normal View History

import "./import";
2022-01-10 14:15:06 +00:00
define csharp_namespace Example;
2022-04-13 18:58:53 +00:00
define rust_crate example;
enum TestEnum {
VAL1,
VAL2,
VAL10 = 10,
VAL11,
VAL12
}
type Test {
atom: TestAtom;
array: TestAtom[];
enumValue: TestEnum;
2022-04-13 18:58:53 +00:00
map: {int, TestAtom};
}
type AddValueRequest {
2022-04-13 18:58:53 +00:00
value1: float;
value2: float;
}
type AddValueResponse {
2022-04-13 18:58:53 +00:00
value: float;
}
service TestService {
2022-01-01 18:47:34 +00:00
@Description("Add two numbers")
@Param("request", "Parameter containing the two numbers")
2022-01-03 21:08:25 +00:00
@Returns("")
AddValuesSingleParam(request: AddValueRequest): AddValueResponse;
2022-01-01 18:47:34 +00:00
@Description("Add two numbers")
@Param("value1", "The first value")
@Param("value2", "The second value")
2022-04-13 18:58:53 +00:00
AddValuesMultipleParams(value1: float, value2: float): float;
2022-01-01 18:47:34 +00:00
@Description("Does literaly nothing")
@Param("param1", "Some number")
2022-04-13 18:58:53 +00:00
ReturningVoid(param1: float): void;
2022-01-01 18:47:34 +00:00
@Description("Just sends an Event with a String")
@Param("param1", "Parameter with some string for event")
notification OnEvent(param1: string);
2022-01-02 20:51:45 +00:00
ThrowingError(): void;
2022-01-02 20:51:45 +00:00
2022-04-13 18:58:53 +00:00
FunctionWithArrayAsParamAndReturn(values1: float[], values2: float[]): float[];
}