-
Notifications
You must be signed in to change notification settings - Fork 39
/
hook.proto
102 lines (84 loc) · 2.25 KB
/
hook.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
/**
* Copyright (c) 2022 Peking University and Peking University Institute for Computing and Digital Economy
* SCOW is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
syntax = "proto3";
package scow.server.hook;
import "common/money.proto";
import "common/ended_job.proto";
import "google/protobuf/timestamp.proto";
message AccountBlocked {
string account_name = 1;
string tenant_name = 2;
}
message AccountUnblocked {
string account_name = 1;
string tenant_name = 2;
}
message AccountCreated {
string account_name = 1;
string tenant_name = 2;
string owner_id = 3;
optional string comment = 4;
}
message UserBlockedInAccount {
string user_id = 1;
string account_name = 2;
}
message UserUnblockedInAccount {
string user_id = 1;
string account_name = 2;
}
message UserCreated {
string user_id = 1;
string tenant_name = 2;
}
message UserAdded {
string user_id = 1;
string tenant_name = 2;
}
message AccountPaid {
string account_name = 1;
common.Money amount = 2;
string type = 3;
string comment = 4;
}
message TenantPaid {
string tenant_name = 1;
common.Money amount = 2;
string type = 3;
string comment = 4;
}
message JobsSaved {
repeated common.JobInfo jobs = 1;
}
message OnEventRequest {
message Metadata {
google.protobuf.Timestamp time = 1;
}
Metadata metadata = 1;
oneof event {
AccountBlocked account_blocked = 2;
AccountUnblocked account_unblocked = 3;
AccountCreated account_created = 4;
UserBlockedInAccount user_blocked_in_account = 5;
UserUnblockedInAccount user_unblocked_in_account = 6;
UserCreated user_created = 7;
UserAdded user_added = 8;
AccountPaid account_paid = 9;
TenantPaid tenant_paid = 10;
JobsSaved jobs_saved = 11;
}
}
message OnEventResponse {
}
service HookService {
rpc OnEvent (OnEventRequest) returns (OnEventResponse);
}