/** * Generated by the protoc-gen-ts. DO NOT EDIT! * compiler version: 3.21.12 * source: vm/batch_keys.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as pb_1 from "google-protobuf"; export namespace proto { export class BatchKey extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { key?: string; field?: string; value?: Uint8Array; contract_name?: string; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("key" in data && data.key != undefined) { this.key = data.key; } if ("field" in data && data.field != undefined) { this.field = data.field; } if ("value" in data && data.value != undefined) { this.value = data.value; } if ("contract_name" in data && data.contract_name != undefined) { this.contract_name = data.contract_name; } } } get key() { return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set key(value: string) { pb_1.Message.setField(this, 1, value); } get field() { return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set field(value: string) { pb_1.Message.setField(this, 2, value); } get value() { return pb_1.Message.getFieldWithDefault(this, 3, new Uint8Array(0)) as Uint8Array; } set value(value: Uint8Array) { pb_1.Message.setField(this, 3, value); } get contract_name() { return pb_1.Message.getFieldWithDefault(this, 4, "") as string; } set contract_name(value: string) { pb_1.Message.setField(this, 4, value); } static fromObject(data: { key?: string; field?: string; value?: Uint8Array; contract_name?: string; }): BatchKey { const message = new BatchKey({}); if (data.key != null) { message.key = data.key; } if (data.field != null) { message.field = data.field; } if (data.value != null) { message.value = data.value; } if (data.contract_name != null) { message.contract_name = data.contract_name; } return message; } toObject() { const data: { key?: string; field?: string; value?: Uint8Array; contract_name?: string; } = {}; if (this.key != null) { data.key = this.key; } if (this.field != null) { data.field = this.field; } if (this.value != null) { data.value = this.value; } if (this.contract_name != null) { data.contract_name = this.contract_name; } return data; } serialize(): Uint8Array; serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); if (this.key.length) writer.writeString(1, this.key); if (this.field.length) writer.writeString(2, this.field); if (this.value.length) writer.writeBytes(3, this.value); if (this.contract_name.length) writer.writeString(4, this.contract_name); if (!w) return writer.getResultBuffer(); } static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BatchKey { const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new BatchKey(); while (reader.nextField()) { if (reader.isEndGroup()) break; switch (reader.getFieldNumber()) { case 1: message.key = reader.readString(); break; case 2: message.field = reader.readString(); break; case 3: message.value = reader.readBytes(); break; case 4: message.contract_name = reader.readString(); break; default: reader.skipField(); } } return message; } serializeBinary(): Uint8Array { return this.serialize(); } static deserializeBinary(bytes: Uint8Array): BatchKey { return BatchKey.deserialize(bytes); } } export class BatchKeys extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { Keys?: BatchKey[]; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("Keys" in data && data.Keys != undefined) { this.Keys = data.Keys; } } } get Keys() { return pb_1.Message.getRepeatedWrapperField(this, BatchKey, 1) as BatchKey[]; } set Keys(value: BatchKey[]) { pb_1.Message.setRepeatedWrapperField(this, 1, value); } static fromObject(data: { Keys?: ReturnType[]; }): BatchKeys { const message = new BatchKeys({}); if (data.Keys != null) { message.Keys = data.Keys.map(item => BatchKey.fromObject(item)); } return message; } toObject() { const data: { Keys?: ReturnType[]; } = {}; if (this.Keys != null) { data.Keys = this.Keys.map((item: BatchKey) => item.toObject()); } return data; } serialize(): Uint8Array; serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); if (this.Keys.length) writer.writeRepeatedMessage(1, this.Keys, (item: BatchKey) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); } static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BatchKeys { const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new BatchKeys(); while (reader.nextField()) { if (reader.isEndGroup()) break; switch (reader.getFieldNumber()) { case 1: reader.readMessage(message.Keys, () => pb_1.Message.addToRepeatedWrapperField(message, 1, BatchKey.deserialize(reader), BatchKey)); break; default: reader.skipField(); } } return message; } serializeBinary(): Uint8Array { return this.serialize(); } static deserializeBinary(bytes: Uint8Array): BatchKeys { return BatchKeys.deserialize(bytes); } } export class Keys extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { key?: string[]; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("key" in data && data.key != undefined) { this.key = data.key; } } } get key() { return pb_1.Message.getFieldWithDefault(this, 1, []) as string[]; } set key(value: string[]) { pb_1.Message.setField(this, 1, value); } static fromObject(data: { key?: string[]; }): Keys { const message = new Keys({}); if (data.key != null) { message.key = data.key; } return message; } toObject() { const data: { key?: string[]; } = {}; if (this.key != null) { data.key = this.key; } return data; } serialize(): Uint8Array; serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); if (this.key.length) writer.writeRepeatedString(1, this.key); if (!w) return writer.getResultBuffer(); } static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Keys { const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Keys(); while (reader.nextField()) { if (reader.isEndGroup()) break; switch (reader.getFieldNumber()) { case 1: pb_1.Message.addToRepeatedField(message, 1, reader.readString()); break; default: reader.skipField(); } } return message; } serializeBinary(): Uint8Array { return this.serialize(); } static deserializeBinary(bytes: Uint8Array): Keys { return Keys.deserialize(bytes); } } }