"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
    if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
    return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.cache_client = void 0;
/**
 * Generated by the protoc-gen-ts.  DO NOT EDIT!
 * compiler version: 3.19.1
 * source: cachepubsub.proto
 * git: https://github.com/thesayyn/protoc-gen-ts */
const dependency_1 = __importStar(require("./common"));
const pb_1 = __importStar(require("google-protobuf"));
const grpc_1 = __importStar(require("@grpc/grpc-js"));
var cache_client;
(function (cache_client) {
    var pubsub;
    (function (pubsub) {
        var __PublishRequest_one_of_decls, __SubscriptionRequest_one_of_decls, __SubscriptionItem_one_of_decls, __TopicItem_one_of_decls, __TopicValue_one_of_decls, __Discontinuity_one_of_decls, __Heartbeat_one_of_decls;
        class _PublishRequest extends pb_1.Message {
            constructor(data) {
                super();
                __PublishRequest_one_of_decls.set(this, []);
                pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], __classPrivateFieldGet(this, __PublishRequest_one_of_decls, "f"));
                if (!Array.isArray(data) && typeof data == "object") {
                    if ("cache_name" in data && data.cache_name != undefined) {
                        this.cache_name = data.cache_name;
                    }
                    if ("topic" in data && data.topic != undefined) {
                        this.topic = data.topic;
                    }
                    if ("value" in data && data.value != undefined) {
                        this.value = data.value;
                    }
                }
            }
            get cache_name() {
                return pb_1.Message.getFieldWithDefault(this, 1, "");
            }
            set cache_name(value) {
                pb_1.Message.setField(this, 1, value);
            }
            get topic() {
                return pb_1.Message.getFieldWithDefault(this, 2, "");
            }
            set topic(value) {
                pb_1.Message.setField(this, 2, value);
            }
            get value() {
                return pb_1.Message.getWrapperField(this, _TopicValue, 3);
            }
            set value(value) {
                pb_1.Message.setWrapperField(this, 3, value);
            }
            get has_value() {
                return pb_1.Message.getField(this, 3) != null;
            }
            static fromObject(data) {
                const message = new _PublishRequest({});
                if (data.cache_name != null) {
                    message.cache_name = data.cache_name;
                }
                if (data.topic != null) {
                    message.topic = data.topic;
                }
                if (data.value != null) {
                    message.value = _TopicValue.fromObject(data.value);
                }
                return message;
            }
            toObject() {
                const data = {};
                if (this.cache_name != null) {
                    data.cache_name = this.cache_name;
                }
                if (this.topic != null) {
                    data.topic = this.topic;
                }
                if (this.value != null) {
                    data.value = this.value.toObject();
                }
                return data;
            }
            serialize(w) {
                const writer = w || new pb_1.BinaryWriter();
                if (this.cache_name.length)
                    writer.writeString(1, this.cache_name);
                if (this.topic.length)
                    writer.writeString(2, this.topic);
                if (this.has_value)
                    writer.writeMessage(3, this.value, () => this.value.serialize(writer));
                if (!w)
                    return writer.getResultBuffer();
            }
            static deserialize(bytes) {
                const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new _PublishRequest();
                while (reader.nextField()) {
                    if (reader.isEndGroup())
                        break;
                    switch (reader.getFieldNumber()) {
                        case 1:
                            message.cache_name = reader.readString();
                            break;
                        case 2:
                            message.topic = reader.readString();
                            break;
                        case 3:
                            reader.readMessage(message.value, () => message.value = _TopicValue.deserialize(reader));
                            break;
                        default: reader.skipField();
                    }
                }
                return message;
            }
            serializeBinary() {
                return this.serialize();
            }
            static deserializeBinary(bytes) {
                return _PublishRequest.deserialize(bytes);
            }
        }
        __PublishRequest_one_of_decls = new WeakMap();
        pubsub._PublishRequest = _PublishRequest;
        class _SubscriptionRequest extends pb_1.Message {
            constructor(data) {
                super();
                __SubscriptionRequest_one_of_decls.set(this, []);
                pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], __classPrivateFieldGet(this, __SubscriptionRequest_one_of_decls, "f"));
                if (!Array.isArray(data) && typeof data == "object") {
                    if ("cache_name" in data && data.cache_name != undefined) {
                        this.cache_name = data.cache_name;
                    }
                    if ("topic" in data && data.topic != undefined) {
                        this.topic = data.topic;
                    }
                    if ("resume_at_topic_sequence_number" in data && data.resume_at_topic_sequence_number != undefined) {
                        this.resume_at_topic_sequence_number = data.resume_at_topic_sequence_number;
                    }
                    if ("sequence_page" in data && data.sequence_page != undefined) {
                        this.sequence_page = data.sequence_page;
                    }
                }
            }
            get cache_name() {
                return pb_1.Message.getFieldWithDefault(this, 1, "");
            }
            set cache_name(value) {
                pb_1.Message.setField(this, 1, value);
            }
            get topic() {
                return pb_1.Message.getFieldWithDefault(this, 2, "");
            }
            set topic(value) {
                pb_1.Message.setField(this, 2, value);
            }
            get resume_at_topic_sequence_number() {
                return pb_1.Message.getFieldWithDefault(this, 3, 0);
            }
            set resume_at_topic_sequence_number(value) {
                pb_1.Message.setField(this, 3, value);
            }
            get sequence_page() {
                return pb_1.Message.getFieldWithDefault(this, 4, 0);
            }
            set sequence_page(value) {
                pb_1.Message.setField(this, 4, value);
            }
            static fromObject(data) {
                const message = new _SubscriptionRequest({});
                if (data.cache_name != null) {
                    message.cache_name = data.cache_name;
                }
                if (data.topic != null) {
                    message.topic = data.topic;
                }
                if (data.resume_at_topic_sequence_number != null) {
                    message.resume_at_topic_sequence_number = data.resume_at_topic_sequence_number;
                }
                if (data.sequence_page != null) {
                    message.sequence_page = data.sequence_page;
                }
                return message;
            }
            toObject() {
                const data = {};
                if (this.cache_name != null) {
                    data.cache_name = this.cache_name;
                }
                if (this.topic != null) {
                    data.topic = this.topic;
                }
                if (this.resume_at_topic_sequence_number != null) {
                    data.resume_at_topic_sequence_number = this.resume_at_topic_sequence_number;
                }
                if (this.sequence_page != null) {
                    data.sequence_page = this.sequence_page;
                }
                return data;
            }
            serialize(w) {
                const writer = w || new pb_1.BinaryWriter();
                if (this.cache_name.length)
                    writer.writeString(1, this.cache_name);
                if (this.topic.length)
                    writer.writeString(2, this.topic);
                if (this.resume_at_topic_sequence_number != 0)
                    writer.writeUint64(3, this.resume_at_topic_sequence_number);
                if (this.sequence_page != 0)
                    writer.writeUint64(4, this.sequence_page);
                if (!w)
                    return writer.getResultBuffer();
            }
            static deserialize(bytes) {
                const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new _SubscriptionRequest();
                while (reader.nextField()) {
                    if (reader.isEndGroup())
                        break;
                    switch (reader.getFieldNumber()) {
                        case 1:
                            message.cache_name = reader.readString();
                            break;
                        case 2:
                            message.topic = reader.readString();
                            break;
                        case 3:
                            message.resume_at_topic_sequence_number = reader.readUint64();
                            break;
                        case 4:
                            message.sequence_page = reader.readUint64();
                            break;
                        default: reader.skipField();
                    }
                }
                return message;
            }
            serializeBinary() {
                return this.serialize();
            }
            static deserializeBinary(bytes) {
                return _SubscriptionRequest.deserialize(bytes);
            }
        }
        __SubscriptionRequest_one_of_decls = new WeakMap();
        pubsub._SubscriptionRequest = _SubscriptionRequest;
        class _SubscriptionItem extends pb_1.Message {
            constructor(data) {
                super();
                __SubscriptionItem_one_of_decls.set(this, [[1, 2, 3]]);
                pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], __classPrivateFieldGet(this, __SubscriptionItem_one_of_decls, "f"));
                if (!Array.isArray(data) && typeof data == "object") {
                    if ("item" in data && data.item != undefined) {
                        this.item = data.item;
                    }
                    if ("discontinuity" in data && data.discontinuity != undefined) {
                        this.discontinuity = data.discontinuity;
                    }
                    if ("heartbeat" in data && data.heartbeat != undefined) {
                        this.heartbeat = data.heartbeat;
                    }
                }
            }
            get item() {
                return pb_1.Message.getWrapperField(this, _TopicItem, 1);
            }
            set item(value) {
                pb_1.Message.setOneofWrapperField(this, 1, __classPrivateFieldGet(this, __SubscriptionItem_one_of_decls, "f")[0], value);
            }
            get has_item() {
                return pb_1.Message.getField(this, 1) != null;
            }
            get discontinuity() {
                return pb_1.Message.getWrapperField(this, _Discontinuity, 2);
            }
            set discontinuity(value) {
                pb_1.Message.setOneofWrapperField(this, 2, __classPrivateFieldGet(this, __SubscriptionItem_one_of_decls, "f")[0], value);
            }
            get has_discontinuity() {
                return pb_1.Message.getField(this, 2) != null;
            }
            get heartbeat() {
                return pb_1.Message.getWrapperField(this, _Heartbeat, 3);
            }
            set heartbeat(value) {
                pb_1.Message.setOneofWrapperField(this, 3, __classPrivateFieldGet(this, __SubscriptionItem_one_of_decls, "f")[0], value);
            }
            get has_heartbeat() {
                return pb_1.Message.getField(this, 3) != null;
            }
            get kind() {
                const cases = {
                    0: "none",
                    1: "item",
                    2: "discontinuity",
                    3: "heartbeat"
                };
                return cases[pb_1.Message.computeOneofCase(this, [1, 2, 3])];
            }
            static fromObject(data) {
                const message = new _SubscriptionItem({});
                if (data.item != null) {
                    message.item = _TopicItem.fromObject(data.item);
                }
                if (data.discontinuity != null) {
                    message.discontinuity = _Discontinuity.fromObject(data.discontinuity);
                }
                if (data.heartbeat != null) {
                    message.heartbeat = _Heartbeat.fromObject(data.heartbeat);
                }
                return message;
            }
            toObject() {
                const data = {};
                if (this.item != null) {
                    data.item = this.item.toObject();
                }
                if (this.discontinuity != null) {
                    data.discontinuity = this.discontinuity.toObject();
                }
                if (this.heartbeat != null) {
                    data.heartbeat = this.heartbeat.toObject();
                }
                return data;
            }
            serialize(w) {
                const writer = w || new pb_1.BinaryWriter();
                if (this.has_item)
                    writer.writeMessage(1, this.item, () => this.item.serialize(writer));
                if (this.has_discontinuity)
                    writer.writeMessage(2, this.discontinuity, () => this.discontinuity.serialize(writer));
                if (this.has_heartbeat)
                    writer.writeMessage(3, this.heartbeat, () => this.heartbeat.serialize(writer));
                if (!w)
                    return writer.getResultBuffer();
            }
            static deserialize(bytes) {
                const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new _SubscriptionItem();
                while (reader.nextField()) {
                    if (reader.isEndGroup())
                        break;
                    switch (reader.getFieldNumber()) {
                        case 1:
                            reader.readMessage(message.item, () => message.item = _TopicItem.deserialize(reader));
                            break;
                        case 2:
                            reader.readMessage(message.discontinuity, () => message.discontinuity = _Discontinuity.deserialize(reader));
                            break;
                        case 3:
                            reader.readMessage(message.heartbeat, () => message.heartbeat = _Heartbeat.deserialize(reader));
                            break;
                        default: reader.skipField();
                    }
                }
                return message;
            }
            serializeBinary() {
                return this.serialize();
            }
            static deserializeBinary(bytes) {
                return _SubscriptionItem.deserialize(bytes);
            }
        }
        __SubscriptionItem_one_of_decls = new WeakMap();
        pubsub._SubscriptionItem = _SubscriptionItem;
        class _TopicItem extends pb_1.Message {
            constructor(data) {
                super();
                __TopicItem_one_of_decls.set(this, []);
                pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], __classPrivateFieldGet(this, __TopicItem_one_of_decls, "f"));
                if (!Array.isArray(data) && typeof data == "object") {
                    if ("topic_sequence_number" in data && data.topic_sequence_number != undefined) {
                        this.topic_sequence_number = data.topic_sequence_number;
                    }
                    if ("value" in data && data.value != undefined) {
                        this.value = data.value;
                    }
                    if ("publisher_id" in data && data.publisher_id != undefined) {
                        this.publisher_id = data.publisher_id;
                    }
                    if ("sequence_page" in data && data.sequence_page != undefined) {
                        this.sequence_page = data.sequence_page;
                    }
                }
            }
            get topic_sequence_number() {
                return pb_1.Message.getFieldWithDefault(this, 1, 0);
            }
            set topic_sequence_number(value) {
                pb_1.Message.setField(this, 1, value);
            }
            get value() {
                return pb_1.Message.getWrapperField(this, _TopicValue, 2);
            }
            set value(value) {
                pb_1.Message.setWrapperField(this, 2, value);
            }
            get has_value() {
                return pb_1.Message.getField(this, 2) != null;
            }
            get publisher_id() {
                return pb_1.Message.getFieldWithDefault(this, 3, "");
            }
            set publisher_id(value) {
                pb_1.Message.setField(this, 3, value);
            }
            get sequence_page() {
                return pb_1.Message.getFieldWithDefault(this, 4, 0);
            }
            set sequence_page(value) {
                pb_1.Message.setField(this, 4, value);
            }
            static fromObject(data) {
                const message = new _TopicItem({});
                if (data.topic_sequence_number != null) {
                    message.topic_sequence_number = data.topic_sequence_number;
                }
                if (data.value != null) {
                    message.value = _TopicValue.fromObject(data.value);
                }
                if (data.publisher_id != null) {
                    message.publisher_id = data.publisher_id;
                }
                if (data.sequence_page != null) {
                    message.sequence_page = data.sequence_page;
                }
                return message;
            }
            toObject() {
                const data = {};
                if (this.topic_sequence_number != null) {
                    data.topic_sequence_number = this.topic_sequence_number;
                }
                if (this.value != null) {
                    data.value = this.value.toObject();
                }
                if (this.publisher_id != null) {
                    data.publisher_id = this.publisher_id;
                }
                if (this.sequence_page != null) {
                    data.sequence_page = this.sequence_page;
                }
                return data;
            }
            serialize(w) {
                const writer = w || new pb_1.BinaryWriter();
                if (this.topic_sequence_number != 0)
                    writer.writeUint64(1, this.topic_sequence_number);
                if (this.has_value)
                    writer.writeMessage(2, this.value, () => this.value.serialize(writer));
                if (this.publisher_id.length)
                    writer.writeString(3, this.publisher_id);
                if (this.sequence_page != 0)
                    writer.writeUint64(4, this.sequence_page);
                if (!w)
                    return writer.getResultBuffer();
            }
            static deserialize(bytes) {
                const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new _TopicItem();
                while (reader.nextField()) {
                    if (reader.isEndGroup())
                        break;
                    switch (reader.getFieldNumber()) {
                        case 1:
                            message.topic_sequence_number = reader.readUint64();
                            break;
                        case 2:
                            reader.readMessage(message.value, () => message.value = _TopicValue.deserialize(reader));
                            break;
                        case 3:
                            message.publisher_id = reader.readString();
                            break;
                        case 4:
                            message.sequence_page = reader.readUint64();
                            break;
                        default: reader.skipField();
                    }
                }
                return message;
            }
            serializeBinary() {
                return this.serialize();
            }
            static deserializeBinary(bytes) {
                return _TopicItem.deserialize(bytes);
            }
        }
        __TopicItem_one_of_decls = new WeakMap();
        pubsub._TopicItem = _TopicItem;
        class _TopicValue extends pb_1.Message {
            constructor(data) {
                super();
                __TopicValue_one_of_decls.set(this, [[1, 2]]);
                pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], __classPrivateFieldGet(this, __TopicValue_one_of_decls, "f"));
                if (!Array.isArray(data) && typeof data == "object") {
                    if ("text" in data && data.text != undefined) {
                        this.text = data.text;
                    }
                    if ("binary" in data && data.binary != undefined) {
                        this.binary = data.binary;
                    }
                }
            }
            get text() {
                return pb_1.Message.getFieldWithDefault(this, 1, "");
            }
            set text(value) {
                pb_1.Message.setOneofField(this, 1, __classPrivateFieldGet(this, __TopicValue_one_of_decls, "f")[0], value);
            }
            get has_text() {
                return pb_1.Message.getField(this, 1) != null;
            }
            get binary() {
                return pb_1.Message.getFieldWithDefault(this, 2, new Uint8Array(0));
            }
            set binary(value) {
                pb_1.Message.setOneofField(this, 2, __classPrivateFieldGet(this, __TopicValue_one_of_decls, "f")[0], value);
            }
            get has_binary() {
                return pb_1.Message.getField(this, 2) != null;
            }
            get kind() {
                const cases = {
                    0: "none",
                    1: "text",
                    2: "binary"
                };
                return cases[pb_1.Message.computeOneofCase(this, [1, 2])];
            }
            static fromObject(data) {
                const message = new _TopicValue({});
                if (data.text != null) {
                    message.text = data.text;
                }
                if (data.binary != null) {
                    message.binary = data.binary;
                }
                return message;
            }
            toObject() {
                const data = {};
                if (this.text != null) {
                    data.text = this.text;
                }
                if (this.binary != null) {
                    data.binary = this.binary;
                }
                return data;
            }
            serialize(w) {
                const writer = w || new pb_1.BinaryWriter();
                if (this.has_text)
                    writer.writeString(1, this.text);
                if (this.has_binary)
                    writer.writeBytes(2, this.binary);
                if (!w)
                    return writer.getResultBuffer();
            }
            static deserialize(bytes) {
                const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new _TopicValue();
                while (reader.nextField()) {
                    if (reader.isEndGroup())
                        break;
                    switch (reader.getFieldNumber()) {
                        case 1:
                            message.text = reader.readString();
                            break;
                        case 2:
                            message.binary = reader.readBytes();
                            break;
                        default: reader.skipField();
                    }
                }
                return message;
            }
            serializeBinary() {
                return this.serialize();
            }
            static deserializeBinary(bytes) {
                return _TopicValue.deserialize(bytes);
            }
        }
        __TopicValue_one_of_decls = new WeakMap();
        pubsub._TopicValue = _TopicValue;
        class _Discontinuity extends pb_1.Message {
            constructor(data) {
                super();
                __Discontinuity_one_of_decls.set(this, []);
                pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], __classPrivateFieldGet(this, __Discontinuity_one_of_decls, "f"));
                if (!Array.isArray(data) && typeof data == "object") {
                    if ("last_topic_sequence" in data && data.last_topic_sequence != undefined) {
                        this.last_topic_sequence = data.last_topic_sequence;
                    }
                    if ("new_topic_sequence" in data && data.new_topic_sequence != undefined) {
                        this.new_topic_sequence = data.new_topic_sequence;
                    }
                    if ("new_sequence_page" in data && data.new_sequence_page != undefined) {
                        this.new_sequence_page = data.new_sequence_page;
                    }
                }
            }
            get last_topic_sequence() {
                return pb_1.Message.getFieldWithDefault(this, 1, 0);
            }
            set last_topic_sequence(value) {
                pb_1.Message.setField(this, 1, value);
            }
            get new_topic_sequence() {
                return pb_1.Message.getFieldWithDefault(this, 2, 0);
            }
            set new_topic_sequence(value) {
                pb_1.Message.setField(this, 2, value);
            }
            get new_sequence_page() {
                return pb_1.Message.getFieldWithDefault(this, 3, 0);
            }
            set new_sequence_page(value) {
                pb_1.Message.setField(this, 3, value);
            }
            static fromObject(data) {
                const message = new _Discontinuity({});
                if (data.last_topic_sequence != null) {
                    message.last_topic_sequence = data.last_topic_sequence;
                }
                if (data.new_topic_sequence != null) {
                    message.new_topic_sequence = data.new_topic_sequence;
                }
                if (data.new_sequence_page != null) {
                    message.new_sequence_page = data.new_sequence_page;
                }
                return message;
            }
            toObject() {
                const data = {};
                if (this.last_topic_sequence != null) {
                    data.last_topic_sequence = this.last_topic_sequence;
                }
                if (this.new_topic_sequence != null) {
                    data.new_topic_sequence = this.new_topic_sequence;
                }
                if (this.new_sequence_page != null) {
                    data.new_sequence_page = this.new_sequence_page;
                }
                return data;
            }
            serialize(w) {
                const writer = w || new pb_1.BinaryWriter();
                if (this.last_topic_sequence != 0)
                    writer.writeUint64(1, this.last_topic_sequence);
                if (this.new_topic_sequence != 0)
                    writer.writeUint64(2, this.new_topic_sequence);
                if (this.new_sequence_page != 0)
                    writer.writeUint64(3, this.new_sequence_page);
                if (!w)
                    return writer.getResultBuffer();
            }
            static deserialize(bytes) {
                const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new _Discontinuity();
                while (reader.nextField()) {
                    if (reader.isEndGroup())
                        break;
                    switch (reader.getFieldNumber()) {
                        case 1:
                            message.last_topic_sequence = reader.readUint64();
                            break;
                        case 2:
                            message.new_topic_sequence = reader.readUint64();
                            break;
                        case 3:
                            message.new_sequence_page = reader.readUint64();
                            break;
                        default: reader.skipField();
                    }
                }
                return message;
            }
            serializeBinary() {
                return this.serialize();
            }
            static deserializeBinary(bytes) {
                return _Discontinuity.deserialize(bytes);
            }
        }
        __Discontinuity_one_of_decls = new WeakMap();
        pubsub._Discontinuity = _Discontinuity;
        class _Heartbeat extends pb_1.Message {
            constructor(data) {
                super();
                __Heartbeat_one_of_decls.set(this, []);
                pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], __classPrivateFieldGet(this, __Heartbeat_one_of_decls, "f"));
                if (!Array.isArray(data) && typeof data == "object") { }
            }
            static fromObject(data) {
                const message = new _Heartbeat({});
                return message;
            }
            toObject() {
                const data = {};
                return data;
            }
            serialize(w) {
                const writer = w || new pb_1.BinaryWriter();
                if (!w)
                    return writer.getResultBuffer();
            }
            static deserialize(bytes) {
                const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new _Heartbeat();
                while (reader.nextField()) {
                    if (reader.isEndGroup())
                        break;
                    switch (reader.getFieldNumber()) {
                        default: reader.skipField();
                    }
                }
                return message;
            }
            serializeBinary() {
                return this.serialize();
            }
            static deserializeBinary(bytes) {
                return _Heartbeat.deserialize(bytes);
            }
        }
        __Heartbeat_one_of_decls = new WeakMap();
        pubsub._Heartbeat = _Heartbeat;
        class UnimplementedPubsubService {
        }
        UnimplementedPubsubService.definition = {
            Publish: {
                path: "/cache_client.pubsub.Pubsub/Publish",
                requestStream: false,
                responseStream: false,
                requestSerialize: (message) => Buffer.from(message.serialize()),
                requestDeserialize: (bytes) => _PublishRequest.deserialize(new Uint8Array(bytes)),
                responseSerialize: (message) => Buffer.from(message.serialize()),
                responseDeserialize: (bytes) => dependency_1.common._Empty.deserialize(new Uint8Array(bytes))
            },
            Subscribe: {
                path: "/cache_client.pubsub.Pubsub/Subscribe",
                requestStream: false,
                responseStream: true,
                requestSerialize: (message) => Buffer.from(message.serialize()),
                requestDeserialize: (bytes) => _SubscriptionRequest.deserialize(new Uint8Array(bytes)),
                responseSerialize: (message) => Buffer.from(message.serialize()),
                responseDeserialize: (bytes) => _SubscriptionItem.deserialize(new Uint8Array(bytes))
            }
        };
        pubsub.UnimplementedPubsubService = UnimplementedPubsubService;
        class PubsubClient extends grpc_1.makeGenericClientConstructor(UnimplementedPubsubService.definition, "Pubsub", {}) {
            constructor(address, credentials, options) {
                super(address, credentials, options);
                this.Publish = (message, metadata, options, callback) => {
                    return super.Publish(message, metadata, options, callback);
                };
                this.Subscribe = (message, metadata, options) => {
                    return super.Subscribe(message, metadata, options);
                };
            }
        }
        pubsub.PubsubClient = PubsubClient;
    })(pubsub = cache_client.pubsub || (cache_client.pubsub = {}));
})(cache_client = exports.cache_client || (exports.cache_client = {}));
