/**
 * Generated by the protoc-gen-ts.  DO NOT EDIT!
 * compiler version: 0.0.0
 * source: blocks.proto
 * git: https://github.com/thesayyn/protoc-gen-ts */
import * as pb_1 from "google-protobuf";
export namespace mall {
    export class Empty extends pb_1.Message {
        #one_of_decls: number[][] = [];
        constructor(data?: any[] | {}) {
            super();
            pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
            if (!Array.isArray(data) && typeof data == "object") { }
        }
        static fromObject(data: {}): Empty {
            const message = new Empty({});
            return message;
        }
        toObject() {
            const data: {} = {};
            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 (!w)
                return writer.getResultBuffer();
        }
        static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Empty {
            const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Empty();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    default: reader.skipField();
                }
            }
            return message;
        }
        serializeBinary(): Uint8Array {
            return this.serialize();
        }
        static deserializeBinary(bytes: Uint8Array): Empty {
            return Empty.deserialize(bytes);
        }
    }
    export class FetchRequest extends pb_1.Message {
        #one_of_decls: number[][] = [];
        constructor(data?: any[] | {
            page_no?: number;
            page_size?: number;
            params?: Map<string, string>;
            store_identity?: string;
            keyword?: 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 ("page_no" in data && data.page_no != undefined) {
                    this.page_no = data.page_no;
                }
                if ("page_size" in data && data.page_size != undefined) {
                    this.page_size = data.page_size;
                }
                if ("params" in data && data.params != undefined) {
                    this.params = data.params;
                }
                if ("store_identity" in data && data.store_identity != undefined) {
                    this.store_identity = data.store_identity;
                }
                if ("keyword" in data && data.keyword != undefined) {
                    this.keyword = data.keyword;
                }
            }
            if (!this.params)
                this.params = new Map();
        }
        get page_no() {
            return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
        }
        set page_no(value: number) {
            pb_1.Message.setField(this, 1, value);
        }
        get page_size() {
            return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
        }
        set page_size(value: number) {
            pb_1.Message.setField(this, 2, value);
        }
        get params() {
            return pb_1.Message.getField(this, 3) as any as Map<string, string>;
        }
        set params(value: Map<string, string>) {
            pb_1.Message.setField(this, 3, value as any);
        }
        get store_identity() {
            return pb_1.Message.getFieldWithDefault(this, 4, "") as string;
        }
        set store_identity(value: string) {
            pb_1.Message.setField(this, 4, value);
        }
        get keyword() {
            return pb_1.Message.getFieldWithDefault(this, 5, "") as string;
        }
        set keyword(value: string) {
            pb_1.Message.setField(this, 5, value);
        }
        static fromObject(data: {
            page_no?: number;
            page_size?: number;
            params?: {
                [key: string]: string;
            };
            store_identity?: string;
            keyword?: string;
        }): FetchRequest {
            const message = new FetchRequest({});
            if (data.page_no != null) {
                message.page_no = data.page_no;
            }
            if (data.page_size != null) {
                message.page_size = data.page_size;
            }
            if (typeof data.params == "object") {
                message.params = new Map(Object.entries(data.params));
            }
            if (data.store_identity != null) {
                message.store_identity = data.store_identity;
            }
            if (data.keyword != null) {
                message.keyword = data.keyword;
            }
            return message;
        }
        toObject() {
            const data: {
                page_no?: number;
                page_size?: number;
                params?: {
                    [key: string]: string;
                };
                store_identity?: string;
                keyword?: string;
            } = {};
            if (this.page_no != null) {
                data.page_no = this.page_no;
            }
            if (this.page_size != null) {
                data.page_size = this.page_size;
            }
            if (this.params != null) {
                data.params = (Object.fromEntries)(this.params);
            }
            if (this.store_identity != null) {
                data.store_identity = this.store_identity;
            }
            if (this.keyword != null) {
                data.keyword = this.keyword;
            }
            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.page_no != 0)
                writer.writeInt64(1, this.page_no);
            if (this.page_size != 0)
                writer.writeInt64(2, this.page_size);
            for (const [key, value] of this.params) {
                writer.writeMessage(3, this.params, () => {
                    writer.writeString(1, key);
                    writer.writeString(2, value);
                });
            }
            if (this.store_identity.length)
                writer.writeString(4, this.store_identity);
            if (this.keyword.length)
                writer.writeString(5, this.keyword);
            if (!w)
                return writer.getResultBuffer();
        }
        static deserialize(bytes: Uint8Array | pb_1.BinaryReader): FetchRequest {
            const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new FetchRequest();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    case 1:
                        message.page_no = reader.readInt64();
                        break;
                    case 2:
                        message.page_size = reader.readInt64();
                        break;
                    case 3:
                        reader.readMessage(message, () => pb_1.Map.deserializeBinary(message.params as any, reader, reader.readString, reader.readString));
                        break;
                    case 4:
                        message.store_identity = reader.readString();
                        break;
                    case 5:
                        message.keyword = reader.readString();
                        break;
                    default: reader.skipField();
                }
            }
            return message;
        }
        serializeBinary(): Uint8Array {
            return this.serialize();
        }
        static deserializeBinary(bytes: Uint8Array): FetchRequest {
            return FetchRequest.deserialize(bytes);
        }
    }
    export class IdentRequest extends pb_1.Message {
        #one_of_decls: number[][] = [];
        constructor(data?: any[] | {
            id?: number;
            identity?: 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 ("id" in data && data.id != undefined) {
                    this.id = data.id;
                }
                if ("identity" in data && data.identity != undefined) {
                    this.identity = data.identity;
                }
            }
        }
        get id() {
            return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
        }
        set id(value: number) {
            pb_1.Message.setField(this, 1, value);
        }
        get identity() {
            return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
        }
        set identity(value: string) {
            pb_1.Message.setField(this, 2, value);
        }
        static fromObject(data: {
            id?: number;
            identity?: string;
        }): IdentRequest {
            const message = new IdentRequest({});
            if (data.id != null) {
                message.id = data.id;
            }
            if (data.identity != null) {
                message.identity = data.identity;
            }
            return message;
        }
        toObject() {
            const data: {
                id?: number;
                identity?: string;
            } = {};
            if (this.id != null) {
                data.id = this.id;
            }
            if (this.identity != null) {
                data.identity = this.identity;
            }
            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.id != 0)
                writer.writeInt64(1, this.id);
            if (this.identity.length)
                writer.writeString(2, this.identity);
            if (!w)
                return writer.getResultBuffer();
        }
        static deserialize(bytes: Uint8Array | pb_1.BinaryReader): IdentRequest {
            const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new IdentRequest();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    case 1:
                        message.id = reader.readInt64();
                        break;
                    case 2:
                        message.identity = reader.readString();
                        break;
                    default: reader.skipField();
                }
            }
            return message;
        }
        serializeBinary(): Uint8Array {
            return this.serialize();
        }
        static deserializeBinary(bytes: Uint8Array): IdentRequest {
            return IdentRequest.deserialize(bytes);
        }
    }
    export class StoreSerialRequest extends pb_1.Message {
        #one_of_decls: number[][] = [];
        constructor(data?: any[] | {
            store_identity?: string;
            serial_id?: string[];
        }) {
            super();
            pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls);
            if (!Array.isArray(data) && typeof data == "object") {
                if ("store_identity" in data && data.store_identity != undefined) {
                    this.store_identity = data.store_identity;
                }
                if ("serial_id" in data && data.serial_id != undefined) {
                    this.serial_id = data.serial_id;
                }
            }
        }
        get store_identity() {
            return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
        }
        set store_identity(value: string) {
            pb_1.Message.setField(this, 1, value);
        }
        get serial_id() {
            return pb_1.Message.getFieldWithDefault(this, 2, []) as string[];
        }
        set serial_id(value: string[]) {
            pb_1.Message.setField(this, 2, value);
        }
        static fromObject(data: {
            store_identity?: string;
            serial_id?: string[];
        }): StoreSerialRequest {
            const message = new StoreSerialRequest({});
            if (data.store_identity != null) {
                message.store_identity = data.store_identity;
            }
            if (data.serial_id != null) {
                message.serial_id = data.serial_id;
            }
            return message;
        }
        toObject() {
            const data: {
                store_identity?: string;
                serial_id?: string[];
            } = {};
            if (this.store_identity != null) {
                data.store_identity = this.store_identity;
            }
            if (this.serial_id != null) {
                data.serial_id = this.serial_id;
            }
            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.store_identity.length)
                writer.writeString(1, this.store_identity);
            if (this.serial_id.length)
                writer.writeRepeatedString(2, this.serial_id);
            if (!w)
                return writer.getResultBuffer();
        }
        static deserialize(bytes: Uint8Array | pb_1.BinaryReader): StoreSerialRequest {
            const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new StoreSerialRequest();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    case 1:
                        message.store_identity = reader.readString();
                        break;
                    case 2:
                        pb_1.Message.addToRepeatedField(message, 2, reader.readString());
                        break;
                    default: reader.skipField();
                }
            }
            return message;
        }
        serializeBinary(): Uint8Array {
            return this.serialize();
        }
        static deserializeBinary(bytes: Uint8Array): StoreSerialRequest {
            return StoreSerialRequest.deserialize(bytes);
        }
    }
    export class StatusReply extends pb_1.Message {
        #one_of_decls: number[][] = [];
        constructor(data?: any[] | {
            code?: number;
            identity?: string;
            message?: string;
            timeseq?: number;
        }) {
            super();
            pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
            if (!Array.isArray(data) && typeof data == "object") {
                if ("code" in data && data.code != undefined) {
                    this.code = data.code;
                }
                if ("identity" in data && data.identity != undefined) {
                    this.identity = data.identity;
                }
                if ("message" in data && data.message != undefined) {
                    this.message = data.message;
                }
                if ("timeseq" in data && data.timeseq != undefined) {
                    this.timeseq = data.timeseq;
                }
            }
        }
        get code() {
            return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
        }
        set code(value: number) {
            pb_1.Message.setField(this, 1, value);
        }
        get identity() {
            return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
        }
        set identity(value: string) {
            pb_1.Message.setField(this, 2, value);
        }
        get message() {
            return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
        }
        set message(value: string) {
            pb_1.Message.setField(this, 3, value);
        }
        get timeseq() {
            return pb_1.Message.getFieldWithDefault(this, 4, 0) as number;
        }
        set timeseq(value: number) {
            pb_1.Message.setField(this, 4, value);
        }
        static fromObject(data: {
            code?: number;
            identity?: string;
            message?: string;
            timeseq?: number;
        }): StatusReply {
            const message = new StatusReply({});
            if (data.code != null) {
                message.code = data.code;
            }
            if (data.identity != null) {
                message.identity = data.identity;
            }
            if (data.message != null) {
                message.message = data.message;
            }
            if (data.timeseq != null) {
                message.timeseq = data.timeseq;
            }
            return message;
        }
        toObject() {
            const data: {
                code?: number;
                identity?: string;
                message?: string;
                timeseq?: number;
            } = {};
            if (this.code != null) {
                data.code = this.code;
            }
            if (this.identity != null) {
                data.identity = this.identity;
            }
            if (this.message != null) {
                data.message = this.message;
            }
            if (this.timeseq != null) {
                data.timeseq = this.timeseq;
            }
            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.code != 0)
                writer.writeInt32(1, this.code);
            if (this.identity.length)
                writer.writeString(2, this.identity);
            if (this.message.length)
                writer.writeString(3, this.message);
            if (this.timeseq != 0)
                writer.writeInt64(4, this.timeseq);
            if (!w)
                return writer.getResultBuffer();
        }
        static deserialize(bytes: Uint8Array | pb_1.BinaryReader): StatusReply {
            const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new StatusReply();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    case 1:
                        message.code = reader.readInt32();
                        break;
                    case 2:
                        message.identity = reader.readString();
                        break;
                    case 3:
                        message.message = reader.readString();
                        break;
                    case 4:
                        message.timeseq = reader.readInt64();
                        break;
                    default: reader.skipField();
                }
            }
            return message;
        }
        serializeBinary(): Uint8Array {
            return this.serialize();
        }
        static deserializeBinary(bytes: Uint8Array): StatusReply {
            return StatusReply.deserialize(bytes);
        }
    }
    export class VersionRequest extends pb_1.Message {
        #one_of_decls: number[][] = [];
        constructor(data?: any[] | {
            version?: number;
        }) {
            super();
            pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
            if (!Array.isArray(data) && typeof data == "object") {
                if ("version" in data && data.version != undefined) {
                    this.version = data.version;
                }
            }
        }
        get version() {
            return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
        }
        set version(value: number) {
            pb_1.Message.setField(this, 1, value);
        }
        static fromObject(data: {
            version?: number;
        }): VersionRequest {
            const message = new VersionRequest({});
            if (data.version != null) {
                message.version = data.version;
            }
            return message;
        }
        toObject() {
            const data: {
                version?: number;
            } = {};
            if (this.version != null) {
                data.version = this.version;
            }
            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.version != 0)
                writer.writeInt64(1, this.version);
            if (!w)
                return writer.getResultBuffer();
        }
        static deserialize(bytes: Uint8Array | pb_1.BinaryReader): VersionRequest {
            const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new VersionRequest();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    case 1:
                        message.version = reader.readInt64();
                        break;
                    default: reader.skipField();
                }
            }
            return message;
        }
        serializeBinary(): Uint8Array {
            return this.serialize();
        }
        static deserializeBinary(bytes: Uint8Array): VersionRequest {
            return VersionRequest.deserialize(bytes);
        }
    }
    export class SearchRequest extends pb_1.Message {
        #one_of_decls: number[][] = [];
        constructor(data?: any[] | {
            keyword?: 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 ("keyword" in data && data.keyword != undefined) {
                    this.keyword = data.keyword;
                }
            }
        }
        get keyword() {
            return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
        }
        set keyword(value: string) {
            pb_1.Message.setField(this, 1, value);
        }
        static fromObject(data: {
            keyword?: string;
        }): SearchRequest {
            const message = new SearchRequest({});
            if (data.keyword != null) {
                message.keyword = data.keyword;
            }
            return message;
        }
        toObject() {
            const data: {
                keyword?: string;
            } = {};
            if (this.keyword != null) {
                data.keyword = this.keyword;
            }
            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.keyword.length)
                writer.writeString(1, this.keyword);
            if (!w)
                return writer.getResultBuffer();
        }
        static deserialize(bytes: Uint8Array | pb_1.BinaryReader): SearchRequest {
            const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new SearchRequest();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    case 1:
                        message.keyword = reader.readString();
                        break;
                    default: reader.skipField();
                }
            }
            return message;
        }
        serializeBinary(): Uint8Array {
            return this.serialize();
        }
        static deserializeBinary(bytes: Uint8Array): SearchRequest {
            return SearchRequest.deserialize(bytes);
        }
    }
}
