JsonRPC/examples/example.jrpc

75 lines
1.5 KiB
Plaintext
Raw Normal View History

import "./import";
2022-01-10 14:15:06 +00:00
define csharp_namespace Example;
define rust_crate example;
2022-07-21 07:09:10 +00:00
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 {
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")
AddValuesMultipleParams(value1: float, value2: float): float;
2022-01-01 18:47:34 +00:00
@Description("Does literaly nothing")
@Param("param1", "Some number")
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
FunctionWithArrayAsParamAndReturn(values1: float[], values2: float[]): float[];
2024-01-18 18:08:44 +00:00
FunctionWithKeywords(type: float, static: float, event: float): float;
}
type Test2 {
name: string;
age: int;
}
2024-01-18 18:08:44 +00:00
type TestKeywords {
type: float;
static: float;
event: float;
}
service SimpleTestService {
@Description("asdasdasd")
GetTest(name: string, age: int): Test2;
notification TestNot();
}