/**
 * Generated by the protoc-gen-ts.  DO NOT EDIT!
 * compiler version: 0.0.0
 * source: notice.proto
 * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./blocks";
import * as pb_1 from "google-protobuf";
import * as grpc_1 from "@grpc/grpc-js";
export namespace mall {
    export class NoticeListReply extends pb_1.Message {
        #one_of_decls: number[][] = [];
        constructor(data?: any[] | {
            data?: NoticeItem[];
            count?: number;
        }) {
            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 ("data" in data && data.data != undefined) {
                    this.data = data.data;
                }
                if ("count" in data && data.count != undefined) {
                    this.count = data.count;
                }
            }
        }
        get data() {
            return pb_1.Message.getRepeatedWrapperField(this, NoticeItem, 1) as NoticeItem[];
        }
        set data(value: NoticeItem[]) {
            pb_1.Message.setRepeatedWrapperField(this, 1, value);
        }
        get count() {
            return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
        }
        set count(value: number) {
            pb_1.Message.setField(this, 2, value);
        }
        static fromObject(data: {
            data?: ReturnType<typeof NoticeItem.prototype.toObject>[];
            count?: number;
        }): NoticeListReply {
            const message = new NoticeListReply({});
            if (data.data != null) {
                message.data = data.data.map(item => NoticeItem.fromObject(item));
            }
            if (data.count != null) {
                message.count = data.count;
            }
            return message;
        }
        toObject() {
            const data: {
                data?: ReturnType<typeof NoticeItem.prototype.toObject>[];
                count?: number;
            } = {};
            if (this.data != null) {
                data.data = this.data.map((item: NoticeItem) => item.toObject());
            }
            if (this.count != null) {
                data.count = this.count;
            }
            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.data.length)
                writer.writeRepeatedMessage(1, this.data, (item: NoticeItem) => item.serialize(writer));
            if (this.count != 0)
                writer.writeInt64(2, this.count);
            if (!w)
                return writer.getResultBuffer();
        }
        static deserialize(bytes: Uint8Array | pb_1.BinaryReader): NoticeListReply {
            const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new NoticeListReply();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    case 1:
                        reader.readMessage(message.data, () => pb_1.Message.addToRepeatedWrapperField(message, 1, NoticeItem.deserialize(reader), NoticeItem));
                        break;
                    case 2:
                        message.count = reader.readInt64();
                        break;
                    default: reader.skipField();
                }
            }
            return message;
        }
        serializeBinary(): Uint8Array {
            return this.serialize();
        }
        static deserializeBinary(bytes: Uint8Array): NoticeListReply {
            return NoticeListReply.deserialize(bytes);
        }
    }
    export class NoticeItem extends pb_1.Message {
        #one_of_decls: number[][] = [];
        constructor(data?: any[] | {
            identity?: string;
            title?: string;
            content?: string;
            author?: string;
            store_id?: number;
            store_identity?: string;
            created_at?: string;
            status?: 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 ("identity" in data && data.identity != undefined) {
                    this.identity = data.identity;
                }
                if ("title" in data && data.title != undefined) {
                    this.title = data.title;
                }
                if ("content" in data && data.content != undefined) {
                    this.content = data.content;
                }
                if ("author" in data && data.author != undefined) {
                    this.author = data.author;
                }
                if ("store_id" in data && data.store_id != undefined) {
                    this.store_id = data.store_id;
                }
                if ("store_identity" in data && data.store_identity != undefined) {
                    this.store_identity = data.store_identity;
                }
                if ("created_at" in data && data.created_at != undefined) {
                    this.created_at = data.created_at;
                }
                if ("status" in data && data.status != undefined) {
                    this.status = data.status;
                }
            }
        }
        get identity() {
            return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
        }
        set identity(value: string) {
            pb_1.Message.setField(this, 1, value);
        }
        get title() {
            return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
        }
        set title(value: string) {
            pb_1.Message.setField(this, 2, value);
        }
        get content() {
            return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
        }
        set content(value: string) {
            pb_1.Message.setField(this, 3, value);
        }
        get author() {
            return pb_1.Message.getFieldWithDefault(this, 4, "") as string;
        }
        set author(value: string) {
            pb_1.Message.setField(this, 4, value);
        }
        get store_id() {
            return pb_1.Message.getFieldWithDefault(this, 5, 0) as number;
        }
        set store_id(value: number) {
            pb_1.Message.setField(this, 5, value);
        }
        get store_identity() {
            return pb_1.Message.getFieldWithDefault(this, 6, "") as string;
        }
        set store_identity(value: string) {
            pb_1.Message.setField(this, 6, value);
        }
        get created_at() {
            return pb_1.Message.getFieldWithDefault(this, 7, "") as string;
        }
        set created_at(value: string) {
            pb_1.Message.setField(this, 7, value);
        }
        get status() {
            return pb_1.Message.getFieldWithDefault(this, 8, 0) as number;
        }
        set status(value: number) {
            pb_1.Message.setField(this, 8, value);
        }
        static fromObject(data: {
            identity?: string;
            title?: string;
            content?: string;
            author?: string;
            store_id?: number;
            store_identity?: string;
            created_at?: string;
            status?: number;
        }): NoticeItem {
            const message = new NoticeItem({});
            if (data.identity != null) {
                message.identity = data.identity;
            }
            if (data.title != null) {
                message.title = data.title;
            }
            if (data.content != null) {
                message.content = data.content;
            }
            if (data.author != null) {
                message.author = data.author;
            }
            if (data.store_id != null) {
                message.store_id = data.store_id;
            }
            if (data.store_identity != null) {
                message.store_identity = data.store_identity;
            }
            if (data.created_at != null) {
                message.created_at = data.created_at;
            }
            if (data.status != null) {
                message.status = data.status;
            }
            return message;
        }
        toObject() {
            const data: {
                identity?: string;
                title?: string;
                content?: string;
                author?: string;
                store_id?: number;
                store_identity?: string;
                created_at?: string;
                status?: number;
            } = {};
            if (this.identity != null) {
                data.identity = this.identity;
            }
            if (this.title != null) {
                data.title = this.title;
            }
            if (this.content != null) {
                data.content = this.content;
            }
            if (this.author != null) {
                data.author = this.author;
            }
            if (this.store_id != null) {
                data.store_id = this.store_id;
            }
            if (this.store_identity != null) {
                data.store_identity = this.store_identity;
            }
            if (this.created_at != null) {
                data.created_at = this.created_at;
            }
            if (this.status != null) {
                data.status = this.status;
            }
            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.identity.length)
                writer.writeString(1, this.identity);
            if (this.title.length)
                writer.writeString(2, this.title);
            if (this.content.length)
                writer.writeString(3, this.content);
            if (this.author.length)
                writer.writeString(4, this.author);
            if (this.store_id != 0)
                writer.writeInt64(5, this.store_id);
            if (this.store_identity.length)
                writer.writeString(6, this.store_identity);
            if (this.created_at.length)
                writer.writeString(7, this.created_at);
            if (this.status != 0)
                writer.writeInt64(8, this.status);
            if (!w)
                return writer.getResultBuffer();
        }
        static deserialize(bytes: Uint8Array | pb_1.BinaryReader): NoticeItem {
            const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new NoticeItem();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    case 1:
                        message.identity = reader.readString();
                        break;
                    case 2:
                        message.title = reader.readString();
                        break;
                    case 3:
                        message.content = reader.readString();
                        break;
                    case 4:
                        message.author = reader.readString();
                        break;
                    case 5:
                        message.store_id = reader.readInt64();
                        break;
                    case 6:
                        message.store_identity = reader.readString();
                        break;
                    case 7:
                        message.created_at = reader.readString();
                        break;
                    case 8:
                        message.status = reader.readInt64();
                        break;
                    default: reader.skipField();
                }
            }
            return message;
        }
        serializeBinary(): Uint8Array {
            return this.serialize();
        }
        static deserializeBinary(bytes: Uint8Array): NoticeItem {
            return NoticeItem.deserialize(bytes);
        }
    }
    interface GrpcUnaryServiceInterface<P, R> {
        (message: P, metadata: grpc_1.Metadata, options: grpc_1.CallOptions, callback: grpc_1.requestCallback<R>): grpc_1.ClientUnaryCall;
        (message: P, metadata: grpc_1.Metadata, callback: grpc_1.requestCallback<R>): grpc_1.ClientUnaryCall;
        (message: P, options: grpc_1.CallOptions, callback: grpc_1.requestCallback<R>): grpc_1.ClientUnaryCall;
        (message: P, callback: grpc_1.requestCallback<R>): grpc_1.ClientUnaryCall;
    }
    interface GrpcStreamServiceInterface<P, R> {
        (message: P, metadata: grpc_1.Metadata, options?: grpc_1.CallOptions): grpc_1.ClientReadableStream<R>;
        (message: P, options?: grpc_1.CallOptions): grpc_1.ClientReadableStream<R>;
    }
    interface GrpWritableServiceInterface<P, R> {
        (metadata: grpc_1.Metadata, options: grpc_1.CallOptions, callback: grpc_1.requestCallback<R>): grpc_1.ClientWritableStream<P>;
        (metadata: grpc_1.Metadata, callback: grpc_1.requestCallback<R>): grpc_1.ClientWritableStream<P>;
        (options: grpc_1.CallOptions, callback: grpc_1.requestCallback<R>): grpc_1.ClientWritableStream<P>;
        (callback: grpc_1.requestCallback<R>): grpc_1.ClientWritableStream<P>;
    }
    interface GrpcChunkServiceInterface<P, R> {
        (metadata: grpc_1.Metadata, options?: grpc_1.CallOptions): grpc_1.ClientDuplexStream<P, R>;
        (options?: grpc_1.CallOptions): grpc_1.ClientDuplexStream<P, R>;
    }
    interface GrpcPromiseServiceInterface<P, R> {
        (message: P, metadata: grpc_1.Metadata, options?: grpc_1.CallOptions): Promise<R>;
        (message: P, options?: grpc_1.CallOptions): Promise<R>;
    }
    export abstract class UnimplementedNoticeService {
        static definition = {
            Fetch: {
                path: "/mall.Notice/Fetch",
                requestStream: false,
                responseStream: false,
                requestSerialize: (message: dependency_1.mall.FetchRequest) => Buffer.from(message.serialize()),
                requestDeserialize: (bytes: Buffer) => dependency_1.mall.FetchRequest.deserialize(new Uint8Array(bytes)),
                responseSerialize: (message: NoticeListReply) => Buffer.from(message.serialize()),
                responseDeserialize: (bytes: Buffer) => NoticeListReply.deserialize(new Uint8Array(bytes))
            },
            Create: {
                path: "/mall.Notice/Create",
                requestStream: false,
                responseStream: false,
                requestSerialize: (message: NoticeItem) => Buffer.from(message.serialize()),
                requestDeserialize: (bytes: Buffer) => NoticeItem.deserialize(new Uint8Array(bytes)),
                responseSerialize: (message: dependency_1.mall.StatusReply) => Buffer.from(message.serialize()),
                responseDeserialize: (bytes: Buffer) => dependency_1.mall.StatusReply.deserialize(new Uint8Array(bytes))
            },
            Modify: {
                path: "/mall.Notice/Modify",
                requestStream: false,
                responseStream: false,
                requestSerialize: (message: NoticeItem) => Buffer.from(message.serialize()),
                requestDeserialize: (bytes: Buffer) => NoticeItem.deserialize(new Uint8Array(bytes)),
                responseSerialize: (message: dependency_1.mall.StatusReply) => Buffer.from(message.serialize()),
                responseDeserialize: (bytes: Buffer) => dependency_1.mall.StatusReply.deserialize(new Uint8Array(bytes))
            },
            Delete: {
                path: "/mall.Notice/Delete",
                requestStream: false,
                responseStream: false,
                requestSerialize: (message: dependency_1.mall.IdentRequest) => Buffer.from(message.serialize()),
                requestDeserialize: (bytes: Buffer) => dependency_1.mall.IdentRequest.deserialize(new Uint8Array(bytes)),
                responseSerialize: (message: dependency_1.mall.StatusReply) => Buffer.from(message.serialize()),
                responseDeserialize: (bytes: Buffer) => dependency_1.mall.StatusReply.deserialize(new Uint8Array(bytes))
            }
        };
        [method: string]: grpc_1.UntypedHandleCall;
        abstract Fetch(call: grpc_1.ServerUnaryCall<dependency_1.mall.FetchRequest, NoticeListReply>, callback: grpc_1.sendUnaryData<NoticeListReply>): void;
        abstract Create(call: grpc_1.ServerUnaryCall<NoticeItem, dependency_1.mall.StatusReply>, callback: grpc_1.sendUnaryData<dependency_1.mall.StatusReply>): void;
        abstract Modify(call: grpc_1.ServerUnaryCall<NoticeItem, dependency_1.mall.StatusReply>, callback: grpc_1.sendUnaryData<dependency_1.mall.StatusReply>): void;
        abstract Delete(call: grpc_1.ServerUnaryCall<dependency_1.mall.IdentRequest, dependency_1.mall.StatusReply>, callback: grpc_1.sendUnaryData<dependency_1.mall.StatusReply>): void;
    }
    export class NoticeClient extends grpc_1.makeGenericClientConstructor(UnimplementedNoticeService.definition, "Notice", {}) {
        constructor(address: string, credentials: grpc_1.ChannelCredentials, options?: Partial<grpc_1.ChannelOptions>) {
            super(address, credentials, options);
        }
        Fetch: GrpcUnaryServiceInterface<dependency_1.mall.FetchRequest, NoticeListReply> = (message: dependency_1.mall.FetchRequest, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback<NoticeListReply>, options?: grpc_1.CallOptions | grpc_1.requestCallback<NoticeListReply>, callback?: grpc_1.requestCallback<NoticeListReply>): grpc_1.ClientUnaryCall => {
            return super.Fetch(message, metadata, options, callback);
        };
        Create: GrpcUnaryServiceInterface<NoticeItem, dependency_1.mall.StatusReply> = (message: NoticeItem, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback<dependency_1.mall.StatusReply>, options?: grpc_1.CallOptions | grpc_1.requestCallback<dependency_1.mall.StatusReply>, callback?: grpc_1.requestCallback<dependency_1.mall.StatusReply>): grpc_1.ClientUnaryCall => {
            return super.Create(message, metadata, options, callback);
        };
        Modify: GrpcUnaryServiceInterface<NoticeItem, dependency_1.mall.StatusReply> = (message: NoticeItem, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback<dependency_1.mall.StatusReply>, options?: grpc_1.CallOptions | grpc_1.requestCallback<dependency_1.mall.StatusReply>, callback?: grpc_1.requestCallback<dependency_1.mall.StatusReply>): grpc_1.ClientUnaryCall => {
            return super.Modify(message, metadata, options, callback);
        };
        Delete: GrpcUnaryServiceInterface<dependency_1.mall.IdentRequest, dependency_1.mall.StatusReply> = (message: dependency_1.mall.IdentRequest, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback<dependency_1.mall.StatusReply>, options?: grpc_1.CallOptions | grpc_1.requestCallback<dependency_1.mall.StatusReply>, callback?: grpc_1.requestCallback<dependency_1.mall.StatusReply>): grpc_1.ClientUnaryCall => {
            return super.Delete(message, metadata, options, callback);
        };
    }
}
