JsonRPC/examples/example.jrpc
2022-07-21 09:09:10 +02:00

56 lines
1.1 KiB
Plaintext

import "./import";
define csharp_namespace Example;
define rust_crate example;
define dart_library_name example;
enum TestEnum {
VAL1,
VAL2,
VAL10 = 10,
VAL11,
VAL12
}
type Test {
atom: TestAtom;
array: TestAtom[];
enumValue: TestEnum;
map: {int, TestAtom};
}
type AddValueRequest {
value1: float;
value2: float;
}
type AddValueResponse {
value: float;
}
service TestService {
@Description("Add two numbers")
@Param("request", "Parameter containing the two numbers")
@Returns("")
AddValuesSingleParam(request: AddValueRequest): AddValueResponse;
@Description("Add two numbers")
@Param("value1", "The first value")
@Param("value2", "The second value")
AddValuesMultipleParams(value1: float, value2: float): float;
@Description("Does literaly nothing")
@Param("param1", "Some number")
ReturningVoid(param1: float): void;
@Description("Just sends an Event with a String")
@Param("param1", "Parameter with some string for event")
notification OnEvent(param1: string);
ThrowingError(): void;
FunctionWithArrayAsParamAndReturn(values1: float[], values2: float[]): float[];
}