Passport/pkg/grpc/proto/realms.proto
2024-05-04 10:53:24 +08:00

54 lines
1.3 KiB
Protocol Buffer

syntax = "proto3";
import "google/protobuf/empty.proto";
option go_package = ".;proto";
package proto;
service Realms {
rpc ListCommunityRealm(google.protobuf.Empty) returns (ListRealmResponse) {}
rpc ListAvailableRealm(RealmLookupWithUserRequest) returns (ListRealmResponse) {}
rpc ListOwnedRealm(RealmLookupWithUserRequest) returns (ListRealmResponse) {}
rpc GetRealm(RealmLookupRequest) returns (RealmResponse) {}
rpc ListRealmMember(RealmMemberLookupRequest) returns (ListRealmMemberResponse) {}
rpc GetRealmMember(RealmMemberLookupRequest) returns (RealmMemberResponse) {}
}
message RealmLookupWithUserRequest {
uint64 user_id = 1;
}
message RealmLookupRequest {
optional uint64 id = 1;
optional string alias = 2;
optional bool is_public = 3;
optional bool is_community = 4;
}
message RealmResponse {
string alias = 1;
string name = 2;
string description = 3;
bool is_public = 4;
bool is_community = 5;
}
message ListRealmResponse {
repeated RealmResponse data = 1;
}
message RealmMemberLookupRequest {
uint64 realm_id = 1;
optional uint64 user_id = 2;
}
message RealmMemberResponse {
uint64 realm_id = 1;
uint64 user_id = 2;
int32 power_level = 3;
}
message ListRealmMemberResponse {
repeated RealmMemberResponse data = 1;
}