-
Notifications
You must be signed in to change notification settings - Fork 0
/
active.proto
142 lines (118 loc) · 3.41 KB
/
active.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
// Copyright 2023 Yunseong Hwang
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// SPDX-License-Identifier: Apache-2.0
syntax = "proto3";
service Active {
rpc Describe(DescribeRequest) returns (DescribeResponse) {}
rpc GetProperty(GetPropertyRequest) returns (GetPropertyResponse) {}
rpc SetProperty(SetPropertyRequest) returns (SetPropertyResponse) {}
rpc InvokeMethod(InvokeMethodRequest) returns (InvokeMethodResponse) {}
rpc ConnectEvent(ConnectEventRequest) returns (ConnectEventResponse) {}
rpc DisconnectEvent(DisconnectEventRequest) returns (DisconnectEventResponse) {}
rpc HandleEvent(stream HandleEventResponse) returns (stream HandleEventRequest) {}
}
enum RequestContext {
DEFAULT = 0;
EVENT_CALLBACK = 1;
}
message DescribeRequest {
RequestContext request_context = 1;
uint32 callback_event_index = 2;
}
message PropertyInfo {
uint32 index = 1;
string name = 2;
string property_type = 3;
bool is_readable = 4;
bool is_writable = 5;
}
message ArgumentInfo {
string name = 1;
string argument_type = 2;
}
message MethodInfo {
uint32 index = 1;
string name = 2;
repeated ArgumentInfo arguments = 3;
string return_type = 4;
}
message EventInfo {
uint32 index = 1;
string name = 2;
repeated ArgumentInfo arguments = 3;
}
message DescribeResponse {
repeated PropertyInfo properties = 1;
repeated MethodInfo methods = 2;
repeated EventInfo events = 3;
}
message VariantList { repeated Variant values = 1; }
message VaraintHashMap { map<string, Variant> values = 1; }
message Variant {
oneof value {
bool bool_value = 1;
string string_value = 2;
int32 int_value = 3;
uint32 uint_value = 4;
double double_value = 5;
VariantList list_value = 6;
VaraintHashMap map_value = 7;
}
}
message GetPropertyRequest {
uint32 index = 1;
RequestContext request_context = 2;
uint32 callback_event_index = 3;
}
message GetPropertyResponse { Variant value = 1; }
message SetPropertyRequest {
uint32 index = 1;
Variant value = 2;
RequestContext request_context = 3;
uint32 callback_event_index = 4;
}
message SetPropertyResponse {}
message InvokeMethodRequest {
uint32 index = 1;
repeated Variant arguments = 2;
RequestContext request_context = 3;
uint32 callback_event_index = 4;
}
message InvokeMethodResponse { Variant return_value = 1; }
message ConnectEventRequest {
uint32 index = 1;
RequestContext request_context = 2;
uint32 callback_event_index = 3;
}
message ConnectEventResponse { bool successful = 1; }
message DisconnectEventRequest {
uint32 index = 1;
RequestContext request_context = 2;
uint32 callback_event_index = 3;
}
message DisconnectEventResponse { bool successful = 1; }
message HandleEventRequest {
uint32 index = 1;
uint32 id = 2;
repeated Variant arguments = 3;
bool is_ping = 4;
bool is_pong = 5;
}
message HandleEventResponse {
uint32 index = 1;
uint32 id = 2;
bool is_ping = 3;
bool is_pong = 4;
}