"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.webhook = void 0;
/**
 * Generated by the protoc-gen-ts.  DO NOT EDIT!
 * compiler version: 3.19.1
 * source: webhook.proto
 * git: https://github.com/thesayyn/protoc-gen-ts */
const pb_1 = __importStar(require("google-protobuf"));
const grpc_1 = __importStar(require("@grpc/grpc-js"));
var webhook;
(function (webhook) {
    var __WebhookId_one_of_decls, __Webhook_one_of_decls, __PutWebhookRequest_one_of_decls, __PutWebhookResponse_one_of_decls, __DeleteWebhookRequest_one_of_decls, __DeleteWebhookResponse_one_of_decls, __ListWebhookRequest_one_of_decls, __ListWebhooksResponse_one_of_decls, __GetWebhookSecretRequest_one_of_decls, __GetWebhookSecretResponse_one_of_decls, __WebhookDestination_one_of_decls, __RotateWebhookSecretRequest_one_of_decls, __RotateWebhookSecretResponse_one_of_decls;
    class _WebhookId extends pb_1.Message {
        constructor(data) {
            super();
            __WebhookId_one_of_decls.set(this, []);
            pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], __classPrivateFieldGet(this, __WebhookId_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 ("webhook_name" in data && data.webhook_name != undefined) {
                    this.webhook_name = data.webhook_name;
                }
            }
        }
        get cache_name() {
            return pb_1.Message.getFieldWithDefault(this, 1, "");
        }
        set cache_name(value) {
            pb_1.Message.setField(this, 1, value);
        }
        get webhook_name() {
            return pb_1.Message.getFieldWithDefault(this, 2, "");
        }
        set webhook_name(value) {
            pb_1.Message.setField(this, 2, value);
        }
        static fromObject(data) {
            const message = new _WebhookId({});
            if (data.cache_name != null) {
                message.cache_name = data.cache_name;
            }
            if (data.webhook_name != null) {
                message.webhook_name = data.webhook_name;
            }
            return message;
        }
        toObject() {
            const data = {};
            if (this.cache_name != null) {
                data.cache_name = this.cache_name;
            }
            if (this.webhook_name != null) {
                data.webhook_name = this.webhook_name;
            }
            return data;
        }
        serialize(w) {
            const writer = w || new pb_1.BinaryWriter();
            if (this.cache_name.length)
                writer.writeString(1, this.cache_name);
            if (this.webhook_name.length)
                writer.writeString(2, this.webhook_name);
            if (!w)
                return writer.getResultBuffer();
        }
        static deserialize(bytes) {
            const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new _WebhookId();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    case 1:
                        message.cache_name = reader.readString();
                        break;
                    case 2:
                        message.webhook_name = reader.readString();
                        break;
                    default: reader.skipField();
                }
            }
            return message;
        }
        serializeBinary() {
            return this.serialize();
        }
        static deserializeBinary(bytes) {
            return _WebhookId.deserialize(bytes);
        }
    }
    __WebhookId_one_of_decls = new WeakMap();
    webhook._WebhookId = _WebhookId;
    class _Webhook extends pb_1.Message {
        constructor(data) {
            super();
            __Webhook_one_of_decls.set(this, []);
            pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], __classPrivateFieldGet(this, __Webhook_one_of_decls, "f"));
            if (!Array.isArray(data) && typeof data == "object") {
                if ("webhook_id" in data && data.webhook_id != undefined) {
                    this.webhook_id = data.webhook_id;
                }
                if ("topic_name" in data && data.topic_name != undefined) {
                    this.topic_name = data.topic_name;
                }
                if ("destination" in data && data.destination != undefined) {
                    this.destination = data.destination;
                }
            }
        }
        get webhook_id() {
            return pb_1.Message.getWrapperField(this, _WebhookId, 1);
        }
        set webhook_id(value) {
            pb_1.Message.setWrapperField(this, 1, value);
        }
        get has_webhook_id() {
            return pb_1.Message.getField(this, 1) != null;
        }
        get topic_name() {
            return pb_1.Message.getFieldWithDefault(this, 2, "");
        }
        set topic_name(value) {
            pb_1.Message.setField(this, 2, value);
        }
        get destination() {
            return pb_1.Message.getWrapperField(this, _WebhookDestination, 3);
        }
        set destination(value) {
            pb_1.Message.setWrapperField(this, 3, value);
        }
        get has_destination() {
            return pb_1.Message.getField(this, 3) != null;
        }
        static fromObject(data) {
            const message = new _Webhook({});
            if (data.webhook_id != null) {
                message.webhook_id = _WebhookId.fromObject(data.webhook_id);
            }
            if (data.topic_name != null) {
                message.topic_name = data.topic_name;
            }
            if (data.destination != null) {
                message.destination = _WebhookDestination.fromObject(data.destination);
            }
            return message;
        }
        toObject() {
            const data = {};
            if (this.webhook_id != null) {
                data.webhook_id = this.webhook_id.toObject();
            }
            if (this.topic_name != null) {
                data.topic_name = this.topic_name;
            }
            if (this.destination != null) {
                data.destination = this.destination.toObject();
            }
            return data;
        }
        serialize(w) {
            const writer = w || new pb_1.BinaryWriter();
            if (this.has_webhook_id)
                writer.writeMessage(1, this.webhook_id, () => this.webhook_id.serialize(writer));
            if (this.topic_name.length)
                writer.writeString(2, this.topic_name);
            if (this.has_destination)
                writer.writeMessage(3, this.destination, () => this.destination.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 _Webhook();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    case 1:
                        reader.readMessage(message.webhook_id, () => message.webhook_id = _WebhookId.deserialize(reader));
                        break;
                    case 2:
                        message.topic_name = reader.readString();
                        break;
                    case 3:
                        reader.readMessage(message.destination, () => message.destination = _WebhookDestination.deserialize(reader));
                        break;
                    default: reader.skipField();
                }
            }
            return message;
        }
        serializeBinary() {
            return this.serialize();
        }
        static deserializeBinary(bytes) {
            return _Webhook.deserialize(bytes);
        }
    }
    __Webhook_one_of_decls = new WeakMap();
    webhook._Webhook = _Webhook;
    class _PutWebhookRequest extends pb_1.Message {
        constructor(data) {
            super();
            __PutWebhookRequest_one_of_decls.set(this, []);
            pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], __classPrivateFieldGet(this, __PutWebhookRequest_one_of_decls, "f"));
            if (!Array.isArray(data) && typeof data == "object") {
                if ("webhook" in data && data.webhook != undefined) {
                    this.webhook = data.webhook;
                }
            }
        }
        get webhook() {
            return pb_1.Message.getWrapperField(this, _Webhook, 1);
        }
        set webhook(value) {
            pb_1.Message.setWrapperField(this, 1, value);
        }
        get has_webhook() {
            return pb_1.Message.getField(this, 1) != null;
        }
        static fromObject(data) {
            const message = new _PutWebhookRequest({});
            if (data.webhook != null) {
                message.webhook = _Webhook.fromObject(data.webhook);
            }
            return message;
        }
        toObject() {
            const data = {};
            if (this.webhook != null) {
                data.webhook = this.webhook.toObject();
            }
            return data;
        }
        serialize(w) {
            const writer = w || new pb_1.BinaryWriter();
            if (this.has_webhook)
                writer.writeMessage(1, this.webhook, () => this.webhook.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 _PutWebhookRequest();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    case 1:
                        reader.readMessage(message.webhook, () => message.webhook = _Webhook.deserialize(reader));
                        break;
                    default: reader.skipField();
                }
            }
            return message;
        }
        serializeBinary() {
            return this.serialize();
        }
        static deserializeBinary(bytes) {
            return _PutWebhookRequest.deserialize(bytes);
        }
    }
    __PutWebhookRequest_one_of_decls = new WeakMap();
    webhook._PutWebhookRequest = _PutWebhookRequest;
    class _PutWebhookResponse extends pb_1.Message {
        constructor(data) {
            super();
            __PutWebhookResponse_one_of_decls.set(this, []);
            pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], __classPrivateFieldGet(this, __PutWebhookResponse_one_of_decls, "f"));
            if (!Array.isArray(data) && typeof data == "object") {
                if ("secret_string" in data && data.secret_string != undefined) {
                    this.secret_string = data.secret_string;
                }
            }
        }
        get secret_string() {
            return pb_1.Message.getFieldWithDefault(this, 1, "");
        }
        set secret_string(value) {
            pb_1.Message.setField(this, 1, value);
        }
        static fromObject(data) {
            const message = new _PutWebhookResponse({});
            if (data.secret_string != null) {
                message.secret_string = data.secret_string;
            }
            return message;
        }
        toObject() {
            const data = {};
            if (this.secret_string != null) {
                data.secret_string = this.secret_string;
            }
            return data;
        }
        serialize(w) {
            const writer = w || new pb_1.BinaryWriter();
            if (this.secret_string.length)
                writer.writeString(1, this.secret_string);
            if (!w)
                return writer.getResultBuffer();
        }
        static deserialize(bytes) {
            const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new _PutWebhookResponse();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    case 1:
                        message.secret_string = reader.readString();
                        break;
                    default: reader.skipField();
                }
            }
            return message;
        }
        serializeBinary() {
            return this.serialize();
        }
        static deserializeBinary(bytes) {
            return _PutWebhookResponse.deserialize(bytes);
        }
    }
    __PutWebhookResponse_one_of_decls = new WeakMap();
    webhook._PutWebhookResponse = _PutWebhookResponse;
    class _DeleteWebhookRequest extends pb_1.Message {
        constructor(data) {
            super();
            __DeleteWebhookRequest_one_of_decls.set(this, []);
            pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], __classPrivateFieldGet(this, __DeleteWebhookRequest_one_of_decls, "f"));
            if (!Array.isArray(data) && typeof data == "object") {
                if ("webhook_id" in data && data.webhook_id != undefined) {
                    this.webhook_id = data.webhook_id;
                }
            }
        }
        get webhook_id() {
            return pb_1.Message.getWrapperField(this, _WebhookId, 1);
        }
        set webhook_id(value) {
            pb_1.Message.setWrapperField(this, 1, value);
        }
        get has_webhook_id() {
            return pb_1.Message.getField(this, 1) != null;
        }
        static fromObject(data) {
            const message = new _DeleteWebhookRequest({});
            if (data.webhook_id != null) {
                message.webhook_id = _WebhookId.fromObject(data.webhook_id);
            }
            return message;
        }
        toObject() {
            const data = {};
            if (this.webhook_id != null) {
                data.webhook_id = this.webhook_id.toObject();
            }
            return data;
        }
        serialize(w) {
            const writer = w || new pb_1.BinaryWriter();
            if (this.has_webhook_id)
                writer.writeMessage(1, this.webhook_id, () => this.webhook_id.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 _DeleteWebhookRequest();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    case 1:
                        reader.readMessage(message.webhook_id, () => message.webhook_id = _WebhookId.deserialize(reader));
                        break;
                    default: reader.skipField();
                }
            }
            return message;
        }
        serializeBinary() {
            return this.serialize();
        }
        static deserializeBinary(bytes) {
            return _DeleteWebhookRequest.deserialize(bytes);
        }
    }
    __DeleteWebhookRequest_one_of_decls = new WeakMap();
    webhook._DeleteWebhookRequest = _DeleteWebhookRequest;
    class _DeleteWebhookResponse extends pb_1.Message {
        constructor(data) {
            super();
            __DeleteWebhookResponse_one_of_decls.set(this, []);
            pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], __classPrivateFieldGet(this, __DeleteWebhookResponse_one_of_decls, "f"));
            if (!Array.isArray(data) && typeof data == "object") { }
        }
        static fromObject(data) {
            const message = new _DeleteWebhookResponse({});
            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 _DeleteWebhookResponse();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    default: reader.skipField();
                }
            }
            return message;
        }
        serializeBinary() {
            return this.serialize();
        }
        static deserializeBinary(bytes) {
            return _DeleteWebhookResponse.deserialize(bytes);
        }
    }
    __DeleteWebhookResponse_one_of_decls = new WeakMap();
    webhook._DeleteWebhookResponse = _DeleteWebhookResponse;
    class _ListWebhookRequest extends pb_1.Message {
        constructor(data) {
            super();
            __ListWebhookRequest_one_of_decls.set(this, []);
            pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], __classPrivateFieldGet(this, __ListWebhookRequest_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;
                }
            }
        }
        get cache_name() {
            return pb_1.Message.getFieldWithDefault(this, 1, "");
        }
        set cache_name(value) {
            pb_1.Message.setField(this, 1, value);
        }
        static fromObject(data) {
            const message = new _ListWebhookRequest({});
            if (data.cache_name != null) {
                message.cache_name = data.cache_name;
            }
            return message;
        }
        toObject() {
            const data = {};
            if (this.cache_name != null) {
                data.cache_name = this.cache_name;
            }
            return data;
        }
        serialize(w) {
            const writer = w || new pb_1.BinaryWriter();
            if (this.cache_name.length)
                writer.writeString(1, this.cache_name);
            if (!w)
                return writer.getResultBuffer();
        }
        static deserialize(bytes) {
            const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new _ListWebhookRequest();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    case 1:
                        message.cache_name = reader.readString();
                        break;
                    default: reader.skipField();
                }
            }
            return message;
        }
        serializeBinary() {
            return this.serialize();
        }
        static deserializeBinary(bytes) {
            return _ListWebhookRequest.deserialize(bytes);
        }
    }
    __ListWebhookRequest_one_of_decls = new WeakMap();
    webhook._ListWebhookRequest = _ListWebhookRequest;
    class _ListWebhooksResponse extends pb_1.Message {
        constructor(data) {
            super();
            __ListWebhooksResponse_one_of_decls.set(this, []);
            pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], __classPrivateFieldGet(this, __ListWebhooksResponse_one_of_decls, "f"));
            if (!Array.isArray(data) && typeof data == "object") {
                if ("webhook" in data && data.webhook != undefined) {
                    this.webhook = data.webhook;
                }
            }
        }
        get webhook() {
            return pb_1.Message.getRepeatedWrapperField(this, _Webhook, 1);
        }
        set webhook(value) {
            pb_1.Message.setRepeatedWrapperField(this, 1, value);
        }
        static fromObject(data) {
            const message = new _ListWebhooksResponse({});
            if (data.webhook != null) {
                message.webhook = data.webhook.map(item => _Webhook.fromObject(item));
            }
            return message;
        }
        toObject() {
            const data = {};
            if (this.webhook != null) {
                data.webhook = this.webhook.map((item) => item.toObject());
            }
            return data;
        }
        serialize(w) {
            const writer = w || new pb_1.BinaryWriter();
            if (this.webhook.length)
                writer.writeRepeatedMessage(1, this.webhook, (item) => item.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 _ListWebhooksResponse();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    case 1:
                        reader.readMessage(message.webhook, () => pb_1.Message.addToRepeatedWrapperField(message, 1, _Webhook.deserialize(reader), _Webhook));
                        break;
                    default: reader.skipField();
                }
            }
            return message;
        }
        serializeBinary() {
            return this.serialize();
        }
        static deserializeBinary(bytes) {
            return _ListWebhooksResponse.deserialize(bytes);
        }
    }
    __ListWebhooksResponse_one_of_decls = new WeakMap();
    webhook._ListWebhooksResponse = _ListWebhooksResponse;
    class _GetWebhookSecretRequest extends pb_1.Message {
        constructor(data) {
            super();
            __GetWebhookSecretRequest_one_of_decls.set(this, []);
            pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], __classPrivateFieldGet(this, __GetWebhookSecretRequest_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 ("webhook_name" in data && data.webhook_name != undefined) {
                    this.webhook_name = data.webhook_name;
                }
            }
        }
        get cache_name() {
            return pb_1.Message.getFieldWithDefault(this, 1, "");
        }
        set cache_name(value) {
            pb_1.Message.setField(this, 1, value);
        }
        get webhook_name() {
            return pb_1.Message.getFieldWithDefault(this, 2, "");
        }
        set webhook_name(value) {
            pb_1.Message.setField(this, 2, value);
        }
        static fromObject(data) {
            const message = new _GetWebhookSecretRequest({});
            if (data.cache_name != null) {
                message.cache_name = data.cache_name;
            }
            if (data.webhook_name != null) {
                message.webhook_name = data.webhook_name;
            }
            return message;
        }
        toObject() {
            const data = {};
            if (this.cache_name != null) {
                data.cache_name = this.cache_name;
            }
            if (this.webhook_name != null) {
                data.webhook_name = this.webhook_name;
            }
            return data;
        }
        serialize(w) {
            const writer = w || new pb_1.BinaryWriter();
            if (this.cache_name.length)
                writer.writeString(1, this.cache_name);
            if (this.webhook_name.length)
                writer.writeString(2, this.webhook_name);
            if (!w)
                return writer.getResultBuffer();
        }
        static deserialize(bytes) {
            const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new _GetWebhookSecretRequest();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    case 1:
                        message.cache_name = reader.readString();
                        break;
                    case 2:
                        message.webhook_name = reader.readString();
                        break;
                    default: reader.skipField();
                }
            }
            return message;
        }
        serializeBinary() {
            return this.serialize();
        }
        static deserializeBinary(bytes) {
            return _GetWebhookSecretRequest.deserialize(bytes);
        }
    }
    __GetWebhookSecretRequest_one_of_decls = new WeakMap();
    webhook._GetWebhookSecretRequest = _GetWebhookSecretRequest;
    class _GetWebhookSecretResponse extends pb_1.Message {
        constructor(data) {
            super();
            __GetWebhookSecretResponse_one_of_decls.set(this, []);
            pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], __classPrivateFieldGet(this, __GetWebhookSecretResponse_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 ("webhook_name" in data && data.webhook_name != undefined) {
                    this.webhook_name = data.webhook_name;
                }
                if ("secret_string" in data && data.secret_string != undefined) {
                    this.secret_string = data.secret_string;
                }
            }
        }
        get cache_name() {
            return pb_1.Message.getFieldWithDefault(this, 1, "");
        }
        set cache_name(value) {
            pb_1.Message.setField(this, 1, value);
        }
        get webhook_name() {
            return pb_1.Message.getFieldWithDefault(this, 2, "");
        }
        set webhook_name(value) {
            pb_1.Message.setField(this, 2, value);
        }
        get secret_string() {
            return pb_1.Message.getFieldWithDefault(this, 3, "");
        }
        set secret_string(value) {
            pb_1.Message.setField(this, 3, value);
        }
        static fromObject(data) {
            const message = new _GetWebhookSecretResponse({});
            if (data.cache_name != null) {
                message.cache_name = data.cache_name;
            }
            if (data.webhook_name != null) {
                message.webhook_name = data.webhook_name;
            }
            if (data.secret_string != null) {
                message.secret_string = data.secret_string;
            }
            return message;
        }
        toObject() {
            const data = {};
            if (this.cache_name != null) {
                data.cache_name = this.cache_name;
            }
            if (this.webhook_name != null) {
                data.webhook_name = this.webhook_name;
            }
            if (this.secret_string != null) {
                data.secret_string = this.secret_string;
            }
            return data;
        }
        serialize(w) {
            const writer = w || new pb_1.BinaryWriter();
            if (this.cache_name.length)
                writer.writeString(1, this.cache_name);
            if (this.webhook_name.length)
                writer.writeString(2, this.webhook_name);
            if (this.secret_string.length)
                writer.writeString(3, this.secret_string);
            if (!w)
                return writer.getResultBuffer();
        }
        static deserialize(bytes) {
            const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new _GetWebhookSecretResponse();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    case 1:
                        message.cache_name = reader.readString();
                        break;
                    case 2:
                        message.webhook_name = reader.readString();
                        break;
                    case 3:
                        message.secret_string = reader.readString();
                        break;
                    default: reader.skipField();
                }
            }
            return message;
        }
        serializeBinary() {
            return this.serialize();
        }
        static deserializeBinary(bytes) {
            return _GetWebhookSecretResponse.deserialize(bytes);
        }
    }
    __GetWebhookSecretResponse_one_of_decls = new WeakMap();
    webhook._GetWebhookSecretResponse = _GetWebhookSecretResponse;
    class _WebhookDestination extends pb_1.Message {
        constructor(data) {
            super();
            __WebhookDestination_one_of_decls.set(this, [[1]]);
            pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], __classPrivateFieldGet(this, __WebhookDestination_one_of_decls, "f"));
            if (!Array.isArray(data) && typeof data == "object") {
                if ("post_url" in data && data.post_url != undefined) {
                    this.post_url = data.post_url;
                }
            }
        }
        get post_url() {
            return pb_1.Message.getFieldWithDefault(this, 1, "");
        }
        set post_url(value) {
            pb_1.Message.setOneofField(this, 1, __classPrivateFieldGet(this, __WebhookDestination_one_of_decls, "f")[0], value);
        }
        get has_post_url() {
            return pb_1.Message.getField(this, 1) != null;
        }
        get kind() {
            const cases = {
                0: "none",
                1: "post_url"
            };
            return cases[pb_1.Message.computeOneofCase(this, [1])];
        }
        static fromObject(data) {
            const message = new _WebhookDestination({});
            if (data.post_url != null) {
                message.post_url = data.post_url;
            }
            return message;
        }
        toObject() {
            const data = {};
            if (this.post_url != null) {
                data.post_url = this.post_url;
            }
            return data;
        }
        serialize(w) {
            const writer = w || new pb_1.BinaryWriter();
            if (this.has_post_url)
                writer.writeString(1, this.post_url);
            if (!w)
                return writer.getResultBuffer();
        }
        static deserialize(bytes) {
            const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new _WebhookDestination();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    case 1:
                        message.post_url = reader.readString();
                        break;
                    default: reader.skipField();
                }
            }
            return message;
        }
        serializeBinary() {
            return this.serialize();
        }
        static deserializeBinary(bytes) {
            return _WebhookDestination.deserialize(bytes);
        }
    }
    __WebhookDestination_one_of_decls = new WeakMap();
    webhook._WebhookDestination = _WebhookDestination;
    class _RotateWebhookSecretRequest extends pb_1.Message {
        constructor(data) {
            super();
            __RotateWebhookSecretRequest_one_of_decls.set(this, []);
            pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], __classPrivateFieldGet(this, __RotateWebhookSecretRequest_one_of_decls, "f"));
            if (!Array.isArray(data) && typeof data == "object") {
                if ("webhook_id" in data && data.webhook_id != undefined) {
                    this.webhook_id = data.webhook_id;
                }
            }
        }
        get webhook_id() {
            return pb_1.Message.getWrapperField(this, _WebhookId, 1);
        }
        set webhook_id(value) {
            pb_1.Message.setWrapperField(this, 1, value);
        }
        get has_webhook_id() {
            return pb_1.Message.getField(this, 1) != null;
        }
        static fromObject(data) {
            const message = new _RotateWebhookSecretRequest({});
            if (data.webhook_id != null) {
                message.webhook_id = _WebhookId.fromObject(data.webhook_id);
            }
            return message;
        }
        toObject() {
            const data = {};
            if (this.webhook_id != null) {
                data.webhook_id = this.webhook_id.toObject();
            }
            return data;
        }
        serialize(w) {
            const writer = w || new pb_1.BinaryWriter();
            if (this.has_webhook_id)
                writer.writeMessage(1, this.webhook_id, () => this.webhook_id.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 _RotateWebhookSecretRequest();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    case 1:
                        reader.readMessage(message.webhook_id, () => message.webhook_id = _WebhookId.deserialize(reader));
                        break;
                    default: reader.skipField();
                }
            }
            return message;
        }
        serializeBinary() {
            return this.serialize();
        }
        static deserializeBinary(bytes) {
            return _RotateWebhookSecretRequest.deserialize(bytes);
        }
    }
    __RotateWebhookSecretRequest_one_of_decls = new WeakMap();
    webhook._RotateWebhookSecretRequest = _RotateWebhookSecretRequest;
    class _RotateWebhookSecretResponse extends pb_1.Message {
        constructor(data) {
            super();
            __RotateWebhookSecretResponse_one_of_decls.set(this, []);
            pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], __classPrivateFieldGet(this, __RotateWebhookSecretResponse_one_of_decls, "f"));
            if (!Array.isArray(data) && typeof data == "object") {
                if ("secret_string" in data && data.secret_string != undefined) {
                    this.secret_string = data.secret_string;
                }
            }
        }
        get secret_string() {
            return pb_1.Message.getFieldWithDefault(this, 1, "");
        }
        set secret_string(value) {
            pb_1.Message.setField(this, 1, value);
        }
        static fromObject(data) {
            const message = new _RotateWebhookSecretResponse({});
            if (data.secret_string != null) {
                message.secret_string = data.secret_string;
            }
            return message;
        }
        toObject() {
            const data = {};
            if (this.secret_string != null) {
                data.secret_string = this.secret_string;
            }
            return data;
        }
        serialize(w) {
            const writer = w || new pb_1.BinaryWriter();
            if (this.secret_string.length)
                writer.writeString(1, this.secret_string);
            if (!w)
                return writer.getResultBuffer();
        }
        static deserialize(bytes) {
            const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new _RotateWebhookSecretResponse();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    case 1:
                        message.secret_string = reader.readString();
                        break;
                    default: reader.skipField();
                }
            }
            return message;
        }
        serializeBinary() {
            return this.serialize();
        }
        static deserializeBinary(bytes) {
            return _RotateWebhookSecretResponse.deserialize(bytes);
        }
    }
    __RotateWebhookSecretResponse_one_of_decls = new WeakMap();
    webhook._RotateWebhookSecretResponse = _RotateWebhookSecretResponse;
    class UnimplementedWebhookService {
    }
    UnimplementedWebhookService.definition = {
        PutWebhook: {
            path: "/webhook.Webhook/PutWebhook",
            requestStream: false,
            responseStream: false,
            requestSerialize: (message) => Buffer.from(message.serialize()),
            requestDeserialize: (bytes) => _PutWebhookRequest.deserialize(new Uint8Array(bytes)),
            responseSerialize: (message) => Buffer.from(message.serialize()),
            responseDeserialize: (bytes) => _PutWebhookResponse.deserialize(new Uint8Array(bytes))
        },
        DeleteWebhook: {
            path: "/webhook.Webhook/DeleteWebhook",
            requestStream: false,
            responseStream: false,
            requestSerialize: (message) => Buffer.from(message.serialize()),
            requestDeserialize: (bytes) => _DeleteWebhookRequest.deserialize(new Uint8Array(bytes)),
            responseSerialize: (message) => Buffer.from(message.serialize()),
            responseDeserialize: (bytes) => _DeleteWebhookResponse.deserialize(new Uint8Array(bytes))
        },
        ListWebhooks: {
            path: "/webhook.Webhook/ListWebhooks",
            requestStream: false,
            responseStream: false,
            requestSerialize: (message) => Buffer.from(message.serialize()),
            requestDeserialize: (bytes) => _ListWebhookRequest.deserialize(new Uint8Array(bytes)),
            responseSerialize: (message) => Buffer.from(message.serialize()),
            responseDeserialize: (bytes) => _ListWebhooksResponse.deserialize(new Uint8Array(bytes))
        },
        GetWebhookSecret: {
            path: "/webhook.Webhook/GetWebhookSecret",
            requestStream: false,
            responseStream: false,
            requestSerialize: (message) => Buffer.from(message.serialize()),
            requestDeserialize: (bytes) => _GetWebhookSecretRequest.deserialize(new Uint8Array(bytes)),
            responseSerialize: (message) => Buffer.from(message.serialize()),
            responseDeserialize: (bytes) => _GetWebhookSecretResponse.deserialize(new Uint8Array(bytes))
        },
        RotateWebhookSecret: {
            path: "/webhook.Webhook/RotateWebhookSecret",
            requestStream: false,
            responseStream: false,
            requestSerialize: (message) => Buffer.from(message.serialize()),
            requestDeserialize: (bytes) => _RotateWebhookSecretRequest.deserialize(new Uint8Array(bytes)),
            responseSerialize: (message) => Buffer.from(message.serialize()),
            responseDeserialize: (bytes) => _RotateWebhookSecretResponse.deserialize(new Uint8Array(bytes))
        }
    };
    webhook.UnimplementedWebhookService = UnimplementedWebhookService;
    class WebhookClient extends grpc_1.makeGenericClientConstructor(UnimplementedWebhookService.definition, "Webhook", {}) {
        constructor(address, credentials, options) {
            super(address, credentials, options);
            this.PutWebhook = (message, metadata, options, callback) => {
                return super.PutWebhook(message, metadata, options, callback);
            };
            this.DeleteWebhook = (message, metadata, options, callback) => {
                return super.DeleteWebhook(message, metadata, options, callback);
            };
            this.ListWebhooks = (message, metadata, options, callback) => {
                return super.ListWebhooks(message, metadata, options, callback);
            };
            this.GetWebhookSecret = (message, metadata, options, callback) => {
                return super.GetWebhookSecret(message, metadata, options, callback);
            };
            this.RotateWebhookSecret = (message, metadata, options, callback) => {
                return super.RotateWebhookSecret(message, metadata, options, callback);
            };
        }
    }
    webhook.WebhookClient = WebhookClient;
})(webhook = exports.webhook || (exports.webhook = {}));
