x
This commit is contained in:
+17
-17
@@ -2038,17 +2038,17 @@ export namespace srpc {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
type?: string;
|
||||
logs?: Any[];
|
||||
content?: string;
|
||||
plugin_id?: string;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls);
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("type" in data && data.type != undefined) {
|
||||
this.type = data.type;
|
||||
}
|
||||
if ("logs" in data && data.logs != undefined) {
|
||||
this.logs = data.logs;
|
||||
if ("content" in data && data.content != undefined) {
|
||||
this.content = data.content;
|
||||
}
|
||||
if ("plugin_id" in data && data.plugin_id != undefined) {
|
||||
this.plugin_id = data.plugin_id;
|
||||
@@ -2061,11 +2061,11 @@ export namespace srpc {
|
||||
set type(value: string) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get logs() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, Any, 2) as Any[];
|
||||
get content() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
|
||||
}
|
||||
set logs(value: Any[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 2, value);
|
||||
set content(value: string) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
get plugin_id() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
|
||||
@@ -2075,15 +2075,15 @@ export namespace srpc {
|
||||
}
|
||||
static fromObject(data: {
|
||||
type?: string;
|
||||
logs?: ReturnType<typeof Any.prototype.toObject>[];
|
||||
content?: string;
|
||||
plugin_id?: string;
|
||||
}): ConsoleRequest {
|
||||
const message = new ConsoleRequest({});
|
||||
if (data.type != null) {
|
||||
message.type = data.type;
|
||||
}
|
||||
if (data.logs != null) {
|
||||
message.logs = data.logs.map(item => Any.fromObject(item));
|
||||
if (data.content != null) {
|
||||
message.content = data.content;
|
||||
}
|
||||
if (data.plugin_id != null) {
|
||||
message.plugin_id = data.plugin_id;
|
||||
@@ -2093,14 +2093,14 @@ export namespace srpc {
|
||||
toObject() {
|
||||
const data: {
|
||||
type?: string;
|
||||
logs?: ReturnType<typeof Any.prototype.toObject>[];
|
||||
content?: string;
|
||||
plugin_id?: string;
|
||||
} = {};
|
||||
if (this.type != null) {
|
||||
data.type = this.type;
|
||||
}
|
||||
if (this.logs != null) {
|
||||
data.logs = this.logs.map((item: Any) => item.toObject());
|
||||
if (this.content != null) {
|
||||
data.content = this.content;
|
||||
}
|
||||
if (this.plugin_id != null) {
|
||||
data.plugin_id = this.plugin_id;
|
||||
@@ -2113,8 +2113,8 @@ export namespace srpc {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.type.length)
|
||||
writer.writeString(1, this.type);
|
||||
if (this.logs.length)
|
||||
writer.writeRepeatedMessage(2, this.logs, (item: Any) => item.serialize(writer));
|
||||
if (this.content.length)
|
||||
writer.writeString(2, this.content);
|
||||
if (this.plugin_id.length)
|
||||
writer.writeString(3, this.plugin_id);
|
||||
if (!w)
|
||||
@@ -2130,7 +2130,7 @@ export namespace srpc {
|
||||
message.type = reader.readString();
|
||||
break;
|
||||
case 2:
|
||||
reader.readMessage(message.logs, () => pb_1.Message.addToRepeatedWrapperField(message, 2, Any.deserialize(reader), Any));
|
||||
message.content = reader.readString();
|
||||
break;
|
||||
case 3:
|
||||
message.plugin_id = reader.readString();
|
||||
|
||||
Reference in New Issue
Block a user